-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
119 lines (90 loc) · 3.23 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
#Godot buildsystem via Cmake
#Read README.md for details
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
####################################
#Step 1: Get options and set base directories
####################################
option(GODOT_ENGINE_ROOT_DIRECTORY "Set the absolute directory path to base building from")
if(GODOT_ENGINE_ROOT_DIRECTORY STREQUAL "")
message(FATAL_ERROR "Missing GodotEngine root directory path")
endif()
option(GODOT_EXTERNAL_EDITOR_MODULES "Target names that should be linked into the editor")
option(GODOT_EXTERNAL_RUNTIME_MODULES "Target names that should be linked into runtimes (including the editor)")
set(CMAKE_BINARY_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
set(GODOT_SOURCE_ROOT_THIRDPARTY_DIR ${GODOT_ENGINE_ROOT_DIRECTORY}/thirdparty)
set(GODOT_MODULES_BASE_DIR ${GODOT_ENGINE_ROOT_DIRECTORY}/modules)
####################################
#Step 2: Add any custom modules
####################################
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
#Find required tools
find_package(Python3 COMPONENTS Interpreter)
message("Found Python3 Interpreter: ${Python3_EXECUTABLE}")
include(GodotGenerators.cmake)
include(Godot.cmake)
####################################
#Step 3: Set some basic common locations
####################################
####################################
#Step 4: Generate the actual project
####################################
set(GODOT_ROOT_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
#These are used to collect all the library targets in a list
set(GODOT_LIBRARIES CACHE STRING "All the godot library targets" FORCE)
#Bring in the base operating system platform
set(GODOT_SOURCE_ROOT_PLATFORM_DIR ${GODOT_ENGINE_ROOT_DIRECTORY}/platform)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
include(LinuxPlatform.cmake)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
include(WindowsPlatform.cmake)
endif()
# *Platform.cmake files define what packages are wanted
if (${WANT_VULKAN})
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(Vulkan)
else()
# Windows relies on Volk alone.
set(VULKAN_FOUND 1)
endif()
endif()
if (${WANT_OPENGL})
find_package(OpenGL)
endif()
if (${WANT_DBUS})
find_package(DBUS)
endif()
if (${WANT_ALSA})
find_package(ALSA)
endif()
if (${WANT_PULSEAUDIO})
find_package(PulseAudio)
endif()
if (${WANT_X11})
find_package(X11)
endif()
if (${WANT_FONTCONFIG})
find_package(Fontconfig)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_subdirectory(${GODOT_ROOT_CMAKE_DIR}/platform/linux)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_subdirectory(${GODOT_ROOT_CMAKE_DIR}/platform/windows)
endif()
#Bring in the third party libraries
add_subdirectory(${GODOT_ROOT_CMAKE_DIR}/thirdparty)
#Bring in the component drivers
add_subdirectory(${GODOT_ROOT_CMAKE_DIR}/drivers)
#Bring in the core
add_subdirectory(${GODOT_ROOT_CMAKE_DIR}/core)
#Bring in the server (aka game components)
add_subdirectory(${GODOT_ROOT_CMAKE_DIR}/servers)
#Bring in the scene system
add_subdirectory(${GODOT_ROOT_CMAKE_DIR}/scene)
#Get all the engine modules together
add_subdirectory(${GODOT_ROOT_CMAKE_DIR}/modules)
#Get all the engine modules together
add_subdirectory(${GODOT_ROOT_CMAKE_DIR}/editor)
#And the start of the show
add_subdirectory(${GODOT_ROOT_CMAKE_DIR}/main)