-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (28 loc) · 1.1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
cmake_minimum_required(VERSION 3.16)
project(qkamber)
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "src/*.cpp")
# include the specific platform
list(FILTER SOURCES EXCLUDE REGEX "src/platform")
set(PLATFORM "sdl")
if(WINDOWS)
set(PLATFORM "win32")
endif()
file(GLOB_RECURSE PLATFORM_SOURCES CONFIGURE_DEPENDS "src/platform/${PLATFORM}/*.cpp")
list(APPEND SOURCES ${PLATFORM_SOURCES})
add_executable(qkamber ${SOURCES})
target_include_directories(qkamber PRIVATE "src")
target_precompile_headers(qkamber PRIVATE "src/precompiled.h")
if(${PLATFORM} STREQUAL "sdl")
add_subdirectory("extern/sdl")
target_include_directories(qkamber PRIVATE "extern/sdl/include")
target_link_libraries(qkamber PRIVATE SDL2)
add_subdirectory("extern/freetype")
add_library(Freetype::Freetype ALIAS freetype)
add_subdirectory("extern/sdl_ttf")
target_include_directories(qkamber PRIVATE "extern/sdl_ttf")
target_link_libraries(qkamber PRIVATE SDL2_ttf)
endif()
target_compile_options(qkamber PRIVATE "-O2")
# copy assets
file(GLOB ASSETS CONFIGURE_DEPENDS "assets/*")
file(COPY ${ASSETS} DESTINATION .)