-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
169 lines (141 loc) · 4.56 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
cmake_minimum_required (VERSION 2.8)
project (ProjectDraw_Slim)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
file(GLOB_RECURSE ENGINE_SRC
"src/Core/*.h"
"src/Core/*.cpp"
)
file(GLOB_RECURSE CUDARENDER_SRC
"src/CudaRender/*.h"
"src/CudaRender/*.cpp"
)
file(GLOB_RECURSE RECORDER_SRC
"src/Recorder/*.h"
"src/Recorder/*.cpp"
)
file(GLOB_RECURSE PHYSICS_SRC
"src/Physics/*.h"
"src/Physics/*.cpp"
)
file(GLOB_RECURSE EXAMPLE_3D_SRC
"examples/3d_demo/*.h"
"examples/3d_demo/*.cpp"
)
file(GLOB_RECURSE EXAMPLE_2D_SRC
"examples/2d_demo/*.h"
"examples/2d_demo/*.cpp"
)
file(GLOB_RECURSE EXAMPLE_PHYSICS3D_SRC
"examples/physics3d_example/*.h"
"examples/physics3d_example/*.cpp"
)
file(GLOB_RECURSE EXPERIMENTAL_OPENGL
"test/opengl_test/*.h"
"test/opengl_test/*.cpp"
)
find_package(stb REQUIRED)
find_package(GLM REQUIRED)
find_package(Bullet REQUIRED)
find_package(GLEW REQUIRED)
find_package(Assimp REQUIRED)
find_package(OpenGL REQUIRED)
find_package(Freetype REQUIRED)
find_package(SFML REQUIRED)
add_library(projectdraw_core ${ENGINE_SRC})
include_directories(
${Assimp_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
${stb_INCLUDE_DIRS}
${GLM_INCLUDE_DIRS}
)
target_link_libraries(projectdraw_core
${Assimp_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
${FREETYPE_LIBRARIES}
)
add_library(projectdraw_physics3d ${PHYSICS_SRC})
add_dependencies(projectdraw_physics3d projectdraw_core)
include_directories(
${Bullet_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src
)
target_link_libraries(projectdraw_physics3d
debug /home/vincent/Development/Cpp/projectdraw_slim/build/debug/libprojectdraw_core.a
optimized /home/vincent/Development/Cpp/projectdraw_slim/build/release/libprojectdraw_core.a
)
if(${SFML_FOUND})
#Examples
#Scene3D Example
include_directories(
${FREETYPE_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS}
${stb_INCLUDE_DIRS}
${GLM_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src
)
add_executable(3d_example ${EXAMPLE_3D_SRC})
add_dependencies(3d_example projectdraw_core)
target_link_libraries(3d_example
${FREETYPE_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
${Assimp_LIBRARIES}
${SFML_LIBRARIES}
debug /home/vincent/Development/Cpp/projectdraw_slim/build/debug/libprojectdraw_core.a
optimized /home/vincent/Development/Cpp/projectdraw_slim/build/release/libprojectdraw_core.a
)
add_executable(2d_example ${EXAMPLE_2D_SRC})
add_dependencies(2d_example projectdraw_core)
target_link_libraries(2d_example
${FREETYPE_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
${Assimp_LIBRARIES}
${SFML_LIBRARIES}
debug /home/vincent/Development/Cpp/projectdraw_slim/build/debug/libprojectdraw_core.a
optimized /home/vincent/Development/Cpp/projectdraw_slim/build/release/libprojectdraw_core.a
)
#Physics3D Example
include_directories(
${Bullet_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS}
${stb_INCLUDE_DIRS}
${GLM_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src
)
add_executable(physics3d_example ${EXAMPLE_PHYSICS3D_SRC})
add_dependencies(physics3d_example projectdraw_core projectdraw_physics3d)
target_link_libraries(physics3d_example
${FREETYPE_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
${Assimp_LIBRARIES}
${SFML_LIBRARIES}
debug /home/vincent/Development/Cpp/projectdraw_slim/build/debug/libprojectdraw_core.a
optimized /home/vincent/Development/Cpp/projectdraw_slim/build/release/libprojectdraw_core.a
debug /home/vincent/Development/Cpp/projectdraw_slim/build/debug/libprojectdraw_physics3d.a
optimized /home/vincent/Development/Cpp/projectdraw_slim/build/release/libprojectdraw_physics3d.a
${Bullet_LIBRARIES}
)
#Experimental
add_executable(opengl_test ${EXPERIMENTAL_OPENGL})
add_dependencies(opengl_test projectdraw_core projectdraw_physics3d)
target_link_libraries(opengl_test
${FREETYPE_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
${Assimp_LIBRARIES}
${SFML_LIBRARIES}
debug /home/vincent/Development/Cpp/projectdraw_slim/build/debug/libprojectdraw_core.a
optimized /home/vincent/Development/Cpp/projectdraw_slim/build/release/libprojectdraw_core.a
debug /home/vincent/Development/Cpp/projectdraw_slim/build/debug/libprojectdraw_physics3d.a
optimized /home/vincent/Development/Cpp/projectdraw_slim/build/release/libprojectdraw_physics3d.a
${Bullet_LIBRARIES}
)
endif()