-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
534 lines (494 loc) · 20.3 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
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
# Copyright (C) 2016-2023 Rodrigo Jose Hernandez Cordoba
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
cmake_minimum_required(VERSION 3.12.0)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0072 NEW)
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif(POLICY CMP0020)
if(POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
endif(POLICY CMP0053)
endif(COMMAND cmake_policy)
project(AeonEngine)
enable_testing()
enable_language(CXX)
enable_language(C)
if(NOT ENV{MSYSTEM_PREFIX} STREQUAL "")
list(APPEND CMAKE_PREFIX_PATH "$ENV{MSYSTEM_PREFIX}")
endif()
define_property(GLOBAL PROPERTY PLUGINS INHERITED
BRIEF_DOCS "Built Plugin List"
FULL_DOCS "Plugin Targets should add an entry to this list in order to be included into the configuration file.")
define_property(GLOBAL PROPERTY SHARED_LIBRARIES INHERITED
BRIEF_DOCS "List of shared library targets"
FULL_DOCS "List of shared library targets")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}")
include(compiler_settings)
set(PROXY "" CACHE STRING "Proxy server string for downloads.")
if(PROXY)
set(ENV{http_proxy} "${PROXY}")
set(ENV{https_proxy} "${PROXY}")
set(ENV{ftp_proxy} "${PROXY}")
endif()
set(Portaudio_FIND_QUIETLY ON)
find_program(XXD_EXECUTABLE xxd
HINTS ENV
MSYSTEM_PREFIX
ChocolateyInstall)
find_program(BASH_EXECUTABLE bash HINTS ENV MSYSTEM_PREFIX)
find_program(GLOBAL_EXECUTABLE
NAMES global global.exe
HINTS ENV MSYSTEM_PREFIX)
find_program(CLANG_EXECUTABLE
NAMES clang clang.exe
HINTS ENV MSYSTEM_PREFIX)
find_program(CLANG_TIDY_EXECUTABLE
NAMES clang-tidy clang-tidy.exe
HINTS ENV MSYSTEM_PREFIX)
find_package(PkgConfig)
find_package(Git)
find_package(ZLIB)
find_package(Threads)
find_package(Portaudio)
find_package(OggVorbis)
include(FindPythonModule)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckIncludeFiles)
find_package (Python3 COMPONENTS Interpreter)
find_package(ImageMagick OPTIONAL_COMPONENTS convert)
find_package(Protobuf CONFIG)
if(NOT Protobuf_FOUND)
find_package(Protobuf REQUIRED)
if(Protobuf_FOUND AND PKG_CONFIG_FOUND AND NOT Protobuf_LIBRARIES MATCHES "absl")
pkg_search_module(Protobuf REQUIRED protobuf)
endif()
else()
set(Protobuf_LIBRARIES protobuf::libprotobuf)
endif()
get_filename_component(PYTHON_PATH "${Python3_EXECUTABLE}" DIRECTORY)
find_program(AUTOPEP8_EXECUTABLE autopep8
HINTS ENV
MSYSTEM_PREFIX
"${PYTHON_PATH}/Scripts")
find_program(CMAKE_FORMAT_EXECUTABLE cmake-format
HINTS ENV MSYSTEM_PREFIX)
option(BUILD_OPENGL_RENDERER "Build the OpenGL renderer" ON)
option(BUILD_VULKAN_RENDERER "Build the Vulkan renderer" OFF)
option(USE_AEONGUI "Use the AeonGUI library for the user interface" OFF)
if(CLANG_TIDY_EXECUTABLE)
option(USE_CLANG_TIDY "Use of clang-tidy (Requires CMake 3.6.0 or Higher)"
OFF)
set(CLANG_TIDY_CHECKS
"-warnings-as-errors=performance-*,modernize-*,-modernize-pass-by-value"
"-checks=performance-*,modernize-*,-modernize-pass-by-value")
endif()
if(CMAKE_HOST_UNIX)
set(PATH_SEPARATOR :)
elseif(CMAKE_HOST_WIN32)
set(PATH_SEPARATOR $<SEMICOLON>)
endif()
find_program(SED_EXECUTABLE sed
PATHS ENV MSYSTEM_PREFIX ENV ProgramFiles
PATH_SUFFIXES
bin
usr/bin
Git/usr/bin
)
if(NOT SED_EXECUTABLE)
message(FATAL_ERROR "Unable to find sed executable.")
endif()
find_program(GREP_EXECUTABLE grep
PATHS ENV
MSYSTEM_PREFIX
ProgramFiles
PATH_SUFFIXES
usr/bin
Git/usr/bin
)
if(NOT GREP_EXECUTABLE)
message(FATAL_ERROR "Unable to find grep executable.")
endif()
find_program(DOXYGEN_EXECUTABLE doxygen
HINTS ENV
MSYSTEM_PREFIX
ProgramFiles
ChocolateyInstall
ProgramData
PATH_SUFFIXES /usr/bin chocolatey/bin)
if(DOXYGEN_EXECUTABLE)
find_program(DOT_EXECUTABLE dot
HINTS ENV
MSYSTEM_PREFIX
ProgramFiles
ChocolateyInstall
ProgramData
PATH_SUFFIXES /usr/bin chocolatey/bin)
if(DOT_EXECUTABLE)
set(HAS_DOT "YES")
else()
set(HAS_DOT "NO")
endif()
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_HASH)
else()
set(GIT_HASH "Unknown Build")
endif()
file(RELATIVE_PATH BIN_TO_SRC ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
configure_file("${CMAKE_SOURCE_DIR}/cmake/Doxyfile.in" "Doxyfile" @ONLY)
add_custom_target(generate-documentation
COMMAND ${CMAKE_COMMAND} -E remove_directory
${CMAKE_SOURCE_DIR}/docs/static/documentation
COMMAND ${DOXYGEN_EXECUTABLE}
COMMENT "Generating Documentation")
endif()
add_subdirectory(tools/aeontool)
add_subdirectory(proto)
add_subdirectory(engine)
option(BUILD_STANDALONE_APPLICATION "Build the standalone application" ON)
if(BUILD_STANDALONE_APPLICATION)
add_subdirectory(application)
endif()
find_package(Qt6
COMPONENTS LinguistTools
Core
Gui
Widgets)
if(Qt6_FOUND)
add_subdirectory(tools/worldeditor)
endif()
find_path(GTEST_SOURCE_PATH googletest PATHS /usr/src/googletest)
if(GTEST_SOURCE_PATH)
add_subdirectory(${GTEST_SOURCE_PATH} ${CMAKE_BINARY_DIR}/googletest)
set(GTEST_LIBRARY gtest)
set(GMOCK_LIBRARY gmock)
add_subdirectory(tests)
else()
find_package(GTest)
if(GTest_FOUND)
find_library(GMOCK_LIBRARY
NAMES gmock libgmock libgmock.a
PATHS "${GTEST_DIR}"
PATH_SUFFIXES lib)
find_library(GMOCK_LIBRARY_DEBUG
NAMES gmockd libgmockd libgmockd.a
PATHS "${GTEST_DIR}"
PATH_SUFFIXES lib)
add_subdirectory(tests)
endif()
endif()
#
# Code Formating on pre-commit hook
#
if(WIN32)
find_program(ASTYLE_EXECUTABLE astyle
HINTS ENV ProgramData
PATH_SUFFIXES /usr/bin chocolatey/bin)
find_program(FIND_EXECUTABLE find
HINTS ENV ProgramFiles
PATH_SUFFIXES /usr/bin Git/usr/bin)
else()
find_program(FIND_EXECUTABLE find)
find_program(ASTYLE_EXECUTABLE astyle)
endif()
set(ASTYLE_OPTIONS "--options=${CMAKE_SOURCE_DIR}/astylerc")
configure_file("${CMAKE_SOURCE_DIR}/cmake/pre-commit.in"
"${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit")
configure_file("${CMAKE_SOURCE_DIR}/cmake/commit-msg.in"
"${CMAKE_SOURCE_DIR}/.git/hooks/commit-msg")
#
# Protobuf Python source generation target
#
add_custom_target(
generate-python-protobuf-source
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/mesh.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/skeleton.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/animation.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/model.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/pipeline.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/material.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/property.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/sampler.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/vector2.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/vector3.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/vector4.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/quaternion.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/transform.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/scene.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/reference.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/framebuffer.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/matrix4x4.proto
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
--python_out ${CMAKE_SOURCE_DIR}/tools/blender/modules
--proto_path ${CMAKE_SOURCE_DIR}/proto
${CMAKE_SOURCE_DIR}/proto/collision.proto
SOURCES ${CMAKE_SOURCE_DIR}/proto/mesh.proto
${CMAKE_SOURCE_DIR}/proto/skeleton.proto
${CMAKE_SOURCE_DIR}/proto/animation.proto
${CMAKE_SOURCE_DIR}/proto/model.proto
${CMAKE_SOURCE_DIR}/proto/pipeline.proto
${CMAKE_SOURCE_DIR}/proto/material.proto
${CMAKE_SOURCE_DIR}/proto/property.proto
${CMAKE_SOURCE_DIR}/proto/sampler.proto
${CMAKE_SOURCE_DIR}/proto/vector2.proto
${CMAKE_SOURCE_DIR}/proto/vector3.proto
${CMAKE_SOURCE_DIR}/proto/vector4.proto
${CMAKE_SOURCE_DIR}/proto/quaternion.proto
${CMAKE_SOURCE_DIR}/proto/transform.proto
${CMAKE_SOURCE_DIR}/proto/scene.proto
${CMAKE_SOURCE_DIR}/proto/reference.proto
${CMAKE_SOURCE_DIR}/proto/framebuffer.proto
${CMAKE_SOURCE_DIR}/proto/matrix4x4.proto
${CMAKE_SOURCE_DIR}/proto/collision.proto
COMMENT "Generating Protocol Buffers Python Code")
#
# Binary asset generation target.
#
add_custom_target(
binary-assets
COMMAND
$<TARGET_FILE:aeontool> convert -i
${CMAKE_SOURCE_DIR}/game/meshes/suzanne.txt -o
${CMAKE_SOURCE_DIR}/game/meshes/suzanne.msh
COMMAND
$<TARGET_FILE:aeontool> convert -i
${CMAKE_SOURCE_DIR}/game/meshes/cube.txt -o
${CMAKE_SOURCE_DIR}/game/meshes/cube.msh
COMMAND
$<TARGET_FILE:aeontool> convert -i
${CMAKE_SOURCE_DIR}/game/shaders/simple_phong.txt -o
${CMAKE_SOURCE_DIR}/game/shaders/simple_phong.prg
COMMAND
$<TARGET_FILE:aeontool> convert -i
${CMAKE_SOURCE_DIR}/game/shaders/fixed_phong.txt -o
${CMAKE_SOURCE_DIR}/game/shaders/fixed_phong.prg
COMMAND
$<TARGET_FILE:aeontool> convert -i
${CMAKE_SOURCE_DIR}/game/shaders/plain_red.txt -o
${CMAKE_SOURCE_DIR}/game/shaders/plain_red.prg
COMMAND ${CMAKE_COMMAND} -DCMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} -P
${CMAKE_SOURCE_DIR}/cmake/GenerateDevelopmentTextures.cmake
DEPENDS aeontool ProtoBufClasses
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
SOURCES ${CMAKE_SOURCE_DIR}/game/meshes/suzanne.txt
${CMAKE_SOURCE_DIR}/game/meshes/cube.txt
${CMAKE_SOURCE_DIR}/game/shaders/simple_phong.txt
${CMAKE_SOURCE_DIR}/game/shaders/fixed_phong.txt
${CMAKE_SOURCE_DIR}/game/shaders/plain_red.txt
${CMAKE_SOURCE_DIR}/game/images/development.svg.in
COMMENT "Generating binary game assets")
#
# Blender Execution target
#
find_program(BLENDER_EXECUTABLE
NAMES blender blender.exe
HINTS ENV ProgramFiles
PATH_SUFFIXES "Blender Foundation/Blender")
if(BLENDER_EXECUTABLE)
get_filename_component(BLENDER_PATH "${BLENDER_EXECUTABLE}" DIRECTORY)
execute_process(COMMAND "${BLENDER_EXECUTABLE}" --version
OUTPUT_VARIABLE BLENDER_VERSION)
string(REGEX MATCH
"Blender [^ \\t]+"
BLENDER_VERSION
"${BLENDER_VERSION}")
string(REGEX
REPLACE "Blender ([^ ]+)"
"\\1"
BLENDER_VERSION
"${BLENDER_VERSION}")
find_program(BLENDER_Python3_EXECUTABLE
NAMES python python.exe
PATHS "${BLENDER_PATH}/${BLENDER_VERSION}/python/bin"
NO_DEFAULT_PATH)
# Right now this is just a shortcut to running Blender, it was supposed to set
# everything up so exporters were registered and ready to run without making
# changes to the Blender configuration, but that idea didn't work out in the
# end. The target is still useful and I may expand on it later on, so it stays
# for now.
add_custom_target(
run-blender
COMMAND "${BLENDER_EXECUTABLE}"
DEPENDS generate-python-protobuf-source
SOURCES ${CMAKE_SOURCE_DIR}/tools/blender/addons/io_mesh_msh/export.py
${CMAKE_SOURCE_DIR}/tools/blender/addons/io_skeleton_skl/export.py
${CMAKE_SOURCE_DIR}/tools/blender/addons/io_animation_anm/export.py
COMMENT "Running Blender")
endif()
#
# Clean Build Directory Target
#
if(FIND_EXECUTABLE)
add_custom_target(
clean-build
COMMAND ${FIND_EXECUTABLE} '${CMAKE_BINARY_DIR}' ! -name 'CMakeCache.txt' !
-wholename '${CMAKE_BINARY_DIR}' -exec rm -rf {} +
COMMENT "Cleaning Build you will need to rerun cmake configure and generate"
)
endif()
#
# Generate VS Code Environment
#
if(CMAKE_GENERATOR MATCHES "(MSYS|Unix|MinGW) Makefiles")
set(CODE_ZOOMLEVEL "0" CACHE STRING "window.zoomLevel for VS Code.")
# TODO SOURCE_DIRECTORIES could be set and used to call add_subdirectory
# directly from this top level
set(SOURCE_DIRECTORIES ${CMAKE_SOURCE_DIR} application
# application/windows
proto
engine
engine/images
engine/images/png
engine/renderers/opengl
engine/renderers/vulkan
engine/sound/oggvorbis
engine/sound/portaudio
tools/aeontool
tools/worldeditor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
execute_process(COMMAND ${BASH_EXECUTABLE} --login -c "echo | ${CMAKE_CXX_COMPILER} -Wp,-v -x c++ - -fsyntax-only 2>&1 | sed -n '/#include <...> search starts here:$/,/End of search list.$/p' | sed '/\\(#include <...> search starts here:$\\|End of search list.$\\)/d'"
OUTPUT_VARIABLE CXX_INCLUDE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "[ \\t]*\n[ \\t]*" ";" CXX_INCLUDE_PATH "${CXX_INCLUDE_PATH}")
string(STRIP "${CXX_INCLUDE_PATH}" CXX_INCLUDE_PATH)
endif()
set(INCLIST "")
if(Qt6_FOUND)
list(APPEND INCLIST ${Qt6Core_INCLUDE_DIRS})
list(APPEND INCLIST ${Qt6Gui_INCLUDE_DIRS})
list(APPEND INCLIST ${Qt6Widgets_INCLUDE_DIRS})
endif(Qt6_FOUND)
list(APPEND INCLIST ${GLSlang_INCLUDE_DIR})
list(APPEND INCLIST ${VULKAN_INCLUDE_DIR})
list(APPEND INCLIST ${Protobuf_INCLUDE_DIR})
list(APPEND INCLIST ${CMAKE_BINARY_DIR}/engine)
list(APPEND INCLIST ${CMAKE_BINARY_DIR}/engine/renderers/opengl)
list(APPEND INCLIST ${CXX_INCLUDE_PATH})
list(REMOVE_DUPLICATES INCLIST)
set(INCLIST "\"${INCLIST}\"")
string(REPLACE ";"
"\",\n\""
INCLIST
"${INCLIST}")
find_program(GDB_EXECUTABLE gdb
PATHS ENV MSYSTEM_PREFIX ENV ProgramFiles
PATH_SUFFIXES
bin
usr/bin
)
set(DEBUG_PATH "${CMAKE_BINARY_DIR}/bin")
if(CMAKE_GENERATOR MATCHES "(MSYS|MinGW) Makefiles")
set(DEBUG_PATH "${DEBUG_PATH};$ENV{MSYSTEM_PREFIX}/bin")
set(USE_EXTERNAL_CONSOLE "true")
else()
set(DEBUG_PATH "$ENV{PATH}:${DEBUG_PATH}")
set(USE_EXTERNAL_CONSOLE "false")
set(QT_QPA_PLATFORM "{\"name\":\"QT_QPA_PLATFORM\",\"value\":\"xcb\"},")
#set(QT_QPA_PLATFORM "{\"name\":\"QT_QPA_PLATFORM\",\"value\":\"wayland\"},")
endif()
if(Protobuf_ROOT)
set(LD_LIBRARY_PATH "{\"name\":\"LD_LIBRARY_PATH\",\"value\":\"${Protobuf_ROOT}/lib\"},")
endif()
configure_file("${CMAKE_SOURCE_DIR}/cmake/tasks.json.in"
"${CMAKE_SOURCE_DIR}/.vscode/tasks.json")
configure_file("${CMAKE_SOURCE_DIR}/cmake/settings.json.in"
"${CMAKE_SOURCE_DIR}/.vscode/settings.json")
configure_file("${CMAKE_SOURCE_DIR}/cmake/launch.json.in"
"${CMAKE_SOURCE_DIR}/.vscode/launch.json" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/cmake/c_cpp_properties.json.in"
"${CMAKE_SOURCE_DIR}/.vscode/c_cpp_properties.json" @ONLY)
endif()
set(COVER_BACKGROUND "${CMAKE_BINARY_DIR}/wallpaper.png"
CACHE FILEPATH "Background for the create-cover target")
set(COVER_POINTSIZE "250"
CACHE STRING "Font pointsize for the create-cover target")
add_custom_target(create-cover
COMMAND "${ImageMagick_convert_EXECUTABLE}" -size 1920x1080
xc:none -background transparent -font Ego.ttf -gravity
center -pointsize ${COVER_POINTSIZE} -fill none
-stroke SteelBlue4 -strokewidth 10 -draw \"text 0,0
\'`date \+\"%B %d %Y\"`\'\" -blur 0x10 -pointsize
${COVER_POINTSIZE} -fill white -stroke none
-strokewidth 0 -draw \"text 0,0 \'`date \+\"%B %d
%Y\"`\'\" PNG32:overlay.png
COMMAND "${ImageMagick_convert_EXECUTABLE}"
"${COVER_BACKGROUND}" -draw
'image over 0,0 1920,1080 overlay.png' cover.png
DEPENDS "${COVER_BACKGROUND}"
COMMENT "Creating Cover")
get_property(PLUGIN_LIST GLOBAL PROPERTY PLUGINS)
foreach(PLUGIN ${PLUGIN_LIST})
string(APPEND PLUGINS "Plugin: \"${PLUGIN}\"\n")
endforeach()
string(REGEX REPLACE "\n$" "" PLUGINS "${PLUGINS}")
configure_file("${CMAKE_SOURCE_DIR}/cmake/config.in" "${CMAKE_SOURCE_DIR}/game/config" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/cmake/renderdoc.cap.in" "${CMAKE_BINARY_DIR}/worldeditor.cap" @ONLY)