/
Config.cmake
75 lines (62 loc) · 2.26 KB
/
Config.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
# Doomsday Engine -- General configuration
#
# All CMakeLists should include this file to gain access to the overall
# project configuration.
if (POLICY CMP0068)
cmake_policy (SET CMP0068 OLD) # macOS: RPATH affects install_name
endif ()
if (POLICY CMP0079)
cmake_policy (SET CMP0079 NEW)
endif ()
get_filename_component (_where "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
message (STATUS "Configuring ${_where}...")
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
include (${CMAKE_CURRENT_LIST_DIR}/Directories.cmake)
include (Macros)
include (Arch)
include (BuildTypes)
include (InstallPrefix)
include (Version)
find_package (Ccache)
include (Options)
include (Packaging)
set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "client")
# Prefix path is used for finding CMake config packages.
if (NOT DE_SDK_DIR STREQUAL "")
list (APPEND CMAKE_PREFIX_PATH "${DE_SDK_DIR}/${DE_INSTALL_LIB_DIR}")
endif ()
list (APPEND CMAKE_PREFIX_PATH "${DE_DEPENDS_DIR}/products")
list (APPEND CMAKE_MODULE_PATH "${DE_DEPENDS_DIR}/products/lib/cmake/assimp-4.1")
# Platform-Specific Configuration --------------------------------------------
if (MSYS)
include (PlatformMsys)
elseif (CYGWIN)
include (PlatformCygwin)
elseif (IOS)
include (PlatformiOS)
elseif (APPLE)
include (PlatformMacx)
elseif (WIN32)
include (PlatformWindows)
else ()
include (PlatformUnix)
endif ()
# Helpers --------------------------------------------------------------------
# CMake 3.12 adds a better Python finder, but older OS distros like Fedora 23
# only come with older versions, and we don't want to require manually
# installing a newer CMake.
find_program (PYTHON_EXECUTABLE python3 HINTS "${PYTHON_DIR}")
find_program (PYTHON_EXECUTABLE python HINTS "${PYTHON_DIR}")
if (NOT PYTHON_EXECUTABLE)
message (FATAL_ERROR "Python 3 required; did not found a python on the path (set PYTHON_DIR)")
endif ()
execute_process (COMMAND ${PYTHON_EXECUTABLE} --version OUTPUT_VARIABLE pythonVer)
string (REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" pythonVer ${pythonVer})
#message (STATUS "Found Python: ${PYTHON_EXECUTABLE} (version: ${pythonVer})")
if (pythonVer VERSION_LESS 3)
message (FATAL_ERROR "Python 3 required; found ${pythonVer}")
endif ()
if (DE_ENABLE_COTIRE)
include (cotire)
endif ()
include (LegacyPK3s)