-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
206 lines (180 loc) · 9.49 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
cmake_minimum_required(VERSION 3.19.3)
project(kotek.engine)
message("[${PROJECT_NAME}]: CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}")
message("[${PROJECT_NAME}]: CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}")
# it is our requirement for generating the library e.g. don't just write 'cmake ..'
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
message(FATAL_ERROR "[${PROJECT_NAME}]: you must specify CMAKE_BUILD_TYPE flag with the following types: Debug, Release, MinSizeRel, RelWithDebInfo. It supposed to be like -DCMAKE_BUILD_TYPE=Debug")
endif()
if ("${KOTEK_DEPS_FOLDER_ENABLE}" STREQUAL "")
set(KOTEK_DEPS_FOLDER_ENABLE "ON" CACHE INTERNAL "")
message("[${PROJECT_NAME}]: KOTEK_DEPS_FOLDER is enabled! Now you should specified your dependency folder name (but not its path)")
endif()
message("[${PROJECT_NAME}]: build type is '${CMAKE_BUILD_TYPE}'")
if ("${KOTEK_FILENAME_FOR_GENERATING_PREPROCESSORS}" STREQUAL "")
set(KOTEK_FILENAME_FOR_GENERATING_PREPROCESSORS ./include/kotek_std_preprocessors.h)
endif()
if ("${KOTEK_LIBRARY_TYPE}" STREQUAL "")
set(KOTEK_LIBRARY_TYPE "EMB" CACHE INTERNAL "")
message("[${PROJECT_NAME}]: library development - ${KOTEK_LIBRARY_TYPE} (EMB is embedded and DYN is dynamic, check documentation about these definitions)")
endif()
message("[${PROJECT_NAME}]: filename for generating preprocessors: '${KOTEK_FILENAME_FOR_GENERATING_PREPROCESSORS}'")
if ("${KOTEK_DEPS_FOLDER_ENABLE}" STREQUAL "ON")
if ("${KOTEK_DEPS_FOLDER}" STREQUAL "")
# TODO: add conan here
message("[${PROJECT_NAME}]: trying to make an attempt to find any package manager that user provides to this path [${CMAKE_CURRENT_SOURCE_DIR}]")
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg")
message("[${PROJECT_NAME}]: VCPKG exists so we use dependencies from vcpkg")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")
set(KOTEK_DEPS_FOLDER "vcpkg" CACHE INTERNAL "")
else()
message(FATAL_ERROR "[${PROJECT_NAME}] cmake didn't find vcpkg folder where root CMakeLists.txt is located. Otherwise you have to specify your folder where dependencies are stored")
endif()
else()
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${KOTEK_DEPS_FOLDER}")
message("[${PROJECT_NAME}]: your dependency folder is '${KOTEK_DEPS_FOLDER}'")
else()
message("[${PROJECT_NAME}]: your specified folder [${KOTEK_DEPS_FOLDER}] doesn't exist in path [${CMAKE_CURRENT_SOURCE_DIR}]")
endif()
endif()
endif()
if ("${KOTEK_STD_LIBRARY_STATIC_CONTAINERS}" STREQUAL "")
set(KOTEK_STD_LIBRARY_STATIC_CONTAINERS "ON" CACHE INTERNAL "")
message("[${PROJECT_NAME}]: static containers are enabled by default!")
endif()
include_directories("engine")
add_subdirectory("engine/kotek.core.defines.static.cpp")
add_subdirectory("engine/kotek.core.defines.static.git")
add_subdirectory("engine/kotek.core.defines.static.render")
add_subdirectory("engine/kotek.core.defines.static.render.dx")
add_subdirectory("engine/kotek.core.defines.static.render.gl")
add_subdirectory("engine/kotek.core.defines.static.render.vk")
add_subdirectory("engine/kotek.core.defines.static.math")
add_subdirectory("engine/kotek.core.defines.static.os")
add_subdirectory("engine/kotek.core.defines.static.os.win32")
add_subdirectory("engine/kotek.core.defines.static.os.linux")
add_subdirectory("engine/kotek.core.defines.static.profilers")
add_subdirectory("engine/kotek.core.defines.static.sdk")
add_subdirectory("engine/kotek.core.defines.static.string")
add_subdirectory("engine/kotek.core.defines.static.tests")
add_subdirectory("engine/kotek.core.defines.static")
add_subdirectory("engine/kotek.core.defines_dependent.text")
add_subdirectory("engine/kotek.core.defines_dependent.message")
add_subdirectory("engine/kotek.core.defines_dependent.assert")
add_subdirectory("engine/kotek.core.defines_dependent.ecs")
add_subdirectory("engine/kotek.core.defines_dependent")
add_subdirectory("engine/kotek.core.defines")
add_subdirectory("engine/kotek.core")
add_subdirectory("engine/kotek.core.api")
add_subdirectory("engine/kotek.core.types")
add_subdirectory("engine/kotek.core.types.char")
add_subdirectory("engine/kotek.core.types.numerics")
add_subdirectory("engine/kotek.core.types.string")
add_subdirectory("engine/kotek.core.casting")
add_subdirectory("engine/kotek.core.casting.lexical")
add_subdirectory("engine/kotek.core.casting.string")
add_subdirectory("engine/kotek.core.constants")
add_subdirectory("engine/kotek.core.constants.math")
add_subdirectory("engine/kotek.core.constants.ecs")
add_subdirectory("engine/kotek.core.constants.string")
add_subdirectory("engine/kotek.core.constants.window")
add_subdirectory("engine/kotek.core.containers")
add_subdirectory("engine/kotek.core.containers.any")
add_subdirectory("engine/kotek.core.containers.array")
add_subdirectory("engine/kotek.core.containers.string")
add_subdirectory("engine/kotek.core.containers.hash")
add_subdirectory("engine/kotek.core.containers.deque")
add_subdirectory("engine/kotek.core.containers.dll")
add_subdirectory("engine/kotek.core.containers.filesystem")
add_subdirectory("engine/kotek.core.containers.filesystem.path")
add_subdirectory("engine/kotek.core.containers.function")
add_subdirectory("engine/kotek.core.containers.io")
add_subdirectory("engine/kotek.core.containers.json")
add_subdirectory("engine/kotek.core.containers.map")
add_subdirectory("engine/kotek.core.containers.microsoft")
add_subdirectory("engine/kotek.core.containers.microsoft.wrl.comptr")
add_subdirectory("engine/kotek.core.containers.multithreading")
add_subdirectory("engine/kotek.core.containers.multithreading.tbb")
add_subdirectory("engine/kotek.core.containers.multithreading.atomic")
add_subdirectory("engine/kotek.core.containers.multithreading.mutex")
add_subdirectory("engine/kotek.core.containers.multithreading.shared_mutex")
add_subdirectory("engine/kotek.core.containers.multithreading.thread")
add_subdirectory("engine/kotek.core.containers.multithreading.semaphore")
add_subdirectory("engine/kotek.core.containers.multithreading.queue")
add_subdirectory("engine/kotek.core.containers.pair")
add_subdirectory("engine/kotek.core.containers.queue")
add_subdirectory("engine/kotek.core.containers.shared_ptr")
add_subdirectory("engine/kotek.core.containers.unique_ptr")
add_subdirectory("engine/kotek.core.containers.unordered_map")
add_subdirectory("engine/kotek.core.containers.unordered_set")
add_subdirectory("engine/kotek.core.containers.variant")
add_subdirectory("engine/kotek.core.containers.vector")
add_subdirectory("engine/kotek.core.containers.list")
add_subdirectory("engine/kotek.core.filesystem")
add_subdirectory("engine/kotek.core.filesystem.file_text")
add_subdirectory("engine/kotek.core.format")
add_subdirectory("engine/kotek.core.memory")
add_subdirectory("engine/kotek.core.memory.cpu")
add_subdirectory("engine/kotek.core.memory.gpu")
add_subdirectory("engine/kotek.core.memory.gpu.vulkan")
if ("${KOTEK_MEMORY_LEAK_DETECTION}" STREQUAL "ON")
if ("${KOTEK_CPP_MEMORY_LEAK_LIBRARY}" STREQUAL "VLD")
add_subdirectory("engine/kotek.core.memory.vld")
endif()
endif()
add_subdirectory("engine/kotek.core.math")
add_subdirectory("engine/kotek.core.profilers")
add_subdirectory("engine/kotek.core.profilers.cpu")
add_subdirectory("engine/kotek.core.profilers.gpu")
add_subdirectory("engine/kotek.core.resource_manager")
add_subdirectory("engine/kotek.core.resource_manager.loader")
add_subdirectory("engine/kotek.core.resource_manager.saver")
add_subdirectory("engine/kotek.core.os")
add_subdirectory("engine/kotek.core.os.win32")
add_subdirectory("engine/kotek.core.os.linux")
add_subdirectory("engine/kotek.core.window")
add_subdirectory("engine/kotek.core.window.glfw")
add_subdirectory("engine/kotek.core.window_manager")
add_subdirectory("engine/kotek.core.log")
add_subdirectory("engine/kotek.core.console")
add_subdirectory("engine/kotek.core.engine_config")
add_subdirectory("engine/kotek.core.main_manager")
add_subdirectory("engine/kotek.core.ecs")
add_subdirectory("engine/kotek.core.enum")
add_subdirectory("engine/kotek.core.enum.core")
add_subdirectory("engine/kotek.core.enum.render")
add_subdirectory("engine/kotek.core.enum.render.dx")
add_subdirectory("engine/kotek.core.enum.render.gl")
add_subdirectory("engine/kotek.core.enum.render.vk")
add_subdirectory("engine/kotek.core.input")
add_subdirectory("engine/kotek.core.utility")
add_subdirectory("engine/kotek.game")
add_subdirectory("engine/kotek.ui")
add_subdirectory("engine/kotek.ui.imgui")
if ("${KOTEK_UI_GAME_LIBRARY}" STREQUAL "CEF")
add_subdirectory("engine/kotek.ui.cef")
elseif("${KOTEK_UI_GAME_LIBRARY}" STREQUAL "RMLUI")
add_subdirectory("engine/kotek.ui.rmlui")
endif()
add_subdirectory("engine/kotek.ui.videoplayer")
add_subdirectory("engine/kotek.ui.videoplayer.avif")
if (WIN32)
# DEPRECATED: undo comments when you finish vulkan renderer!
#add_subdirectory("engine/kotek.render.dx12")
endif()
add_subdirectory("engine/kotek.render")
add_subdirectory("engine/kotek.render.shared")
add_subdirectory("engine/kotek.render.shared.vk")
add_subdirectory("engine/kotek.render.shared.gl")
add_subdirectory("engine/kotek.render.shared.dx")
add_subdirectory("engine/kotek.render.model")
add_subdirectory("engine/kotek.render.model.assimp")
add_subdirectory("engine/kotek.render.model.cgltf")
add_subdirectory("engine/kotek.render.vk")
add_subdirectory("engine/kotek.render.gl")
add_subdirectory("engine/kotek.render.gl.glad")
add_subdirectory("engine/kotek.render.software")
add_subdirectory("engine/kotek.render.angle.gles")
add_subdirectory("engine/kotek.render.angle.gles23")
add_subdirectory("engine/kotek.exe")
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT kotek)