-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
458 lines (359 loc) · 16.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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
#The MIT License (MIT)
#
#Copyright (c) 2016 Liav Turkia
#
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
project(MACE CXX)
if(COMMAND cmake_policy)
cmake_policy(VERSION 2.8.12)
if(POLICY CMP0017)
cmake_policy(SET CMP0017 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0017 NEW)
endif()
if(POLICY CMP0025)
cmake_policy(SET CMP0025 OLD)
set(CMAKE_POLICY_DEFAULT_CMP0025 NEW)
endif()
endif()
message("MACE project added")
#On unix systems this line is requied to compile GLFW and GLEW
enable_language(C)
set(CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules" "${PROJECT_SOURCE_DIR}/cmake-modules")
include(FindPackageHandleStandardArgs)
include(CheckCXXCompilerFlag)
include(DownloadLibrary)
include(CheckIncludeFiles)
include(TestBigEndian)
include(CheckTypeSize)
include(ExternalProject)
include(ParseAndAddCatchTests)
include(cotire)
option(MACE_TESTS "Whether to build the unit tests under /tests." OFF)
option(MACE_DEMOS "Whether to build the demo programs under /demos" OFF)
option(MACE_ALL_WARNINGS "Whether to include all warnings in compilation" OFF)
option(MACE_SWIG "Whether to generage cross-language binaries with SWIG" OFF)
set(MACE_SWIG_LANGUAGE "" CACHE STRING "What language to generate binaries for using SWIG. MACE_SWIG must be enabled for this to work.")
option(MACE_DOWNLOAD_DEPENDENCIES "Whether to download and extract dependencies that are not found. If turned off, will instead error." ON)
mark_as_advanced(MACE_SWIG)
mark_as_advanced(MACE_SWIG_LANGUAGE)
mark_as_advanced(MACE_DOWNLOAD_DEPENDENCIES)
#for glfw
set(LIB_SUFFIX ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(MACE_MSVC_FLAGS /W4 /w44640 /w14242 /w14254 /w14265 /w14287 /w14287 /w14296 /w14311 /w14545 /w14546 /w14547 /w14546 /w14549 /w14555 /w14619 /w14640 /w14826)
set(MACE_COMPILER_FLAGS -Wall -Wnon-virtual-dtor -pedantic -Wmisleading-indentation)
#This defines where all of our includes are located
set(MACE_INCLUDES "${PROJECT_SOURCE_DIR}/include")
#get version number
file(READ "${PROJECT_SOURCE_DIR}/VERSION" MACE_VERSION)
string(REPLACE "." ";" MACE_VERSION_COMPONENTS ${MACE_VERSION})
list(GET MACE_VERSION_COMPONENTS 0 MACE_VERSION_MAJOR)
list(GET MACE_VERSION_COMPONENTS 1 MACE_VERSION_MINOR)
list(GET MACE_VERSION_COMPONENTS 2 MACE_VERSION_PATCH)
set(GLFW_SOURCE_VERSION "3.3")
set(GLFW_SOURCE_NAME "glfw-${GLFW_SOURCE_VERSION}")
set(GLFW_URL "https://github.com/glfw/glfw/archive/${GLFW_SOURCE_VERSION}.tar.gz")
set(OPENAL_SOURCE_VERSION "1.19.1")
set(OPENAL_SOURCE_NAME "openal-soft-openal-soft-${OPENAL_SOURCE_VERSION}")
set(OPENAL_URL "https://github.com/kcat/openal-soft/archive/openal-soft-${OPENAL_SOURCE_VERSION}.tar.gz")
set(GLEW_SOURCE_VERSION "2.1.0")
set(GLEW_SOURCE_NAME "glew-${GLEW_SOURCE_VERSION}")
set(GLEW_URL "https://sourceforge.net/projects/glew/files/glew/${GLEW_SOURCE_VERSION}/${GLEW_SOURCE_NAME}.tgz/download")
set(FREETYPE_SOURCE_VERSION "2.10.0")
set(FREETYPE_SOURCE_NAME "freetype-${FREETYPE_SOURCE_VERSION}")
set(FREETYPE_URL "https://download.savannah.gnu.org/releases/freetype/${FREETYPE_SOURCE_NAME}.tar.gz")
set(MACE_OUTPUT_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include")
set(CATCH_VERSION "2.7.1")
set(CATCH_SOURCE_NAME "Catch2-${CATCH_VERSION}")
set(CATCH_URL "https://github.com/catchorg/Catch2/archive/v${CATCH_VERSION}.tar.gz")
#stb_image is a single header only image loading library.
set(STB_IMAGE_URL "https://raw.githubusercontent.com/nothings/stb/master/stb_image.h")
set(STB_IMAGE_DOWNLOAD_PATH "${MACE_OUTPUT_INCLUDE_DIR}")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
find_package(OpenGL REQUIRED)
find_package(GLEW ${GLEW_SOURCE_VERSION})
find_package(GLFW ${GLFW_SOURCE_VERSION})
find_package(Freetype ${FREETYPE_SOURCE_VERSION})
find_package(OpenAL)
find_package(Catch2 ${CATCH_VERSION} QUIET)
#finding header-only libraries
find_path(STB_IMAGE_INCLUDE_DIR "stb_image.h" HINTS "${STB_IMAGE_DOWNLOAD_PATH}" PATH_SUFFIXES stb stb_image)
find_package_handle_standard_args(stb_image DEFAULT_MSG STB_IMAGE_INCLUDE_DIR)
mark_as_advanced(STB_IMAGE_INCLUDE_DIR)
if(MACE_SWIG)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
set_source_files_properties(MACE.swig PROPERTIES CPLUSPLUS ON)
set_source_files_properties(MACE.swig PROPERTIES SWIG_FLAGS "-includeall")
if(NOT MACE_SWIG_LANGUAGE)
message(SEND_ERROR "Must define a language for SWIG to compile to!")
endif()
elseif(MACE_SWIG_LANGUAGE)
message(WARNING "MACE_SWIG_LANGUAGE has no effect if MACE_SWIG isnt enabled")
endif()
if(NOT stb_image_FOUND OR NOT EXISTS "${STB_IMAGE_DOWNLOAD_PATH}/stb_image.h")
if(${MACE_DOWNLOAD_DEPENDENCIES})
#stb_image is one header file, so its easy to fix. Just download it!
message(STATUS "Downloading STB_IMAGE...")
file(DOWNLOAD "${STB_IMAGE_URL}" "${STB_IMAGE_DOWNLOAD_PATH}/stb_image.h")
message(STATUS "Done downloading STB_IMAGE.")
else()
message(FATAL_ERROR "STB_IMAGE is not found!")
endif()
set(STB_IMAGE_INCLUDE_DIR ${STB_IMAGE_DOWNLOAD_PATH})
else()
message(STATUS "Found STB_IMAGE at ${STB_IMAGE_INCLUDE_DIR}")
endif()
file(GLOB_RECURSE HEADERS "${MACE_INCLUDES}/MACE/*.h" "${MACE_INCLUDES}/MACE/Graphics/*.h" "${MACE_INCLUDES}/MACE/System/*.h" "${MACE_INCLUDES}/MACE/Utility/*.h")
file(GLOB_RECURSE SRC "src/*.cpp")
foreach(FILE ${HEADERS})
# Get the directory of the source file
get_filename_component(PARENT_DIR "${FILE}" DIRECTORY)
# Remove common directory prefix to make the group
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "" GROUP "${PARENT_DIR}")
# Make sure we are using windows slashes
string(REPLACE "/" "\\" GROUP "${GROUP}")
# Group into "Source Files" and "Header Files"
if ("${FILE}" MATCHES ".*\\.cpp")
set(GROUP "Source Files${GROUP}")
elseif("${FILE}" MATCHES ".*\\.h")
set(GROUP "Header Files${GROUP}")
endif()
source_group("${GROUP}" FILES "${FILE}")
endforeach()
foreach(FILE ${SRC})
# Get the directory of the source file
get_filename_component(PARENT_DIR "${FILE}" DIRECTORY)
# Remove common directory prefix to make the group
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "" GROUP "${PARENT_DIR}")
# Make sure we are using windows slashes
string(REPLACE "/" "\\" GROUP "${GROUP}")
# Group into "Source Files" and "Header Files"
if ("${FILE}" MATCHES ".*\\.cpp")
set(GROUP "Source Files${GROUP}")
elseif("${FILE}" MATCHES ".*\\.h")
set(GROUP "Header Files${GROUP}")
endif()
source_group("${GROUP}" FILES "${FILE}")
endforeach()
add_library(MACE ${HEADERS} ${SRC})
if(MACE_SWIG)
swig_add_module("MACE-${MACE_SWIG_LANGUAGE}" ${MACE_SWIG_LANGUAGE} MACE.swig ${HEADERS} ${SRC})
swig_link_libraries("MACE-${MACE_SWIG_LANGUAGE}" MACE)
if(TARGET "MACE-${MACE_SWIG_LANGUAGE}")
set_target_properties("MACE-${MACE_SWIG_LANGUAGE}" PROPERTIES FOLDER "MC")
endif()
endif()
if(${MACE_TESTS})
if(NOT Catch2_FOUND)
if(${MACE_DOWNLOAD_DEPENDENCIES})
download_library(${CATCH_SOURCE_NAME} ${CATCH_URL})
add_subdirectory(${CMAKE_BINARY_DIR}/${CATCH_SOURCE_NAME} ${CMAKE_BINARY_DIR}/${CATCH_SOURCE_NAME})
else()
message(FATAL_ERROR "Catch2 is not found!")
endif()
endif()
file(GLOB_RECURSE TESTS_SRC "tests/*.cpp")
add_executable(MACE-Testing ${TESTS_SRC})
target_link_libraries(MACE-Testing LINK_PUBLIC MACE)
target_include_directories(MACE-Testing PUBLIC ${MACE_INCLUDES})
#to test runtime dll linking we compiled a source file twice: once as part as MACE-Testing and one as a shared library to test runtime linking
add_library(MACE-DynamicLibraryTest SHARED "tests/Utility/DynamicLibraryTest.cpp")
add_executable(MACE-ProcessTest "tests/Utility/ProcessTest.cpp")
target_link_libraries(MACE-DynamicLibraryTest LINK_PUBLIC MACE)
target_link_libraries(MACE-ProcessTest LINK_PUBLIC MACE)
target_link_libraries(MACE-Testing LINK_PUBLIC MACE-DynamicLibraryTest)
target_include_directories(MACE-DynamicLibraryTest PUBLIC ${MACE_INCLUDES})
target_include_directories(MACE-ProcessTest PUBLIC ${MACE_INCLUDES})
add_dependencies(MACE-Testing MACE-ProcessTest)
target_compile_definitions(MACE-Testing PUBLIC MACE_DLL_TEST_OUTPUT="$<TARGET_FILE:MACE-DynamicLibraryTest>"
MACE_PROC_TEST_OUTPUT="$<TARGET_FILE:MACE-ProcessTest>")
target_compile_definitions(MACE-DynamicLibraryTest PRIVATE MACE_DLL_OUT_PASS="1")
target_compile_definitions(MACE-ProcessTest PRIVATE MACE_PROC_OUT_PASS="1")
set_target_properties(MACE-Testing PROPERTIES FOLDER "MC/Tests")
set_target_properties(MACE-DynamicLibraryTest PROPERTIES FOLDER "MC/Tests")
set_target_properties(MACE-ProcessTest PROPERTIES FOLDER "MC/Tests")
target_link_libraries(MACE-Testing LINK_PUBLIC Catch2::Catch2)
target_link_libraries(MACE-DynamicLibraryTest LINK_PUBLIC Catch2::Catch2)
target_link_libraries(MACE-ProcessTest LINK_PUBLIC Catch2::Catch2)
enable_testing()
ParseAndAddCatchTests(MACE-Testing)
endif()
if(${MACE_DEMOS})
file(GLOB_RECURSE DEMOS_SRC "demos/*.cpp")
foreach(FILE ${DEMOS_SRC})
get_filename_component(FILE_NAME ${FILE} NAME_WE)
set(PROJECT_NAME MACE-${FILE_NAME})
add_executable(${PROJECT_NAME} ${FILE})
target_link_libraries(${PROJECT_NAME} LINK_PUBLIC MACE)
target_compile_definitions(${PROJECT_NAME} PUBLIC MACE_DEMO_ASSETS="${PROJECT_SOURCE_DIR}/demos/assets/")
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "MC/Demos")
endforeach()
endif()
#COMPILER CHECKS
message("Configuring target compilation features")
target_compile_features(MACE PRIVATE cxx_std_11 cxx_constexpr cxx_final cxx_lambdas cxx_noexcept cxx_long_long_type cxx_nullptr cxx_override cxx_range_for cxx_raw_string_literals cxx_static_assert cxx_strong_enums cxx_unicode_literals cxx_variadic_macros)
if(MACE_ALL_WARNINGS)
if(MSVC)
foreach(MACE_MSVC_FLAG ${MACE_MSVC_FLAGS})
check_cxx_compiler_flag("${MACE_MSVC_FLAG}" "COMPILER_SUPPORTS_${MACE_MSVC_FLAG}")
if(COMPILER_SUPPORTS_${MACE_MSVC_FLAG})
target_compile_options(MACE PRIVATE "$<$<CONFIG:DEBUG>:${MACE_MSVC_FLAG}>")
endif()
endforeach()
else()
foreach(MACE_COMPILER_FLAG ${MACE_COMPILER_FLAGS})
check_cxx_compiler_flag("${MACE_COMPILER_FLAG}" "COMPILER_SUPPORTS_${MACE_COMPILER_FLAG}")
if(COMPILER_SUPPORTS_${MACE_COMPILER_FLAG})
target_compile_options(MACE PRIVATE "$<$<CONFIG:DEBUG>:${MACE_COMPILER_FLAG}>")
endif()
endforeach()
endif()
endif()
if(MSVC)
check_cxx_compiler_flag("/EHsc" COMPILER_SUPPORTS_EXCEPTION_HANDLING)
if(COMPILER_SUPPORTS_EXCEPTION_HANDLING)
target_compile_options(MACE PRIVATE "/EHsc")
else()
message(FATAL_ERROR "This version of Microsoft Visual Studio does not support exception handling.")
endif()
endif()
if(CMAKE_COMPILER_IS_GNUXX)
check_cxx_compiler_flag("-g" COMPILER_SUPPORTS_DEBUGGING)
if(COMPILER_SUPPORTS_DEBUGGING)
target_compile_options(MACE PRIVATE "$<$<CONFIG:DEBUG>:-g>")
endif()
endif()
target_compile_definitions(MACE PRIVATE "$<$<CONFIG:DEBUG>:MACE_DEBUG=true>")
if(NOT ${GLFW_FOUND})
if(NOT MACE_DOWNLOAD_DEPENDENCIES)
message(FATAL_ERROR "GLFW not found!")
else()
download_library(${GLFW_SOURCE_NAME} ${GLFW_URL})
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(${CMAKE_BINARY_DIR}/${GLFW_SOURCE_NAME} ${CMAKE_BINARY_DIR}/${GLFW_SOURCE_NAME})
if(MSVC)
#the /rtc flag breaks glfw. we have to remove it.
foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
string (REGEX REPLACE "/RTC(su|[1su])" "" ${flag_var} "${${flag_var}}")
endif()
endforeach(flag_var)
endif()
set(GLFW_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${GLFW_SOURCE_NAME}/include)
set(GLFW_LIBRARY glfw)
endif()
endif()
if(NOT ${GLEW_FOUND})
if(NOT MACE_DOWNLOAD_DEPENDENCIES)
message(FATAL_ERROR "GLEW not found!")
else()
download_library(${GLEW_SOURCE_NAME} ${GLEW_URL})
add_subdirectory(${CMAKE_BINARY_DIR}/${GLEW_SOURCE_NAME}/build/cmake ${CMAKE_BINARY_DIR}/${GLEW_SOURCE_NAME})
set(GLEW_LIBRARY glew_s)
if(BUILD_SHARED_LIBS)
add_definitions(-DGLEW_BUILD)
else()
add_definitions(-DGLEW_STATIC)
endif()
set(GLEW_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${GLEW_SOURCE_NAME}/include)
endif()
endif()
if(NOT ${FREETYPE_FOUND})
if(NOT MACE_DOWNLOAD_DEPENDENCIES)
message(FATAL_ERROR "Freetype not found!")
else()
download_library(${FREETYPE_SOURCE_NAME} ${FREETYPE_URL})
set(WITH_HarfBuzz OFF)
add_subdirectory(${CMAKE_BINARY_DIR}/${FREETYPE_SOURCE_NAME} ${CMAKE_BINARY_DIR}/${FREETYPE_SOURCE_NAME}/build)
set(FREETYPE_LIBRARY freetype)
set(FREETYPE_INCLUDE_DIR_ft2build ${CMAKE_BINARY_DIR}/${FREETYPE_SOURCE_NAME}/include)
set(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR_ft2build})
endif()
endif()
if(NOT ${OPENAL_FOUND})
if(NOT MACE_DOWNLOAD_DEPENDENCIES)
message(FATAL_ERROR "OpenAL not found!")
else()
download_library(${OPENAL_SOURCE_NAME} ${OPENAL_URL})
add_subdirectory(${CMAKE_BINARY_DIR}/${OPENAL_SOURCE_NAME} ${CMAKE_BINARY_DIR}/${OPENAL_SOURCE_NAME})
if(WIN32)
set(OPENAL_LIBRARY OpenAL)
else()
set(OPENAL_LIBRARY openal)
endif()
set(OPENAL_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${OPENAL_SOURCE_NAME}/include)
endif()
endif()
find_package(OpenMP)
if(OPENMP_FOUND)
if(MSVC)
# MACE needs SIMD support out of OpenMP on VC so it needs a special flag
target_compile_options(MACE PUBLIC "/openmp:experimental")
else()
target_compile_options(MACE PUBLIC "${OpenMP_CXX_FLAGS}")
endif()
endif()
if(MACE_TESTS OR MACE_DEMOS)
set_target_properties(MACE PROPERTIES FOLDER "MC")
endif()
target_include_directories(MACE PUBLIC ${GLFW_INCLUDE_DIR})
target_include_directories(MACE PUBLIC ${GLEW_INCLUDE_DIR})
target_include_directories(MACE PUBLIC ${FREETYPE_INCLUDE_DIR_ft2build})
target_include_directories(MACE PUBLIC ${FREETYPE_INCLUDE_DIR_freetype2})
target_include_directories(MACE PUBLIC ${OPENAL_INCLUDE_DIR})
target_include_directories(MACE PUBLIC ${MACE_INCLUDES})
target_include_directories(MACE PUBLIC ${STB_IMAGE_INCLUDE_DIR})
target_link_libraries(MACE LINK_PUBLIC ${FREETYPE_LIBRARY})
target_link_libraries(MACE LINK_PUBLIC ${GLFW_LIBRARY})
target_link_libraries(MACE LINK_PUBLIC ${OPENAL_LIBRARY})
target_link_libraries(MACE LINK_PUBLIC ${OPENGL_LIBRARY})
target_link_libraries(MACE LINK_PUBLIC ${GLEW_LIBRARY})
if(UNIX AND NOT APPLE)#glfw requires this
find_package(X11 REQUIRED)
target_link_libraries(MACE LINK_PUBLIC -ldl -lm ${X11_LIBRARIES} )
endif()
find_package(OpenCV)
if(${OpenCV_FOUND})
target_compile_definitions(MACE PUBLIC MACE_OPENCV=1)
target_link_libraries(MACE LINK_PUBLIC ${OpenCV_LIBRARIES})
target_include_directories(MACE PUBLIC ${OpenCV_INCLUDE_DIRS})
endif()
#Checks
check_include_files("unistd.h" MACE_POSIX)
check_include_files("windows.h" MACE_WINAPI)
test_big_endian(MACE_BIG_ENDIAN)
#Macros for configuration
if(APPLE)
set(MACE_OSX 1)
endif()
if(UNIX)
set(MACE_UNIX 1)
endif()
if(WIN32)
set(MACE_WINDOWS 1)
#GLFW_INCLUDE_NONE is so it doesnt also include GL.h, which will actually get included by GLEW
target_compile_definitions(MACE PUBLIC NOMINMAX=1 GLFW_INCLUDE_NONE=1)
endif()
if(BUILD_SHARED_LIBS)
set(MACE_SHARED_LIBS 1)
else()
set(MACE_STATIC_LIBS 1)
endif()
configure_file("${PROJECT_SOURCE_DIR}/Configure.h.in" "${MACE_OUTPUT_INCLUDE_DIR}/MACE/Configure.h" ESCAPE_QUOTES @ONLY)
#For the configure file
target_include_directories(MACE PUBLIC "${MACE_OUTPUT_INCLUDE_DIR}")
#COTIRE configuration
set_target_properties(MACE PROPERTIES COTIRE_UNITY_TARGET_NAME "MACE-Unity"
COTIRE_ADD_UNITY_BUILD FALSE
COTIRE_PREFIX_HEADER_INCLUDE_PATH "${GLEW_INCLUDE_DIR};${GLFW_INCLUDE_DIR};${MACE_INCLUDES}/MACE/Core/Constants.h;${MACE_OUTPUT_INCLUDE_DIR}/MACE"
COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH "${GLEW_INCLUDE_DIR};${GLFW_INCLUDE_DIR}"
COTIRE_PREFIX_HEADER_IGNORE_PATH "${CMAKE_SOURCE_DIR};${CMAKE_BINARY_DIR};${OPENGL_INCLUDE_DIR};")
cotire(MACE CONFIGURATIONS Release MinSizeRel)