forked from cyberegoorg/cetech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
282 lines (234 loc) · 9.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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
################################################################################
# CETech
################################################################################
cmake_minimum_required(VERSION 3.5)
project(cetech)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Werror -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Werror -Wall")
set(EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic")
include_directories(src)
add_definitions(-DCETECH_STATIC_PLUGINS)
add_definitions(-DCETECH_USE_SDL)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CONFIGURATION debug)
add_definitions(-DDEBUG)
else ()
set(CONFIGURATION release)
endif ()
if (APPLE)
set(PLATFORM_ID darwin64)
elseif (UNIX)
set(PLATFORM_ID linux64)
elseif (WIN32)
set(PLATFORM_ID windows64)
add_definitions(-DCETECH_WINDOWS)
add_definitions(-DCETECH_WINDOWS)
endif ()
link_directories(externals/build/${PLATFORM_ID}/release/lib/)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${PLATFORM_ID})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${PLATFORM_ID})
################################################################################
# Sources
################################################################################
set(EXTERNAL_SOURCE_FILES
src/sqlite/private/sqlite3.c
)
set(CORELIB_SOURCE_FILES
########################################################################
# Core
########################################################################
src/celib/private/api.c
src/celib/private/log.c
src/celib/private/celib_module.c
src/celib/private/config.c
src/celib/memory/private/memory.c
src/celib/memory/private/memory_tracer.c
src/celib/private/task.c
src/celib/private/log_stdout.c
src/celib/private/id.c
src/celib/os/private/os.c
src/celib/os/private/os_error.c
src/celib/os/private/os_object.c
src/celib/os/private/os_path.c
src/celib/os/private/os_process.c
src/celib/os/private/os_cpu.c
src/celib/os/private/os_thread.c
src/celib/os/private/os_vio.c
src/celib/os/private/os_time.c
src/celib/os/private/os_window_sdl2.c
src/celib/os/private/os_input_sdl.c
src/celib/private/fs.c
src/celib/private/ydb.c
src/celib/private/cdb.c
src/celib/private/core.c
)
set(SOURCE_FILES
${EXTERNAL_SOURCE_FILES}
src/cetech/resource/private/resource.c
src/cetech/resource/private/resource_compiler.c
src/cetech/kernel/private/kernel.c
src/cetech/debugui/private/bgfx_imgui/imgui.cpp
src/cetech/debugui/private/ocornut-imgui/imgui.cpp
src/cetech/debugui/private/ocornut-imgui/imgui_draw.cpp
src/cetech/debugui/private/debugui.cpp
src/cetech/machine/private/machine_sdl2.c
src/cetech/ecs/private/ecs.c
src/cetech/controlers/private/keyboard.c
src/cetech/controlers/private/controlers.c
src/cetech/controlers/private/mouse.c
src/cetech/controlers/private/gamepad.c
src/cetech/renderer/private/renderer.c
src/cetech/render_graph/private/render_graph.c
src/cetech/debugdraw/private/bgfx_debugdraw/debugdraw.cpp
src/cetech/debugdraw/private/bgfx_debugdraw/bounds.cpp
src/cetech/debugdraw/private/dd.cpp
src/cetech/default_rg/private/default_rg.c
src/cetech/texture/private/texture.c
src/cetech/shader/private/shader.c
src/cetech/material/private/material.c
src/cetech/scene/private/scene.c
src/cetech/scene/private/scene_compiler.cpp
src/cetech/mesh/private/static_mesh.c
src/cetech/mesh/private/static_mesh.c
src/cetech/mesh/private/primitive_mesh.c
src/cetech/transform/private/transform.c
src/cetech/camera/private/camera.c
src/cetech/entity/private/entity_editor.c
src/cetech/resource_editor/private/resource_editor.c
src/cetech/entity/private/entity_property.c
src/cetech/explorer/private/explorer.c
src/cetech/resource_preview/private/resource_preview.c
src/cetech/resource_browser/private/resource_browser.cpp
src/cetech/editor/private/editor.c
src/cetech/property_editor/private/property_editor.c
src/cetech/log_view/private/log_view.cpp
src/cetech/editor/private/action_manager.c
src/cetech/resource/private/resourcedb.c
src/cetech/editor/private/editor_ui.c
src/cetech/game/private/game_system.c
src/cetech/game/private/game_view.c
src/cetech/entity/private/entity_explorer.c
src/cetech/editor/private/selected_object.c
src/cetech/editor/private/dock.c
src/cetech/node_graph/private/node_graph.c
src/cetech/node_graph/private/node_test.c
src/cetech/node_graph_editor/private/node_graph_editor.cpp
src/cetech/physics2d/private/physics2d.c
src/cetech/physics2d_box2d/private/physics2d_box2d.cpp
src/cetech/physics3d/private/physics3d.c
src/cetech/physics3d_bullet/private/physics3d_bullet.cpp
src/cetech/parent/private/parent.c
src/cetech/metrics/private/metrics.c
# src/cetech/mono/private/mono.c
)
################################################################################
# Main sources
################################################################################
set(MAIN_SOURCE_FILES
${SOURCE_FILES})
################################################################################
# Release sources
################################################################################
if (APPLE)
set(RELEASE_LIBS_DARWIN
z
dl
m
iconv
objc
"-framework Cocoa"
"-framework CoreAudio"
"-framework AudioToolbox"
"-framework ForceFeedback"
#"-framework CoreVideo"
"-framework Carbon"
"-framework IOKit"
"-framework QuartzCore"
"-framework Metal"
)
elseif (UNIX)
set(RELEASE_LIBS_LINUX
#jemalloc_pic.a
pthread
anl # NANOMSG
dl
X11
GL
z
)
endif ()
if (WIN32)
set(RELEASE_LIBS_WINDOWS
zlibstatic
)
endif ()
set(RELEASE_LIBS
${RELEASE_LIBS_LINUX}
${RELEASE_LIBS_WINDOWS}
${RELEASE_LIBS_DARWIN}
bgfxRelease.a
bimgRelease.a
bxRelease.a
nfd.a
SDL2.a
yaml_static.a
Box2D.a
# monosgen-2.0.a
celib
Bullet2FileLoader.a
Bullet3Collision.a
Bullet3Common.a
Bullet3Dynamics.a
Bullet3Geometry.a
Bullet3OpenCL_clew.a
BulletCollision.a
BulletDynamics.a
BulletInverseDynamics.a
BulletSoftBody.a
clsocket.a
LinearMath.a
)
################################################################################
# Develop sources
################################################################################
set(DEVELOP_LIBS
${RELEASE_LIBS}
)
include_directories(externals/build/${PLATFORM_ID}/release/include)
include_directories(externals/build/${PLATFORM_ID}/release/include/bullet)
#include_directories(/usr/local/include/mono-2.0)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${PLATFORM_ID})
################################################################################
# Cetech RUNTIME
################################################################################
#add_executable(cetech ${MAIN_SOURCE_FILES})
#target_compile_definitions(cetech PUBLIC -DCETECH_RELEASE)
#target_link_libraries(cetech ${RELEASE_LIBS})
#target_include_directories(cetech PUBLIC externals/build/${PLATFORM_ID}/release/)
#target_include_directories(cetech PUBLIC externals/build/${PLATFORM_ID}/${CONFIGURATION}/include)
################################################################################
# Corelib
################################################################################
add_library(celib STATIC ${CORELIB_SOURCE_FILES})
target_include_directories(celib PUBLIC externals/build/${PLATFORM_ID}/release/)
add_executable(doc src/tools/doc/doc.c)
target_link_libraries(doc ${DEVELOP_LIBS})
target_include_directories(doc PUBLIC externals/build/${PLATFORM_ID}/release/)
add_executable(hash src/tools/hash/hash.c)
target_link_libraries(hash ${DEVELOP_LIBS})
target_include_directories(hash PUBLIC externals/build/${PLATFORM_ID}/release/)
################################################################################
# Cetech DEVELOP
################################################################################
add_executable(cetech_develop ${MAIN_SOURCE_FILES})
target_compile_definitions(cetech_develop PUBLIC -DCETECH_DEVELOP)
target_link_libraries(cetech_develop ${DEVELOP_LIBS})
target_include_directories(cetech_develop PUBLIC externals/build/${PLATFORM_ID}/release/)
add_library(cetech_develop_lib SHARED ${SOURCE_FILES})
target_link_libraries(cetech_develop_lib ${DEVELOP_LIBS})
target_include_directories(cetech_develop_lib PUBLIC externals/build/${PLATFORM_ID}/release/)
add_library(example_develop SHARED examples/develop/src/game_example.c)
set_target_properties(example_develop PROPERTIES PREFIX "game_")
add_library(profiler SHARED src/cetech/profiler/private/profiler_dock.c)
set_target_properties(profiler PROPERTIES PREFIX "module_")