-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathdependencies.cmake
More file actions
299 lines (240 loc) · 6.63 KB
/
dependencies.cmake
File metadata and controls
299 lines (240 loc) · 6.63 KB
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
include(FetchContent)
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_SHALLOW TRUE
)
FetchContent_Declare(
imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_SHALLOW TRUE
GIT_TAG v1.89.9-docking
SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/imgui"
)
FetchContent_Declare(
imguizmo
GIT_REPOSITORY https://github.com/CedricGuillemet/ImGuizmo.git
GIT_SHALLOW TRUE
GIT_TAG 1.83
SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/ImGuizmo"
)
FetchContent_Declare(
stb
GIT_REPOSITORY https://github.com/nothings/stb.git
GIT_SHALLOW TRUE
SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/stb
)
FetchContent_Declare(
glfw3
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_SHALLOW TRUE
GIT_TAG 3.3.10
)
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_SHALLOW TRUE
GIT_TAG v1.15.3
)
FetchContent_Declare(
EnTT
GIT_REPOSITORY https://github.com/skypjack/entt.git
GIT_SHALLOW TRUE
GIT_TAG v3.16.0
)
FetchContent_Declare(
assimp
GIT_REPOSITORY https://github.com/assimp/assimp.git
GIT_SHALLOW TRUE
)
FetchContent_Declare(
stduuid
GIT_REPOSITORY https://github.com/mariusbancila/stduuid.git
GIT_SHALLOW TRUE
)
FetchContent_Declare(
yaml-cpp
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp
GIT_SHALLOW TRUE
)
FetchContent_Declare(
spirv_cross_core
GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Cross.git
GIT_TAG vulkan-sdk-1.3.296.0
GIT_SHALLOW TRUE
)
FetchContent_Declare(
VulkanMemoryAllocator
GIT_REPOSITORY https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
GIT_SHALLOW TRUE
GIT_TAG v3.3.0
)
FetchContent_Declare(
SPIRV-Headers
GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Headers.git
GIT_SHALLOW TRUE
GIT_TAG vulkan-sdk-1.3.296.0
)
FetchContent_Declare(
glslang
GIT_REPOSITORY https://github.com/KhronosGroup/glslang.git
GIT_SHALLOW TRUE
GIT_TAG 14.3.0
SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/glslang"
)
FetchContent_Declare(
SPIRV-Tools
GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Tools.git
GIT_SHALLOW TRUE
GIT_TAG vulkan-sdk-1.3.296.0
)
Fetchcontent_Declare(
GTest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_SHALLOW TRUE
GIT_TAG main
)
Fetchcontent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_SHALLOW TRUE
)
Fetchcontent_Declare(
tlsf
GIT_REPOSITORY https://github.com/mattconte/tlsf
GIT_SHALLOW TRUE
SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/tlsf
)
Fetchcontent_Declare(
CLI11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11
GIT_SHALLOW TRUE
GIT_TAG main
SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/CLI11
)
Fetchcontent_Declare(
rapidhash
GIT_REPOSITORY https://github.com/Nicoshev/rapidhash
GIT_SHALLOW TRUE
SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/rapidhash
)
FetchContent_Declare(Vulkan-Headers
GIT_REPOSITORY https://github.com/KhronosGroup/Vulkan-Headers
GIT_SHALLOW TRUE
GIT_TAG vulkan-sdk-1.3.296.0
)
FetchContent_Declare(Vulkan-Loader
GIT_REPOSITORY https://github.com/KhronosGroup/Vulkan-Loader
GIT_SHALLOW TRUE
GIT_TAG vulkan-sdk-1.3.296.0
)
FetchContent_MakeAvailable(
fmt
Vulkan-Headers
Vulkan-Loader
imgui
ImGuizmo
stb
glfw3
spdlog
EnTT
assimp
stduuid
yaml-cpp
VulkanMemoryAllocator
SPIRV-Headers
spirv_cross_core
nlohmann_json
tlsf
CLI11
rapidhash
SPIRV-Tools
glslang
GTest
)
set(IMGUIDIR ${FETCHCONTENT_BASE_DIR}/imgui)
add_library(imgui STATIC)
target_sources(
imgui
PRIVATE ${IMGUIDIR}/imgui.cpp
${IMGUIDIR}/imgui_demo.cpp
${IMGUIDIR}/imgui_draw.cpp
${IMGUIDIR}/imgui_tables.cpp
${IMGUIDIR}/imgui_widgets.cpp
${IMGUIDIR}/misc/cpp/imgui_stdlib.cpp
${IMGUIDIR}/backends/imgui_impl_glfw.cpp
${IMGUIDIR}/backends/imgui_impl_vulkan.cpp)
target_include_directories(imgui
PUBLIC ${FETCHCONTENT_BASE_DIR}
PUBLIC ${FETCHCONTENT_BASE_DIR}/imgui
)
target_compile_definitions(imgui PUBLIC GLFW_INCLUDE_VULKAN IMGUI_DEFINE_MATH_OPERATORS)
target_link_libraries(imgui PRIVATE glfw Vulkan::Headers Vulkan::Loader)
add_library(imguizmo STATIC)
target_sources(imguizmo
PRIVATE ${FETCHCONTENT_BASE_DIR}/ImGuizmo/ImGuizmo.cpp)
target_include_directories(imguizmo
PUBLIC ${FETCHCONTENT_BASE_DIR}/imguizmo-src)
target_link_libraries(imguizmo PUBLIC imgui)
add_library(External_libs INTERFACE)
target_include_directories(External_libs
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
${FETCHCONTENT_BASE_DIR}
${FETCHCONTENT_BASE_DIR}/rapidhash
${FETCHCONTENT_BASE_DIR}/stb
${FETCHCONTENT_BASE_DIR}/CLI11
${FETCHCONTENT_BASE_DIR}/tlsf
)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(External_libs INTERFACE SPIRV-Tools-static)
else()
target_link_libraries(External_libs INTERFACE SPIRV-Tools)
endif()
target_link_libraries(External_libs
INTERFACE
Vulkan::Headers
Vulkan::Loader
glfw
fmt::fmt
imguizmo
spdlog::spdlog
EnTT::EnTT
assimp::assimp
stduuid
yaml-cpp::yaml-cpp
spirv-cross-core
SPIRV-Tools-opt
glslang::glslang
glslang::glslang-default-resource-limits
glslang::SPIRV
GPUOpen::VulkanMemoryAllocator
nlohmann_json::nlohmann_json
)
add_library(imported::ZEngine_External_Dependencies ALIAS External_libs)
add_library(External_obeliskLibs INTERFACE)
target_link_libraries(External_obeliskLibs
INTERFACE
CLI11::CLI11
)
add_library(imported::External_obeliskLibs ALIAS External_obeliskLibs)
include(${CMAKE_CURRENT_SOURCE_DIR}/Scripts/CMake/NuGet.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/Scripts/CMake/CppWinRT.cmake)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
# Install necessary NuGet dependencies
install_nuget_package(Microsoft.Windows.CppWinRT 2.0.240405.15 CPPWINRT_NUGET_PATH)
# Generate CppWinRT headers for the local OS
generate_winrt_headers(
EXECUTABLE
${CPPWINRT_NUGET_PATH}/bin/cppwinrt.exe
INPUT
local
OUTPUT
${CMAKE_BINARY_DIR}/__winrt
OPTIMIZE
)
add_library(imported::cppwinrt_headers INTERFACE IMPORTED)
target_include_directories(imported::cppwinrt_headers INTERFACE
${CMAKE_BINARY_DIR}/__winrt
)
endif()