Made cmake platform independent
This commit is contained in:
parent
0686e9c920
commit
db78910240
2 changed files with 9 additions and 4 deletions
|
@ -4,6 +4,13 @@ project(sdlu)
|
|||
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
|
||||
if(WIN32)
|
||||
set(SDL2_INCLUDE_DIRS SDL2::SDL2)
|
||||
set(SDL2_PREFIX SDL2::)
|
||||
else()
|
||||
set(SDL2_PREFIX "")
|
||||
endif()
|
||||
|
||||
option(BUILD_EXAMPLES "Builds the example projects" ON)
|
||||
|
||||
add_subdirectory(lib/sdl2_gfx)
|
||||
|
@ -22,13 +29,11 @@ add_library(sdlu
|
|||
|
||||
target_include_directories(sdlu PUBLIC
|
||||
"include"
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
sdl2_gfx
|
||||
)
|
||||
|
||||
target_link_libraries(sdlu PUBLIC
|
||||
sdl2_gfx
|
||||
SDL2 SDL2main
|
||||
)
|
||||
|
||||
if(BUILD_EXAMPLES)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue