-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
304 lines (253 loc) · 11.2 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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(ExternalProject)
set(CENTAURI_INSTALL "${PROJECT_SOURCE_DIR}/output/${CMAKE_BUILD_TYPE}" CACHE FILEPATH "Final Install Path")
set(CENTAURI_CMAKE_GLOBALS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DCROOT=${PROJECT_SOURCE_DIR})
file(MAKE_DIRECTORY "${CENTAURI_INSTALL}")
file(MAKE_DIRECTORY "${CENTAURI_INSTALL}/lib")
file(MAKE_DIRECTORY "${CENTAURI_INSTALL}/include")
file(MAKE_DIRECTORY "${CENTAURI_INSTALL}/bin")
file(MAKE_DIRECTORY "${CENTAURI_INSTALL}/bin/assets")
file(COPY "${PROJECT_SOURCE_DIR}/assets/" DESTINATION "${CENTAURI_INSTALL}/bin/assets/" FILES_MATCHING PATTERN "*.*")
add_definitions(
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_NONSTDC_NO_DEPRECATE
)
FILE( TO_NATIVE_PATH ${PROJECT_SOURCE_DIR}/git/chakra/src/CHAKRA/Build/Chakra.Core.sln CHAKRA_PROJECT)
MESSAGE( STATUS "CHAKRA_PROJECT: " "${CHAKRA_PROJECT}" )
#######################################
# CHAKRA BUILD #
#######################################
SET(CH_LIBS
${PROJECT_SOURCE_DIR}/git/chakra/src/CHAKRA/lib/Jsrt/ChakraCore.h
${PROJECT_SOURCE_DIR}/git/chakra/src/CHAKRA/lib/Jsrt/ChakraCommon.h
${PROJECT_SOURCE_DIR}/git/chakra/src/CHAKRA/lib/Jsrt/ChakraCommonWindows.h
${PROJECT_SOURCE_DIR}/git/chakra/src/CHAKRA/lib/Jsrt/ChakraDebug.h
)
ExternalProject_Add (CHAKRA
GIT_REPOSITORY https://github.com/Microsoft/ChakraCore.git
#GIT_TAG cmake_embed_v3
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/chakra/
CONFIGURE_COMMAND ""
BUILD_COMMAND msbuild /m /p:Platform=x64 /p:Configuration=${CMAKE_BUILD_TYPE} /p:RuntimeLib=static_library ${CHAKRA_PROJECT}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/git/chakra/src/CHAKRA/Build/VcBuild/bin/x64_${CMAKE_BUILD_TYPE}/ChakraCore.dll ${CENTAURI_INSTALL}/bin
)
ExternalProject_Add_Step(CHAKRA
COPYINC
DEPENDEES build
COMMENT "Coppying Includes"
COMMAND ${CMAKE_COMMAND} -E copy ${CH_LIBS} ${CENTAURI_INSTALL}/include
)
ExternalProject_Add_Step(CHAKRA
COPYLIB
DEPENDEES build
COMMENT "Coppying Lib"
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/git/chakra/src/CHAKRA/Build/VcBuild/bin/x64_debug/ChakraCore.lib ${CENTAURI_INSTALL}/lib
)
#######################################
# GLFW BUILD #
#######################################
ExternalProject_Add (GLFW
GIT_REPOSITORY https://github.com/glfw/glfw.git
#GIT_TAG
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/GLFW
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS}
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# SDL2 BUILD #
#######################################
ExternalProject_Add (SDL2
URL https://www.libsdl.org/release/SDL2-2.0.5.zip
URL_MD5 6f34a4cbdbb559b6c17ff6acfc111c87
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/SDL2
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS}
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# OPENAL BUILD #
#######################################
ExternalProject_Add (OPENAL
GIT_REPOSITORY https://github.com/kcat/openal-soft.git
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/OPENAL
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DALSOFT_EXAMPLES=OFF -DALSOFT_TESTS=OFF
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# LIBROCKET BUILD #
#######################################
SET(ENV{FREETYPE_DIR} ${CENTAURI_INSTALL})
SET(FREETYPE_DIR ${CENTAURI_INSTALL})
FIND_PACKAGE(FREETYPE 2.7.1 REQUIRED)
MESSAGE( STATUS "FREETYPE_DIR: " ${FREETYPE_DIR} )
MESSAGE( STATUS "FREETYPE_FOUND: " ${FREETYPE_FOUND} )
MESSAGE( STATUS "FREETYPE_LIBRARIES: " "${FREETYPE_LIBRARIES}" )
ExternalProject_Add (LIBROCKET
GIT_REPOSITORY https://github.com/libRocket/libRocket.git
#GIT_TAG
UPDATE_DISCONNECTED 1
CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CENTAURI_CMAKE_GLOBALS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> <SOURCE_DIR>/Build
PREFIX ${PROJECT_SOURCE_DIR}/git/LIBROCKET
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DFREETYPE_LIBRARY=${FREETYPE_LIBRARY} -DFREETYPE_DIR=${CENTAURI_INSTALL} -DFREETYPE_INCLUDE_DIR_freetype2=${FREETYPE_INCLUDE_DIR_freetype2} -DFREETYPE_INCLUDE_DIR_ft2build=${FREETYPE_INCLUDE_DIR_ft2build}
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# FREETYPE BUILD #
#######################################
ExternalProject_Add (FREETYPE
GIT_REPOSITORY http://git.sv.nongnu.org/r/freetype/freetype2.git
GIT_TAG VER-2-6-5
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/FREETYPE
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS}
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# CORRADE BUILD #
#######################################
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON)
ExternalProject_Add (CORRADE
GIT_REPOSITORY https://github.com/mosra/corrade.git
#GIT_TAG snapshot-2015-05-compatibility
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/CORRADE
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DBUILD_STATIC=OFF -DBUILD_TESTS=OFF -DMSVC2015_COMPATIBILITY=ON -DWITH_UTILITY=ON
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# MAGNUM BUILD #
#######################################
ExternalProject_Add (MAGNUM
GIT_REPOSITORY https://github.com/mosra/magnum.git
#GIT_TAG snapshot-2015-05-compatibility
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/MAGNUM
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DBUILD_STATIC=OFF -DBUILD_TESTS=OFF -DCORRADE_INCLUDE_DIR=${CENTAURI_INSTALL}/include -DWITH_DEBUGTOOLS=ON -DWITH_GLFWAPPLICATION=ON -DWITH_GLUTAPPLICATION=OFF -DWITH_SDL2APPLICATION=OFF -DMAGNUM_BUILD_MULTITHREADED=ON -DWITH_TEXT=ON -DWITH_AUDIO=ON -DWITH_WAVAUDIOIMPORTER=ON -DWITH_MAGNUMFONT=ON -DWITH_AL_INFO=ON -DWITH_MAGNUMFONTCONVERTER=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMPORTER=ON -DWITH_TGAIMAGECONVERTER=ON -DWITH_MAGNUMINFO=ON -DWITH_SHAPES=ON -DWITH_FONTCONVERTER=ON -DWITH_IMAGECONVERTER=ON
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# MAGNUMPLUGINS #
#######################################
ExternalProject_Add (MAGNUMPLUGINS
GIT_REPOSITORY https://github.com/mosra/magnum-plugins.git
#GIT_TAG
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/MAGNUMPLUGINS
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DBUILD_STATIC=OFF -DWITH_FREETYPEFONT=ON -DWITH_ANYIMAGEIMPORTER=ON -DWITH_PNGIMPORTER=ON -DWITH_JPEGIMPORTER=ON
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# MAGNUMEXTRAS #
#######################################
ExternalProject_Add (MAGNUMEXTRAS
GIT_REPOSITORY https://github.com/mosra/magnum-integration.git
#GIT_TAG
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/MAGNUMEXTRAS
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DBUILD_STATIC=OFF
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# MAGNUMEXAMPLES #
#######################################
ExternalProject_Add (MAGNUMEXAMPLES
GIT_REPOSITORY https://github.com/mosra/magnum-examples.git
#GIT_TAG
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/MAGNUMEXAMPLES
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DBUILD_STATIC=OFF -DWITH_TEXT_EXAMPLE=ON
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# ZLIB BUILD #
#######################################
ExternalProject_Add (ZLIB
GIT_REPOSITORY https://github.com/madler/zlib.git
GIT_TAG v1.2.10
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/ZLIB
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS}
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# LIBPNG BUILD #
#######################################
ExternalProject_Add (LIBPNG
GIT_REPOSITORY https://github.com/glennrp/libpng.git
#GIT_TAG v1.2.10
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/LIBPNG
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DPNG_SHARED=YES
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# LIBJPEG BUILD #
#######################################
ExternalProject_Add (LIBJPEG
GIT_REPOSITORY https://github.com/stohrendorf/libjpeg-cmake.git
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/LIBJPEG
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DPNG_SHARED=YES
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# TINETWORK BUILD #
#######################################
ExternalProject_Add (TINETWORK
GIT_REPOSITORY https://[email protected]/dthompso99/tinetwork.git
#GIT_TAG
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/TINETWORK
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DBUILD_TEST=ON -BUILD_SHARED_LIBS=OFF
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# BULLET BUILD #
#######################################
ExternalProject_Add (BULLET
GIT_REPOSITORY https://github.com/bulletphysics/bullet3.git
GIT_TAG 2.85.1
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/BULLET
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DUSE_MSVC_INCREMENTAL_LINKING=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_BULLET3=OFF -DBUILD_BULLET2_DEMOS=OFF -DBUILD_CPU_DEMOS=OFF -DBUILD_EXTRAS=OFF -DBUILD_OPENGL3_DEMOS=OFF -DBUILD_UNIT_TESTS=OFF
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# Cryptopp BUILD #
#######################################
ExternalProject_Add (CRYPTOPP
GIT_REPOSITORY https://github.com/weidai11/cryptopp.git
UPDATE_DISCONNECTED 1
PREFIX ${PROJECT_SOURCE_DIR}/git/cryptopp
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DBUILD_SHARED=NO -DBUILD_STATIC=YES -DBUILD_TESTING=NO -DCMAKE_INSTALL_LIBDIR=${CENTAURI_INSTALL}/lib
INSTALL_DIR ${CENTAURI_INSTALL}
)
#######################################
# CENT BUILD #
#######################################
ExternalProject_Add (CENTAURI
URL ${PROJECT_SOURCE_DIR}/src
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/CENTAURI
CMAKE_ARGS ${CENTAURI_CMAKE_GLOBALS} -DCINCLUDES=${CENTAURI_INSTALL}/include -DCLIBS=${CENTAURI_INSTALL}/lib
INSTALL_DIR ${CENTAURI_INSTALL}
BUILD_ALWAYS 1
)
ExternalProject_Add_Step(CENTAURI forceconfigure
COMMAND ${CMAKE_COMMAND} -E echo "Force configure of CENTAURI"
DEPENDEES configure
DEPENDERS build
ALWAYS 1
)
add_dependencies(LIBPNG ZLIB)
add_dependencies(FREETYPE LIBPNG ZLIB)
add_dependencies(MAGNUM CORRADE GLFW OPENAL)
add_dependencies(MAGNUMEXTRAS BULLET MAGNUM)
add_dependencies(MAGNUMPLUGINS MAGNUM ZLIB LIBPNG FREETYPE LIBJPEG)
add_dependencies(CENTAURI CHAKRA MAGNUM TINETWORK MAGNUMPLUGINS MAGNUMEXTRAS CRYPTOPP)
add_custom_target(custom-install DEPENDS CENTAURI )
add_dependencies(MAGNUMEXAMPLES MAGNUM SDL2 MAGNUMPLUGINS MAGNUMEXTRAS )
add_custom_target(examples DEPENDS MAGNUMEXAMPLES )