-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
667 lines (590 loc) · 30.8 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
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
cmake_minimum_required(VERSION 3.22)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
cmake_policy(SET CMP0077 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0092 NEW)
cmake_policy(SET CMP0092 NEW)
project(Firework.Runtime)
# Configuration options...
option(FIREWORK_WINDOWS_COMPATIBILITY "Enable compatibility with Windows versions up to Windows XP. This option only has effect when compiling with MinGW." ON)
option(FIREWORK_BUILD_EXAMPLES "Build various examples." ON)
option(FIREWORK_LOCAL_DBGINFO_PATHS "Use local paths embedded in program for debug information." OFF)
option(FIREWORK_SANITIZE "Enable supported sanitizers." OFF)
option(FIREWORK_LTO "Enable link-time optimization on release builds." OFF)
include(GenerateExportHeader)
set(FIREWORK_COMPILE_DEFINITIONS "")
set(FIREWORK_COMPILE_FLAGS "")
set(FIREWORK_LINKER_FLAGS "")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(FIREWORK_TARGET_ARCH x64)
else()
set(FIREWORK_TARGET_ARCH x86)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(FIREWORK_COMPILE_DEFINITIONS ${FIREWORK_COMPILE_DEFINITIONS} _DEBUG=1)
endif()
if (EMSCRIPTEN)
add_compile_options(-pthread -fexceptions -O3)
add_link_options(-pthread -fexceptions -sASYNCIFY -sPTHREAD_POOL_SIZE=8 -sPTHREAD_POOL_SIZE_STRICT=8 -sALLOW_MEMORY_GROWTH -sMIN_WEBGL_VERSION=2) # -sMIN_WEBGL_VERSION=2 is required for bgfx.
set(FIREWORK_BUILD_PLATFORM Web)
set(CMAKE_EXECUTABLE_SUFFIX ".html")
elseif (WIN32 OR WIN64)
set(FIREWORK_BUILD_PLATFORM "Win32")
elseif (UNIX AND NOT APPLE)
set(FIREWORK_BUILD_PLATFORM "Linux")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
elseif (APPLE)
set(FIREWORK_BUILD_PLATFORM "MacOS")
else()
set(FIREWORK_BUILD_PLATFORM "UnknownPlatform")
endif()
if (NOT "${CMAKE_CXX_SIMULATE_ID} " STREQUAL " ")
set(FIREWORK_COMPILER_ID "${CMAKE_CXX_SIMULATE_ID}")
else()
set(FIREWORK_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
endif()
if (EMSCRIPTEN)
set(FIREWORK_COMPILER "Clang")
set(FIREWORK_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
set(FIREWORK_TARGET_NAME "${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-${FIREWORK_BUILD_TYPE}-${FIREWORK_BUILD_PLATFORM}")
elseif (FIREWORK_COMPILER_ID STREQUAL "GNU")
if (CMAKE_SHARED_LIBRARY_SUFFIX STREQUAL ".dll")
set(FIREWORK_COMPILER "MinGW")
else()
set(FIREWORK_COMPILER "gcc")
endif()
set(FIREWORK_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
set(FIREWORK_TARGET_NAME "${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-${FIREWORK_BUILD_TYPE}-${FIREWORK_BUILD_PLATFORM}")
# Your copy of gcc better include a. Exceptions, and b. dynamic linking to libstdc++ and libgcc, or you're (silently) screwed.
set(FIREWORK_COMPILE_DEFINITIONS ${FIREWORK_COMPILE_DEFINITIONS})
set(FIREWORK_COMPILE_FLAGS ${FIREWORK_COMPILE_FLAGS} -fnon-call-exceptions -fasynchronous-unwind-tables)
if (FIREWORK_BUILD_PLATFORM STREQUAL "Win32")
set(FIREWORK_COMPILE_FLAGS ${FIREWORK_COMPILE_FLAGS} -fno-omit-frame-pointer) # Do NOT delete this, you will ruin my week if you do. Optimizing out the frame pointer prevents SEH exceptions from working properly.
endif()
if (FIREWORK_LOCAL_DBGINFO_PATHS)
set(FIREWORK_COMPILE_FLAGS ${FIREWORK_COMPILE_FLAGS} -ffile-prefix-map="${CMAKE_SOURCE_DIR}/"=/)
endif()
if (FIREWORK_BUILD_PLATFORM STREQUAL "Win32" AND FIREWORK_WINDOWS_COMPATIBILITY)
set(FIREWORK_COMPILE_DEFINITIONS ${FIREWORK_COMPILE_DEFINITIONS} _WIN32_WINNT=0x0501 WINVER=0x0501 __REQUIRED_RPCNDR_H_VERSION__=475)
endif()
if (FIREWORK_SANITIZE)
set(FIREWORK_COMPILE_FLAGS ${FIREWORK_COMPILE_FLAGS} -fsanitize=undefined)
set(FIREWORK_LINKER_FLAGS ${FIREWORK_LINKER_FLAGS} -fsanitize=undefined)
if (FIREWORK_BUILD_PLATFORM STREQUAL "Win32")
set(FIREWORK_COMPILE_FLAGS ${FIREWORK_COMPILE_FLAGS} -fsanitize-undefined-trap-on-error)
set(FIREWORK_LINKER_FLAGS ${FIREWORK_LINKER_FLAGS} -fsanitize-undefined-trap-on-error)
message(STATUS "[FireworkConfigure] [INFO] MinGW sanitizers: -fsanitize=undefined -fsanitize-undefined-trap-on-error")
else()
set(FIREWORK_COMPILE_FLAGS ${FIREWORK_COMPILE_FLAGS} -fsanitize=leak)
set(FIREWORK_LINKER_FLAGS ${FIREWORK_LINKER_FLAGS} -fsanitize=leak)
message(STATUS "[FireworkConfigure] [INFO] gcc sanitizers: -fsanitize=undefined -fsanitize=leak")
endif()
endif()
elseif (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU" AND (FIREWORK_COMPILER_ID STREQUAL "Clang" OR FIREWORK_COMPILER_ID STREQUAL "AppleClang"))
set(FIREWORK_COMPILER "Clang")
set(FIREWORK_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
set(FIREWORK_TARGET_NAME "${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-${FIREWORK_BUILD_TYPE}-${FIREWORK_BUILD_PLATFORM}")
set(FIREWORK_COMPILE_FLAGS ${FIREWORK_COMPILE_FLAGS} -fms-extensions -fsafe-buffer-usage-suggestions) # TODO: -fasync-exceptions once everyone updates their version of Clang.
set(FIREWORK_LINKER_FLAGS ${FIREWORK_LINKER_FLAGS} -pthread)
if (FIREWORK_SANITIZE)
set(FIREWORK_LINKER_FLAGS ${FIREWORK_LINKER_FLAGS} -fsanitize=undefined)
if (FIREWORK_BUILD_PLATFORM STREQUAL "Win32")
set(FIREWORK_LINKER_FLAGS ${FIREWORK_LINKER_FLAGS} -fsanitize=address)
message(STATUS "[FireworkConfigure] [INFO] clang sanitizers: -fsanitize=undefined -fsanitize=address")
else()
set(FIREWORK_LINKER_FLAGS ${FIREWORK_LINKER_FLAGS} -fsanitize=leak)
message(STATUS "[FireworkConfigure] [INFO] clang sanitizers: -fsanitize=undefined -fsanitize=leak")
endif()
endif()
elseif (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC" OR FIREWORK_COMPILER_ID STREQUAL "MSVC")
set(FIREWORK_COMPILER "MSVC")
set(FIREWORK_BUILD_TYPE "Any")
set(FIREWORK_TARGET_NAME "${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-${FIREWORK_BUILD_PLATFORM}")
string(REPLACE " /EHs" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE " /EHs" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(FIREWORK_COMPILE_FLAGS ${FIREWORK_COMPILE_FLAGS} /Zc:__cplusplus /utf-8 /EHa)
if (FIREWORK_SANITIZE)
set(FIREWORK_COMPILE_FLAGS ${FIREWORK_COMPILE_FLAGS} /fsanitize=address)
message(STATUS "[FireworkConfigure] [INFO] MSVC sanitizers: /fsanitize=address")
endif()
else()
set(FIREWORK_COMPILER ${FIREWORK_COMPILER_ID})
if ("${FIREWORK_COMPILER} " STREQUAL " ")
set(FIREWORK_COMPILER "Unknown")
endif()
set(FIREWORK_BUILD_TYPE "UnknownBuildType")
set(FIREWORK_TARGET_NAME "${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-${FIREWORK_BUILD_PLATFORM}")
endif()
message(STATUS "FIREWORK_COMPILE_DEFINITIONS: ${FIREWORK_COMPILE_DEFINITIONS}")
message(STATUS "FIREWORK_COMPILE_FLAGS: ${FIREWORK_COMPILE_FLAGS}")
message(STATUS "FIREWORK_LINKER_FLAGS: ${FIREWORK_LINKER_FLAGS}")
add_compile_definitions(${FIREWORK_COMPILE_DEFINITIONS})
add_compile_options(${FIREWORK_COMPILE_FLAGS})
add_link_options(${FIREWORK_LINKER_FLAGS})
macro(firework_push_nowarn)
if (FIREWORK_COMPILER STREQUAL "MinGW" OR FIREWORK_COMPILER STREQUAL "gcc" OR FIREWORK_COMPILER STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
elseif (FIREWORK_COMPILER STREQUAL "MSVC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
endif()
endmacro()
macro(firework_pop_nowarn)
if (FIREWORK_COMPILER STREQUAL "MinGW" OR FIREWORK_COMPILER STREQUAL "gcc" OR FIREWORK_COMPILER STREQUAL "Clang")
string(REPLACE " -w" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE " -w" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
elseif (FIREWORK_COMPILER STREQUAL "MSVC")
string(REPLACE " /w" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE " /w" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
endmacro()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ${FIREWORK_LTO})
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ${FIREWORK_LTO})
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ${FIREWORK_LTO})
firework_push_nowarn()
# concurrentqueue
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/dependencies/concurrentqueue")
# robin-hood-hashing
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/dependencies/robin-hood-hashing")
# uni-algo
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/external/uni-algo")
# cpptrace
firework_pop_nowarn()
if (FIREWORK_BUILD_PLATFORM STREQUAL "Win32" OR FIREWORK_BUILD_PLATFORM STREQUAL "MacOS" OR FIREWORK_BUILD_PLATFORM STREQUAL "Linux")
set(CPPTRACE_STATIC ON CACHE INTERNAL "" FORCE)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/external/cpptrace")
if (FIREWORK_COMPILER STREQUAL "MSVC")
target_compile_definitions(cpptrace-lib PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()
set_target_properties(cpptrace-lib PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
firework_push_nowarn()
# SDL3
set(SDL_STATIC_PIC ON CACHE INTERNAL "" FORCE)
set(SDL_STATIC ON CACHE INTERNAL "" FORCE)
set(SDL_SHARED OFF CACHE INTERNAL "" FORCE)
set(SDL_TEST_LIBRARY OFF CACHE INTERNAL "" FORCE)
set(SDL_RENDER_D3D OFF CACHE INTERNAL "" FORCE)
set(SDL_RENDER_METAL OFF CACHE INTERNAL "" FORCE)
set(HAVE_SHELLSCALINGAPI_H OFF CACHE INTERNAL "" FORCE)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/external/SDL")
# target_compile_definitions(SDL3-static PRIVATE HAVE_LIBC=1) i don't know if we still need this
# assimp
firework_pop_nowarn()
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)
set(ASSIMP_BUILD_TESTS OFF CACHE INTERNAL "" FORCE)
set(ASSIMP_BUILD_ZLIB ON CACHE INTERNAL "" FORCE)
set(ASSIMP_WARNINGS_AS_ERRORS OFF CACHE INTERNAL "" FORCE)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/external/assimp")
get_target_property(ASSIMP_LINK_LIBRARIES assimp LINK_LIBRARIES)
# external/assimp/code/CMakeLists.txt - 1348: TARGET_LINK_LIBRARIES ( assimp -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lwinpthread ) -> Breaks our binary.
# This doesn't actually work. Thanks assimp for ruining my day. TODO: File bug report later.
list(REMOVE_ITEM ASSIMP_LINK_LIBRARIES "-static-libgcc" "-static-libstdc++" "-Wl,-Bstatic" "-lstdc++" "-lwinpthread")
set_target_properties(assimp PROPERTIES LINK_LIBRARIES "${ASSIMP_LINK_LIBRARIES}")
unset(BUILD_SHARED_LIBS)
firework_push_nowarn()
# bgfx
set(BGFX_LIBRARY_TYPE "STATIC" CACHE INTERNAL "" FORCE)
set(BGFX_BUILD_EXAMPLES ON CACHE INTERNAL "" FORCE)
set(BGFX_CONFIG_MULTITHREADED OFF CACHE INTERNAL "" FORCE)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake")
# Firework.Runtime
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_DEBUG_POSTFIX "" CACHE INTERNAL "")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
firework_pop_nowarn()
if (FIREWORK_COMPILER STREQUAL "MinGW" OR FIREWORK_COMPILER STREQUAL "gcc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
elseif (FIREWORK_COMPILER STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmost -Wno-c++98-compat -Wno-c++0x-compat -Wno-c++11-compat -Wno-c++14-compat -Wno-c++17-compat -Wno-c++20-compat")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmost -Wno-c++98-compat -Wno-c++0x-compat -Wno-c++11-compat -Wno-c++14-compat -Wno-c++17-compat -Wno-c++20-compat")
elseif (FIREWORK_COMPILER STREQUAL "MSVC")
set(FIREWORK_COMPILE_FLAGS ${FIREWORK_COMPILE_FLAGS} /Zc:preprocessor /FI "${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.CoreLib/src/__msvc_bgfx_fix.h")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
message(STATUS "[FireworkConfigure] [INFO] Compilation target ${FIREWORK_TARGET_NAME}.")
# Firework.Tools
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Firework.Tools")
# Firework.Mathematics
add_library(Firework.Mathematics INTERFACE)
target_include_directories(Firework.Mathematics INTERFACE "${CMAKE_CURRENT_LIST_DIR}/Firework.Mathematics/include")
# Firework.Typography
file(GLOB_RECURSE FONTSRCS configure_depends
"${CMAKE_CURRENT_LIST_DIR}/Firework.Typography/*.h"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Typography/*.cpp"
)
add_library(Firework.Typography SHARED ${FONTSRCS})
target_link_libraries(Firework.Typography PRIVATE uni-algo)
generate_export_header(Firework.Typography
BASE_NAME FIREWORK_TYPOGRAPHY
EXPORT_MACRO_NAME __firework_typography_api
EXPORT_FILE_NAME Firework.Typography.Exports.h
)
target_include_directories(Firework.Typography
PUBLIC
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Typography/src"
"${CMAKE_CURRENT_LIST_DIR}/dependencies/earcut.hpp/include"
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/dependencies/stb"
)
target_compile_definitions(Firework.Typography PUBLIC ${FIREWORK_COMPILE_DEFINITIONS})
target_compile_options(Firework.Typography PUBLIC ${FIREWORK_COMPILE_FLAGS})
target_link_options(Firework.Typography PUBLIC ${FIREWORK_LINKER_FLAGS})
set_target_properties(Firework.Typography
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Typography"
LIBRARY_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Typography"
RUNTIME_OUTPUT_DIRECTORY "../bin/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Typography"
)
# Firework.Runtime.GL
add_custom_target(PrecompileBuiltinShaders
COMMAND ${CMAKE_COMMAND}
-DSHADERC_PATH="$<TARGET_FILE:shaderc>"
-DSHADERC_DIR="$<TARGET_FILE_DIR:shaderc>"
-DSHADER_FILES_DIR="${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/shaders"
-DBGFX_SHADER_DIR="${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bgfx/src"
-DCMAKE_BUILD_TYPE=$<CONFIG>
-P "${CMAKE_CURRENT_LIST_DIR}/cmake/PrecompileShaders.cmake"
)
add_dependencies(PrecompileBuiltinShaders shaderc)
file(GLOB_RECURSE GLSRCS configure_depends
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/*.h"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/*.cpp"
)
add_library(Firework.Runtime.GL SHARED ${GLSRCS})
add_dependencies(Firework.Runtime.GL PrecompileBuiltinShaders)
generate_export_header(Firework.Runtime.GL
BASE_NAME FIREWORK_GL
EXPORT_MACRO_NAME __firework_gl_api
EXPORT_FILE_NAME Firework.Runtime.GL.Exports.h
)
target_include_directories(Firework.Runtime.GL
PUBLIC
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/src"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/include"
"${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bx/include"
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bgfx/include"
"${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bimg/include"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/shaders/include"
"${CMAKE_CURRENT_LIST_DIR}/external/assimp/include"
"${CMAKE_CURRENT_BINARY_DIR}/external/assimp/include"
)
target_link_libraries(Firework.Runtime.GL
PUBLIC
Firework.Mathematics
assimp
PRIVATE
bimg
bx
bgfx
)
if (FIREWORK_BUILD_PLATFORM STREQUAL "Win32")
if (FIREWORK_COMPILER STREQUAL "MinGW" OR FIREWORK_COMPILER STREQUAL "Clang")
target_include_directories(Firework.Runtime.GL PUBLIC "${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bx/include/compat/mingw")
elseif (FIREWORK_COMPILER STREQUAL "MSVC")
target_include_directories(Firework.Runtime.GL PUBLIC "${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bx/include/compat/msvc")
endif()
elseif (FIREWORK_BUILD_PLATFORM STREQUAL "Linux")
target_include_directories(Firework.Runtime.GL PUBLIC "${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bx/include/compat/linux")
elseif (FIREWORK_BUILD_PLATFORM STREQUAL "MacOS")
target_include_directories(Firework.Runtime.GL PUBLIC "${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bx/include/compat/osx")
endif()
if (FIREWORK_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(Firework.Runtime.GL PUBLIC BX_CONFIG_DEBUG=1)
else()
target_compile_definitions(Firework.Runtime.GL PUBLIC BX_CONFIG_DEBUG=0)
endif()
target_compile_definitions(Firework.Runtime.GL PUBLIC ${FIREWORK_COMPILE_DEFINITIONS})
target_compile_options(Firework.Runtime.GL PUBLIC ${FIREWORK_COMPILE_FLAGS})
target_link_options(Firework.Runtime.GL PUBLIC ${FIREWORK_LINKER_FLAGS})
set_target_properties(Firework.Runtime.GL
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Runtime.GL"
LIBRARY_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Runtime.GL"
RUNTIME_OUTPUT_DIRECTORY "../bin/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Runtime.GL"
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
)
# Firework.Runtime.RenderPipeline
add_custom_target(PrecompileRenderPipelineShaders
COMMAND ${CMAKE_COMMAND}
-DSHADERC_PATH="$<TARGET_FILE:shaderc>"
-DSHADERC_DIR="$<TARGET_FILE_DIR:shaderc>"
-DSHADER_FILES_DIR="${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.RenderPipeline/shaders"
-DBGFX_SHADER_DIR="${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bgfx/src"
-DCMAKE_BUILD_TYPE=$<CONFIG>
-P "${CMAKE_CURRENT_LIST_DIR}/cmake/PrecompileShaders.cmake"
)
add_dependencies(PrecompileRenderPipelineShaders shaderc)
file(GLOB_RECURSE RPSRCS configure_depends
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.RenderPipeline/*.h"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.RenderPipeline/*.cpp"
)
add_library(Firework.Runtime.RenderPipeline SHARED ${RPSRCS})
add_dependencies(Firework.Runtime.GL PrecompileRenderPipelineShaders)
generate_export_header(Firework.Runtime.RenderPipeline
BASE_NAME FIREWORK_RP
EXPORT_MACRO_NAME __firework_rp_api
EXPORT_FILE_NAME Firework.Runtime.RenderPipeline.Exports.h
)
target_include_directories(Firework.Runtime.RenderPipeline
PUBLIC
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.RenderPipeline/src"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.RenderPipeline/shaders/include"
"${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bgfx/include"
)
target_link_libraries(Firework.Runtime.RenderPipeline
PUBLIC
Firework.Runtime.GL
)
target_compile_definitions(Firework.Runtime.RenderPipeline PUBLIC ${FIREWORK_COMPILE_DEFINITIONS})
target_compile_options(Firework.Runtime.RenderPipeline PUBLIC ${FIREWORK_COMPILE_FLAGS})
target_link_options(Firework.Runtime.RenderPipeline PUBLIC ${FIREWORK_LINKER_FLAGS})
set_target_properties(Firework.Runtime.RenderPipeline
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Runtime.RenderPipeline"
LIBRARY_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Runtime.RenderPipeline"
RUNTIME_OUTPUT_DIRECTORY "../bin/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Runtime.RenderPipeline"
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
)
# Firework.Runtime.CoreLib
file(GLOB_RECURSE ENGINESRCS configure_depends
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.CoreLib/*.h"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.CoreLib/*.inc"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.CoreLib/*.cpp"
)
add_library(Firework.Runtime.CoreLib SHARED ${ENGINESRCS})
# target_sources(Firework.Runtime.CoreLib PUBLIC FILE_SET CXX_MODULES FILES "${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.CoreLib/module/Firework.Core.cxx")
generate_export_header(Firework.Runtime.CoreLib
BASE_NAME FIREWORK_CORELIB
EXPORT_MACRO_NAME __firework_corelib_api
EXPORT_FILE_NAME Firework.Runtime.CoreLib.Exports.h
)
# file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/Firework.Runtime.CoreLib.Exports.h" "\n#ifndef FIREWORK_EXPORT_MODULE\n #define FIREWORK_EXPORT_MODULE 0\n#endif\n#ifndef __fw_module_export\n #define __fw_module_export\n#endif\n")
# target_compile_definitions(Firework.Runtime.CoreLib PUBLIC SDL_MAIN_HANDLED)
target_include_directories(Firework.Runtime.CoreLib
PUBLIC
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.CoreLib/src"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.CoreLib/include"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.CoreLib/module"
"${CMAKE_CURRENT_LIST_DIR}/dependencies/std_function"
"${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bgfx/include"
"${CMAKE_CURRENT_LIST_DIR}/external/SDL/include"
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bx/include"
)
if (FIREWORK_COMPILER STREQUAL "MinGW" OR FIREWORK_COMPILER STREQUAL "Clang")
target_include_directories(Firework.Runtime.CoreLib PRIVATE "${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bx/include/compat/mingw")
elseif (FIREWORK_COMPILER STREQUAL "MSVC")
target_include_directories(Firework.Runtime.CoreLib PRIVATE "${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bx/include/compat/msvc")
endif()
target_link_libraries(Firework.Runtime.CoreLib
PUBLIC
concurrentqueue
robin_hood
Firework.Mathematics
Firework.Runtime.RenderPipeline
Firework.Runtime.GL
PRIVATE
SDL3-static
)
if (FIREWORK_BUILD_PLATFORM STREQUAL "Win32")
if (FIREWORK_COMPILER STREQUAL "MinGW" OR FIREWORK_COMPILER STREQUAL "Clang")
target_link_options(Firework.Runtime.CoreLib PUBLIC -mwindows)
elseif (FIREWORK_COMPILER STREQUAL "MSVC")
target_link_options(Firework.Runtime.CoreLib PUBLIC /SUBSYSTEM:WINDOWS)
endif()
endif()
if (FIREWORK_BUILD_PLATFORM STREQUAL "Win32" OR FIREWORK_BUILD_PLATFORM STREQUAL "MacOS" OR FIREWORK_BUILD_PLATFORM STREQUAL "Linux")
target_link_libraries(Firework.Runtime.CoreLib PRIVATE cpptrace-lib)
if (FIREWORK_COMPILER STREQUAL "MinGW" OR FIREWORK_COMPILER STREQUAL "gcc")
target_compile_options(cpptrace-lib PRIVATE -include "${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.CoreLib/src/__mingw_cpptrace_fix.h")
# When using libdwarf, avoid dynamic zlib dependency.
# This zlib comes from some mystery subdirectory.
target_link_libraries(Firework.Runtime.CoreLib PRIVATE zlibstatic)
endif()
endif()
if (FIREWORK_BUILD_PLATFORM STREQUAL "Win32")
target_link_libraries(Firework.Runtime.CoreLib PRIVATE psapi)
endif()
target_compile_definitions(Firework.Runtime.CoreLib PUBLIC ${FIREWORK_COMPILE_DEFINITIONS})
target_compile_options(Firework.Runtime.CoreLib PUBLIC ${FIREWORK_COMPILE_FLAGS})
target_link_options(Firework.Runtime.CoreLib PUBLIC ${FIREWORK_LINKER_FLAGS})
set_target_properties(Firework.Runtime.CoreLib
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Runtime.CoreLib"
LIBRARY_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Runtime.CoreLib"
RUNTIME_OUTPUT_DIRECTORY "../bin/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Runtime.CoreLib"
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
)
# Firework.Components.Core2D
add_custom_target(PrecompileComponentCore2DShaders
COMMAND ${CMAKE_COMMAND}
-DSHADERC_PATH="$<TARGET_FILE:shaderc>"
-DSHADERC_DIR="$<TARGET_FILE_DIR:shaderc>"
-DSHADER_FILES_DIR="${CMAKE_CURRENT_LIST_DIR}/Firework.Components.Core2D/shaders"
-DBGFX_SHADER_DIR="${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bgfx/src"
-DCMAKE_BUILD_TYPE=$<CONFIG>
-P "${CMAKE_CURRENT_LIST_DIR}/cmake/PrecompileShaders.cmake"
)
add_dependencies(PrecompileComponentCore2DShaders shaderc)
file(GLOB_RECURSE GLSRCS configure_depends
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/*.h"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/*.cpp"
)
file(GLOB_RECURSE CORE2DSRCS configure_depends
"${CMAKE_CURRENT_LIST_DIR}/Firework.Components.Core2D/*.h"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Components.Core2D/*.cpp"
)
add_library(Firework.Components.Core2D SHARED ${CORE2DSRCS})
add_dependencies(Firework.Components.Core2D PrecompileComponentCore2DShaders)
generate_export_header(Firework.Components.Core2D
BASE_NAME FIREWORK_COMPONENTCORE2D
EXPORT_MACRO_NAME __firework_componentcore2d_api
EXPORT_FILE_NAME Firework.Components.Core2D.Exports.h
)
target_include_directories(Firework.Components.Core2D
PUBLIC
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Typography/src"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/src"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Components.Core2D/src"
"${CMAKE_CURRENT_LIST_DIR}/dependencies/stb"
"${CMAKE_CURRENT_LIST_DIR}/external/cpptrace/include"
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Firework.Components.Core2D/shaders/include"
)
target_link_libraries(Firework.Components.Core2D
PUBLIC
Firework.Mathematics
Firework.Runtime.CoreLib
Firework.Runtime.GL
Firework.Typography
)
target_compile_definitions(Firework.Components.Core2D PUBLIC ${FIREWORK_COMPILE_DEFINITIONS})
target_compile_options(Firework.Components.Core2D PUBLIC ${FIREWORK_COMPILE_FLAGS})
target_link_options(Firework.Components.Core2D PUBLIC ${FIREWORK_LINKER_FLAGS})
set_target_properties(Firework.Components.Core2D
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Components.Core2D"
LIBRARY_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Components.Core2D"
RUNTIME_OUTPUT_DIRECTORY "../bin/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Components.Core2D"
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
)
# Firework.Components.Core3D
add_custom_target(PrecompileComponentCore3DShaders
COMMAND ${CMAKE_COMMAND}
-DSHADERC_PATH="$<TARGET_FILE:shaderc>"
-DSHADERC_DIR="$<TARGET_FILE_DIR:shaderc>"
-DSHADER_FILES_DIR="${CMAKE_CURRENT_LIST_DIR}/Firework.Components.Core3D/shaders"
-DBGFX_SHADER_DIR="${CMAKE_CURRENT_LIST_DIR}/external/bgfx.cmake/bgfx/src"
-DCMAKE_BUILD_TYPE=$<CONFIG>
-P "${CMAKE_CURRENT_LIST_DIR}/cmake/PrecompileShaders.cmake"
)
add_dependencies(PrecompileComponentCore3DShaders shaderc)
file(GLOB_RECURSE GLSRCS configure_depends
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/*.h"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Runtime.GL/*.cpp"
)
file(GLOB_RECURSE CORE3DSRCS configure_depends
"${CMAKE_CURRENT_LIST_DIR}/Firework.Components.Core3D/*.h"
"${CMAKE_CURRENT_LIST_DIR}/Firework.Components.Core3D/*.cpp"
)
add_library(Firework.Components.Core3D SHARED ${CORE3DSRCS})
add_dependencies(Firework.Components.Core3D PrecompileComponentCore3DShaders)
generate_export_header(Firework.Components.Core3D
BASE_NAME FIREWORK_COMPONENTCORE3D
EXPORT_MACRO_NAME __firework_componentcore3d_api
EXPORT_FILE_NAME Firework.Components.Core3D.Exports.h
)
target_include_directories(Firework.Components.Core3D
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Firework.Components.Core3D/src"
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Firework.Components.Core3D/shaders/include"
)
target_link_libraries(Firework.Components.Core3D
PUBLIC
Firework.Runtime.CoreLib
)
target_compile_definitions(Firework.Components.Core3D PUBLIC ${FIREWORK_COMPILE_DEFINITIONS})
target_compile_options(Firework.Components.Core3D PUBLIC ${FIREWORK_COMPILE_FLAGS})
target_link_options(Firework.Components.Core3D PUBLIC ${FIREWORK_LINKER_FLAGS})
set_target_properties(Firework.Components.Core3D
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Components.Core3D"
LIBRARY_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Components.Core3D"
RUNTIME_OUTPUT_DIRECTORY "../bin/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Firework.Components.Core3D"
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
)
# Examples and tests.
list(APPEND EXAMPLES "HelloFireworkUI")
list(APPEND EXAMPLES "DevTest")
if (FIREWORK_BUILD_EXAMPLES)
foreach (EXAMPLE_NAME ${EXAMPLES})
string(REPLACE "." "_" EXAMPLE_NAME_NORMALIZED "${EXAMPLE_NAME}")
add_custom_target(Package${EXAMPLE_NAME_NORMALIZED}Assets
COMMAND ${CMAKE_COMMAND}
-DFIREWORK_PACKAGER_EXECUTABLE="$<TARGET_FILE:Firework.Packager>"
-DPACKAGE_INPUT_FOLDER="${CMAKE_CURRENT_LIST_DIR}/examples/${EXAMPLE_NAME}/Assets"
-DPACKAGE_OUTPUT_FILE="$<TARGET_FILE_DIR:${EXAMPLE_NAME}>/Runtime/CorePackage.fwpkg"
-P "${CMAKE_CURRENT_LIST_DIR}/cmake/PackageArchive.cmake"
)
add_dependencies(Package${EXAMPLE_NAME_NORMALIZED}Assets Firework.Packager)
add_executable(${EXAMPLE_NAME} "${CMAKE_CURRENT_LIST_DIR}/examples/${EXAMPLE_NAME}/main.cpp")
# target_sources(${EXAMPLE_NAME} PUBLIC FILE_SET CXX_MODULES FILES "${CMAKE_CURRENT_LIST_DIR}/examples/${EXAMPLE_NAME}/main.cpp")
add_dependencies(${EXAMPLE_NAME} Package${EXAMPLE_NAME_NORMALIZED}Assets)
target_link_libraries(${EXAMPLE_NAME} PUBLIC Firework.Components.Core2D Firework.Components.Core3D)
set_target_properties(${EXAMPLE_NAME}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Examples/${EXAMPLE_NAME}"
LIBRARY_OUTPUT_DIRECTORY "../lib/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Examples/${EXAMPLE_NAME}"
RUNTIME_OUTPUT_DIRECTORY "../bin/${FIREWORK_TARGET_ARCH}-${FIREWORK_COMPILER}-$<CONFIG>-${FIREWORK_BUILD_PLATFORM}/Examples/${EXAMPLE_NAME}"
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
)
add_custom_command(TARGET ${EXAMPLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:Firework.Typography>
$<TARGET_FILE_DIR:${EXAMPLE_NAME}>
)
add_custom_command(TARGET ${EXAMPLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:Firework.Runtime.GL>
$<TARGET_FILE_DIR:${EXAMPLE_NAME}>
)
add_custom_command(TARGET ${EXAMPLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:Firework.Runtime.RenderPipeline>
$<TARGET_FILE_DIR:${EXAMPLE_NAME}>
)
add_custom_command(TARGET ${EXAMPLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:Firework.Runtime.CoreLib>
$<TARGET_FILE_DIR:${EXAMPLE_NAME}>
)
add_custom_command(TARGET ${EXAMPLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:Firework.Components.Core2D>
$<TARGET_FILE_DIR:${EXAMPLE_NAME}>
)
add_custom_command(TARGET ${EXAMPLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:Firework.Components.Core3D>
$<TARGET_FILE_DIR:${EXAMPLE_NAME}>
)
endforeach()
endif()