-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
80 lines (67 loc) · 2.29 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
cmake_minimum_required(VERSION 2.6)
project(VitaEngine LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#uncomment below line for debugging
#add_definitions(-DSTD_SR1_DEBUG)
include_directories(
shared/include/common
src
)
file(GLOB ENGINEFILES
src/engine/*.cpp
src/engine/*.h)
add_library(VitaEngine ${ENGINEFILES})
file (GLOB RENDFILES
shared/include/common/rend/*.cpp
shared/include/common/rend/*.h)
add_library(rend ${RENDFILES})
if (MSVC)
link_directories(${CMAKE_SOURCE_DIR}/shared/lib/msvc)
target_include_directories(VitaEngine PUBLIC ${CMAKE_SOURCE_DIR}/shared/include/msvc)
target_link_libraries(VitaEngine rend SDL2 glew32 opengl32 OpenAL32)
else()
#uncomment below line if it doesn't build
#link_directories(${CMAKE_SOURCE_DIR}/shared/lib/gcc)
target_include_directories(VitaEngine PUBLIC ${CMAKE_SOURCE_DIR}/shared/include/gcc)
target_link_libraries(VitaEngine rend SDL2 GLEW GL GLU openal)
endif()
add_executable(VitaDemo
src/game/main.cpp
src/game/Player.cpp
src/game/Player.h
)
target_link_libraries(VitaDemo VitaEngine)
if (MSVC)
add_custom_command(TARGET VitaDemo POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/shared/lib/msvc/SDL2.dll"
"$<TARGET_FILE_DIR:VitaDemo>"
)
add_custom_command(TARGET VitaDemo POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/shared/lib/msvc/glew32.dll"
"$<TARGET_FILE_DIR:VitaDemo>"
)
add_custom_command(TARGET VitaDemo POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/shared/lib/msvc/OpenAL32.dll"
"$<TARGET_FILE_DIR:VitaDemo>"
)
else()
add_custom_command(TARGET VitaDemo POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/shared/lib/gcc/libSDL2.a"
"$<TARGET_FILE_DIR:VitaDemo>"
)
add_custom_command(TARGET VitaDemo POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/shared/lib/gcc/libglew32.a"
"$<TARGET_FILE_DIR:VitaDemo>"
)
add_custom_command(TARGET VitaDemo POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/shared/lib/gcc/libOpenAL32.a"
"$<TARGET_FILE_DIR:VitaDemo>"
)
endif()