-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDependency.cmake
194 lines (181 loc) · 5.98 KB
/
Dependency.cmake
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
include(ExternalProject)
if (MSVC)
set(LINK_DIR_OPTION -LIBPATH:)
elseif()
set(LINK_DIR_OPTION -L)
endif()
set(DEPENDENCY_INSTALL_DIR ${PROJECT_BINARY_DIR}/install)
set(DEPENDENCY_INCLUDE_DIR ${DEPENDENCY_INSTALL_DIR}/include)
set(DEPENDENCY_LIB_DIR ${DEPENDENCY_INSTALL_DIR}/lib)
# set(DEPENDENCY_LIBS ${LINK_DIR_OPTION}${DEPENDENCY_LIB_DIR})
# spdlog: fast logger library
ExternalProject_Add(
dep-spdlog
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
GIT_TAG "v1.x"
GIT_SHALLOW 1
UPDATE_COMMAND ""
PATCH_COMMAND ""
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
TEST_COMMAND ""
)
set(DEPENDENCY_LIST ${DEPENDENCY_LIST} dep-spdlog)
# if (GENERATOR_IS_MULTI_CONFIG)
if (MSVC)
set(DEPENDENCY_LIBS ${DEPENDENCY_LIBS} spdlog$<$<CONFIG:Debug>:d>)
else()
set(DEPENDENCY_LIBS ${DEPENDENCY_LIBS} spdlog)
endif()
# json: header-only json parser using modern c++
ExternalProject_Add(
dep-json
GIT_REPOSITORY "https://github.com/nlohmann/json.git"
GIT_TAG "v3.11.3"
GIT_SHALLOW 1
UPDATE_COMMAND ""
PATCH_COMMAND ""
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
-DJSON_BuildTests=OFF
TEST_COMMAND ""
)
set(DEPENDENCY_LIST ${DEPENDENCY_LIST} dep-json)
# magic_enum: header-only enum class utility
ExternalProject_Add(
dep_magic_enum
GIT_REPOSITORY "https://github.com/Neargye/magic_enum.git"
GIT_TAG "v0.9.6"
GIT_SHALLOW 1
UPDATE_COMMAND ""
PATCH_COMMAND ""
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
-DMAGIC_ENUM_OPT_BUILD_EXAMPLES=OFF
-DMAGIC_ENUM_OPT_BUILD_TESTS=OFF
TEST_COMMAND ""
)
set(DEPENDENCY_LIST ${DEPENDENCY_LIST} dep_magic_enum)
# filesystem: c++14-based filesystem that implements c++17 filesystem
ExternalProject_Add(
dep_filesystem
GIT_REPOSITORY "https://github.com/gulrak/filesystem.git"
GIT_TAG "v1.5.14"
GIT_SHALLOW 1
UPDATE_COMMAND ""
PATCH_COMMAND ""
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
-DGHC_FILESYSTEM_BUILD_TESTING=OFF
-DGHC_FILESYSTEM_BUILD_EXAMPLES=OFF
TEST_COMMAND ""
)
set(DEPENDENCY_LIST ${DEPENDENCY_LIST} dep_filesystem)
# sdl2
ExternalProject_Add(
dep_sdl
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
GIT_TAG "release-2.30.5"
GIT_SHALLOW 1
UPDATE_COMMAND ""
PATCH_COMMAND ""
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
-DSDL_TEST_LIBRARY=OFF
TEST_COMMAND ""
)
set(DEPENDENCY_LIST ${DEPENDENCY_LIST} dep_sdl)
if (MSVC)
set(DEPENDENCY_LIBS ${DEPENDENCY_LIBS} SDL2$<$<CONFIG:Debug>:d>)
else()
set(DEPENDENCY_LIBS ${DEPENDENCY_LIBS} SDL2)
endif()
## additional dependencies, for graphics programming
# # clipp: header-only good c++ argument parser
# ExternalProject_Add(
# dep-clipp
# GIT_REPOSITORY "https://github.com/muellan/clipp.git"
# GIT_TAG "v1.2.2"
# GIT_SHALLOW 1
# UPDATE_COMMAND ""
# PATCH_COMMAND ""
# CONFIGURE_COMMAND ""
# BUILD_COMMAND ""
# INSTALL_COMMAND
# ${CMAKE_COMMAND} -E make_directory ${DEPENDENCY_INSTALL_DIR}/include &&
# ${CMAKE_COMMAND} -E copy
# ${CMAKE_CURRENT_BINARY_DIR}/dep-clipp-prefix/src/dep-clipp/include/clipp.h
# ${DEPENDENCY_INSTALL_DIR}/include
# TEST_COMMAND ""
# )
# set(DEPENDENCY_LIST ${DEPENDENCY_LIST} dep-clipp)
# # stb: the king of header-only libraries
# ExternalProject_Add(
# dep-stb
# GIT_REPOSITORY "https://github.com/nothings/stb.git"
# GIT_SHALLOW 1
# UPDATE_COMMAND ""
# PATCH_COMMAND ""
# CONFIGURE_COMMAND ""
# BUILD_COMMAND ""
# INSTALL_COMMAND
# ${CMAKE_COMMAND} -E make_directory ${DEPENDENCY_INSTALL_DIR}/include &&
# ${CMAKE_COMMAND} -E copy
# ${CMAKE_CURRENT_BINARY_DIR}/dep-stb-prefix/src/dep-stb/stb_image.h ${DEPENDENCY_INSTALL_DIR}/include
# ${CMAKE_CURRENT_BINARY_DIR}/dep-stb-prefix/src/dep-stb/stb_truetype.h ${DEPENDENCY_INSTALL_DIR}/include
# TEST_COMMAND ""
# )
# set(DEPENDENCY_LIST ${DEPENDENCY_LIST} dep-stb)
# # linalg.h: single header, public domain, short vector math library for c++
# ExternalProject_Add(
# dep-linalg
# GIT_REPOSITORY "https://github.com/sgorsten/linalg.git"
# GIT_TAG main
# GIT_SHALLOW 1
# UPDATE_COMMAND ""
# PATCH_COMMAND ""
# CONFIGURE_COMMAND ""
# BUILD_COMMAND ""
# INSTALL_COMMAND
# ${CMAKE_COMMAND} -E make_directory ${DEPENDENCY_INSTALL_DIR}/include &&
# ${CMAKE_COMMAND} -E copy
# ${CMAKE_CURRENT_BINARY_DIR}/dep-linalg-prefix/src/dep-linalg/linalg.h ${DEPENDENCY_INSTALL_DIR}/include
# TEST_COMMAND ""
# )
# set(DEPENDENCY_LIST ${DEPENDENCY_LIST} dep-linalg)
# # imgui: best immediate-mode gui library for all graphics applications
# ExternalProject_Add(
# dep-imgui
# GIT_REPOSITORY "https://github.com/ocornut/imgui.git"
# GIT_TAG v1.85
# GIT_SHALLOW 1
# UPDATE_COMMAND ""
# PATCH_COMMAND
# ${CMAKE_COMMAND} -E copy
# ${CMAKE_CURRENT_SOURCE_DIR}/cmake/imgui.cmake
# ${CMAKE_CURRENT_BINARY_DIR}/dep-imgui-prefix/src/dep-imgui/CMakeLists.txt
# CMAKE_ARGS
# -DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
# -DIMGUI_GLFW_INCLUDE_DIR=${DEPENDENCY_INCLUDE_DIR}
# -DIMGUI_VULKAN_INCLUDE_DIR=${Vulkan_INCLUDE_DIR}
# TEST_COMMAND ""
# )
# add_dependencies(dep-imgui dep-glfw)
# set(DEPENDENCY_LIST ${DEPENDENCY_LIST} dep-imgui)
# set(DEPENDENCY_LIBS ${DEPENDENCY_LIBS} imgui)
# # glfw
# ExternalProject_Add(
# dep_glfw
# GIT_REPOSITORY "https://github.com/glfw/glfw.git"
# GIT_TAG "3.3-stable"
# GIT_SHALLOW 1
# UPDATE_COMMAND ""
# PATCH_COMMAND ""
# CMAKE_ARGS
# -DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
# -DGLFW_BUILD_EXAMPLES=OFF
# -DGLFW_BUILD_TESTS=OFF
# -DGLFW_BUILD_DOCS=OFF
# TEST_COMMAND ""
# )
# set(DEPENDENCY_LIST ${DEPENDENCY_LIST} dep_glfw)
# set(DEPENDENCY_LIBS ${DEPENDENCY_LIBS} glfw3)