-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (39 loc) · 1.35 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
39
40
41
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.7)
project(2d_sdl_game_engine)
set(CMAKE_CXX_STANDARD 17)
file(GLOB SOURCES
*.c
*.cpp
*.h
src/*.c
src/*.h
src/*.cpp
src/*/*.c
src/*/*.cpp
src/*/*.h
src/libs/*.c
src/libs/*.cpp
src/libs/*.h
src/libs/*/*.c
src/libs/*/*.cpp
src/libs/*/*.h
)
add_executable(2d_sdl_game_engine ${SOURCES})
# SDL2
find_package(SDL2 CONFIG REQUIRED)
target_link_libraries(2d_sdl_game_engine
PRIVATE
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
)
find_package(SDL2_ttf CONFIG REQUIRED)
target_link_libraries(2d_sdl_game_engine PRIVATE $<IF:$<TARGET_EXISTS:SDL2_ttf::SDL2_ttf>,SDL2_ttf::SDL2_ttf,SDL2_ttf::SDL2_ttf-static>)
find_package(SDL2_image CONFIG REQUIRED)
target_link_libraries(2d_sdl_game_engine PRIVATE $<IF:$<TARGET_EXISTS:SDL2_image::SDL2_image>,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static>)
find_package(sol2 CONFIG REQUIRED)
target_link_libraries(2d_sdl_game_engine PRIVATE sol2)
find_package(glm CONFIG REQUIRED)
target_link_libraries(2d_sdl_game_engine PRIVATE glm::glm)
find_package(Lua REQUIRED)
target_include_directories(2d_sdl_game_engine PRIVATE ${LUA_INCLUDE_DIR})
target_link_libraries(2d_sdl_game_engine PRIVATE ${LUA_LIBRARIES})