SDLU/CMakeLists.txt

42 lines
632 B
Text
Raw Normal View History

2020-05-16 12:34:20 +02:00
cmake_minimum_required(VERSION 3.8)
project(sdlu)
2021-04-23 15:08:51 +02:00
find_package(SDL2 CONFIG REQUIRED)
2021-04-24 14:58:02 +02:00
if(WIN32)
set(SDL2_INCLUDE_DIRS SDL2::SDL2)
set(SDL2_PREFIX SDL2::)
else()
set(SDL2_PREFIX "")
endif()
2021-04-23 15:08:51 +02:00
option(BUILD_EXAMPLES "Builds the example projects" ON)
add_subdirectory(lib/sdl2_gfx)
file(GLOB_RECURSE sdlu_includes
"include/*.hpp"
)
file(GLOB_RECURSE sdlu_sources
"src/*.cpp"
)
add_library(sdlu
${sdlu_includes} ${sdlu_sources}
)
target_include_directories(sdlu PUBLIC
"include"
sdl2_gfx
)
target_link_libraries(sdlu PUBLIC
sdl2_gfx
)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
2021-04-24 14:35:49 +02:00
endif()