-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
244 lines (217 loc) · 8.52 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
cmake_minimum_required (VERSION 3.14)
project (Floof)
set(CMAKE_CXX_STANDARD 20)
add_compile_definitions(FLOOF_DEVELOPER_PATH="${CMAKE_CURRENT_SOURCE_DIR}")
add_executable(Floof
Source/Floof.cpp
Source/Floof.h
Source/Renderer/VulkanRenderer.h
Source/Renderer/VulkanRenderer.cpp
Source/Renderer/VulkanAllocator.cpp
Source/Application.h
Source/Application.cpp
Source/Timer.h
Source/ObjLoader.h
Source/ObjLoader.cpp
Source/Renderer/Vertex.h
Source/Components.h
Source/Math.h
Source/Components.cpp
Source/Input.h
Source/Utils.h
Source/Utils.cpp
Source/LasLoader.cpp
Source/LasLoader.h
Source/Renderer/ModelManager.h
Source/Renderer/TextureManager.h
Source/Renderer/ModelManager.cpp
Source/Renderer/TextureManager.cpp
Source/Renderer/Mesh.h
Source/Renderer/Texture.h
Source/Renderer/SceneRenderer.h
Source/Renderer/SceneRenderer.cpp
Source/Renderer/stb_image.cpp
Source/Scene.h
Source/Scene.cpp
Source/PhysicsSystem.cpp
Source/PhysicsSystem.h
Source/Renderer/Material.h
Source/Renderer/Mesh.cpp
Source/SoundManager.h
Source/SoundManager.cpp
Source/Renderer/VulkanBuffer.h
Source/Renderer/VulkanBuffer.cpp
Source/NativeScripts/NativeScript.h
Source/NativeScripts/TestScript.h
Source/NativeScripts/TestScript.cpp
Source/Renderer/VulkanBuffer.h
Source/Renderer/VulkanBuffer.cpp
Source/HeightmapLoader.h
Source/HeightmapLoader.cpp
Source/ApplicationLayer.h
Source/ApplicationLayer.cpp
Source/Editor/EditorLayer.h
Source/Editor/EditorLayer.cpp
Source/Editor/EditorPanels/SceneGraphPanel.h
Source/Editor/EditorPanels/SceneGraphPanel.cpp
Source/Editor/EditorPanels/ComponentsPanel.h
Source/Editor/EditorPanels/ComponentsPanel.cpp
Source/Editor/EditorPanels/EditorPanel.h
Source/Editor/EditorPanels/ApplicationPanel.h
Source/Editor/EditorPanels/ApplicationPanel.cpp
Source/HeightmapLoader.cpp
Source/NativeScripts/CarBaseScript.cpp
Source/NativeScripts/CarBaseScript.h
Source/Editor/EditorPanels/PhysicsPanel.cpp
Source/Editor/EditorPanels/PhysicsPanel.h
Source/Editor/EditorPanels/RendererPanel.h
Source/Editor/EditorPanels/RendererPanel.cpp
Source/Renderer/Texture.cpp
Source/Renderer/Material.cpp
Source/TransformComponent.h
Source/Renderer/Cubemap.h
Source/Renderer/Cubemap.cpp
Source/Renderer/Skybox.h
Source/Renderer/Skybox.cpp
Source/Editor/EditorPanels/SoundSettingsPanel.h
Source/Editor/EditorPanels/SoundSettingsPanel.cpp
Source/HeightField.cpp Source/HeightField.h
Source/Renderer/IBL.h
Source/Renderer/Framebuffer.h
Source/Renderer/Framebuffer.cpp
Source/Renderer/IBL.cpp
Source/NativeScripts/WonderBaumScript.cpp
Source/NativeScripts/WonderBaumScript.h
Source/HeightField.cpp Source/HeightField.h
Source/Renderer/IBL.h
Source/Renderer/Framebuffer.h
Source/Renderer/Framebuffer.cpp
Source/Renderer/IBL.cpp
Source/Editor/EditorPanels/SoundClipPanel.h
Source/Editor/EditorPanels/SoundClipPanel.cpp
Source/Editor/EditorPanels/SoundSourcesPanel.cpp
Source/Editor/EditorPanels/SoundSourcesPanel.h
Source/NativeScripts/LightSwarm.cpp
Source/NativeScripts/LightSwarm.h
Source/CameraComponent.cpp
Source/CameraComponent.h
Source/PointLightComponent.h
Source/NativeScripts/NativeScript.cpp
Source/CollisionDispatcher.cpp Source/CollisionDispatcher.h
Source/Network/Server.h
Source/Network/Message.h
Source/Network/Client.h
Source/Network/Queue.h
Source/Network/Connection.h
Source/Network/FloofNetworking.h
Source/Editor/EditorPanels/NetworkPanel.cpp
Source/Editor/EditorPanels/NetworkPanel.h
Source/NativeScripts/GameModeScript.h
Source/Network/OlcNet.h
Source/LineMeshComponent.h Source/LineMeshComponent.cpp
Source/SoundComponent.h
Source/SoundComponent.cpp
Source/NativeScripts/CheckPointScript.cpp
Source/NativeScripts/CheckPointScript.h
Source/NativeScripts/RaceTrackScript.cpp
Source/NativeScripts/RaceTrackScript.h
Source/NativeScripts/CarScripts/MonsterTruckScript.cpp
Source/NativeScripts/CarScripts/MonsterTruckScript.h
Source/NativeScripts/CarScripts/RaceCarScript.cpp
Source/NativeScripts/CarScripts/RaceCarScript.h
Source/ServerLayer.cpp
Source/ServerLayer.h
Source/NativeScripts/EnvironmentSoundScript.h
Source/NativeScripts/EnvironmentSoundScript.cpp)
find_package(Vulkan REQUIRED)
target_include_directories(Floof PUBLIC ${Vulkan_INCLUDE_DIRS})
target_link_libraries(Floof ${Vulkan_LIBRARIES})
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(Libs/glfw)
target_link_libraries(Floof glfw)
set(BUILD_SHARED_LIBS OFF)
set(BULLET_VERSION 3)
set(BULLET_PHYSICS_SOURCE_DIR ../../)
#add_compile_definitions(__BT_DISABLE_SSE__) #disable sse on all systems, fix bullet LinearMath not compiling
add_compile_definitions(BT_USE_SSE_IN_API) #enable SSE
set(Bullet_Dir Libs/bullet3)
add_library(Bullet STATIC)
target_include_directories(Bullet PUBLIC ${Bullet_Dir}/src)
target_sources(Bullet PRIVATE
${Bullet_Dir}/src/btBulletDynamicsAll.cpp
${Bullet_Dir}/src/btBulletCollisionAll.cpp
${Bullet_Dir}/src/btLinearMathAll.cpp
)
target_link_libraries(Floof Bullet)
#Add each submodule manually
add_subdirectory(${Bullet_Dir}/src/BulletSoftBody)
add_subdirectory(${Bullet_Dir}/src/Bullet3Common)
add_subdirectory(${Bullet_Dir}/src/Bullet3Collision)
target_link_libraries(Floof BulletSoftBody Bullet3Common Bullet3Collision)
#pybinding
#find_package(Python)
#find_package(Python COMPONENTS Interpreter Development REQUIRED)
#target_include_directories(Floof PUBLIC ${Python_INCLUDE_DIRS})
#target_link_libraries(Floof ${Python_LIBRARIES})
target_compile_definitions(Floof PRIVATE VERSION_INFO=${EXAMPLE_VERSION_INFO})
set(LIBTYPE STATIC)
add_compile_definitions(AL_LIBTYPE_STATIC)
add_subdirectory(Libs/openal-soft)
target_link_libraries(Floof OpenAL)
add_subdirectory(Libs/entt)
target_link_libraries(Floof EnTT)
set(BUILD_SHARED_LIBS OFF)
set(ASSIMP_BUILD_TESTS OFF)
set(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_FBX_IMPORTER ON CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_OBJ_IMPORTER ON CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_GLTF_IMPORTER ON CACHE BOOL "" FORCE)
add_subdirectory(Libs/assimp)
target_link_libraries(Floof assimp)
set(IMGUI_DIR Libs/imgui)
add_library(IMGUI STATIC)
target_sources(IMGUI
PRIVATE
${IMGUI_DIR}/imgui_demo.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp
${IMGUI_DIR}/imgui.cpp
PRIVATE
${IMGUI_DIR}/backends/imgui_impl_vulkan.cpp
${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
)
target_include_directories(IMGUI
PUBLIC ${IMGUI_DIR}
PUBLIC ${IMGUI_DIR}/backends
PUBLIC ${Vulkan_INCLUDE_DIRS}
PUBLIC Libs/glfw/include
)
target_link_libraries(Floof IMGUI)
target_include_directories(Floof PUBLIC "Libs/HeaderOnly")
#asio
add_compile_definitions(ASIO_STANDALONE)
target_include_directories(Floof PUBLIC "Libs/asio/asio/include")
#if compiled with xcode, not supporting release yet
if(CMAKE_GENERATOR STREQUAL Xcode)
set(CMAKE_CURRENT_BINARY_DIR "Debug/")
endif()
execute_process(
#OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Source/setup.py install
)
#set current binary dir c++ variable
add_compile_definitions(BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}")
add_compile_definitions(SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
#check for imgui file if not set default
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/imgui.ini")
else()
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND
${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/ImguiDefault/imgui.ini
${CMAKE_CURRENT_SOURCE_DIR}/imgui.ini
)
endif()