-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (32 loc) · 1.52 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
cmake_minimum_required(VERSION 3.15)
project(TheOnlyEscape VERSION 1.0)
file(GLOB SRC src/*.cpp src/*.h)
# libs we need:
### -lGL -lGLU -lglut -lGLEW -lSDL2main -lSDL2 -lSDL2_mixer
find_package(GLEW REQUIRED)
find_package(FreeGLUT CONFIG REQUIRED)
find_package(GLUT REQUIRED)
find_package(glm CONFIG REQUIRED)
find_package(SDL2 CONFIG REQUIRED)
find_package(SDL2_mixer CONFIG REQUIRED)
add_executable(escape ${SRC})
target_link_libraries(escape
PRIVATE
$<IF:$<TARGET_EXISTS:FreeGLUT::freeglut>,FreeGLUT::freeglut,FreeGLUT::freeglut_static>
GLUT::GLUT
GLEW::GLEW
glm::glm
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
$<IF:$<TARGET_EXISTS:SDL2_mixer::SDL2_mixer>,SDL2_mixer::SDL2_mixer,SDL2_mixer::SDL2_mixer-static>
)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/shaders/ DESTINATION ${CMAKE_BINARY_DIR}/shaders/)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/resources/sound/ DESTINATION ${CMAKE_BINARY_DIR}/resources/sound/)
#install for distribution
install(TARGETS escape)
file(GLOB runtime_dlls LIST_DIRECTORIES false ${CMAKE_CURRENT_BINARY_DIR}/*.dll)
install(FILES ${runtime_dlls} DESTINATION bin)
file(GLOB runtime_shaders LIST_DIRECTORIES false ${CMAKE_CURRENT_SOURCE_DIR}/shaders/*.glsl)
install(FILES ${runtime_shaders} DESTINATION bin/shaders)
file(GLOB runtime_sounds LIST_DIRECTORIES false ${CMAKE_CURRENT_SOURCE_DIR}/resources/sound/*.wav)
install(FILES ${runtime_sounds} DESTINATION bin/resources/sound)