-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
121 lines (99 loc) · 3.9 KB
/
CMakeLists.txt
File metadata and controls
121 lines (99 loc) · 3.9 KB
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
##===------------------------------------------------------------------------------*- CMake -*-===##
## _____ _
## / ____| (_)
## | (___ ___ __ _ _ _ ___ _ __ _
## \___ \ / _ \/ _` | | | |/ _ \| |/ _` |
## ____) | __/ (_| | |_| | (_) | | (_| |
## |_____/ \___|\__, |\__,_|\___/|_|\__,_| - Game Engine (2016-2017)
## | |
## |_|
##
## This file is distributed under the MIT License (MIT).
## See LICENSE.txt for details.
##
##===------------------------------------------------------------------------------------------===##
# Default build type: RelWithDebInfo
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo." FORCE)
endif()
if(DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
endif()
# Default library mode: static
if(NOT BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries." FORCE)
endif()
# Default installation path: <build-dir>/install
if(NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE STRING
"Install path prefix, prepended onto install directories." FORCE)
endif()
project(Sequoia C CXX)
cmake_minimum_required(VERSION 3.5)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# Initialize sequoia-cmake
include(SequoiaCMakeInit)
sequoia_cmake_init()
include(SequoiaAddTargetCleanAll)
include(SequoiaAppendAndExportVariable)
include(SequoiaCheckInSourceBuild)
include(SequoiaGetArchitectureInfo)
include(SequoiaGetCompilerInfo)
include(SequoiaGetPlatformInfo)
include(SequoiaMakeStringPair)
include(SequoiaReportResult)
include(SequoiaSetAndExportVariable)
# Include all options (from all subprojects)
include(SequoiaOptions)
sequoia_get_compiler_info()
sequoia_get_platform_info()
sequoia_get_architecture_info()
# Prevent in source builds
sequoia_check_in_source_build()
# Add custom targets
sequoia_add_target_clean_all(
"${CMAKE_BINARY_DIR}/install"
"${CMAKE_BINARY_DIR}/prefix"
"${CMAKE_BINARY_DIR}/sequoia-cmake"
"${CMAKE_BINARY_DIR}/sequoia-docs"
"${CMAKE_BINARY_DIR}/sequoia-engine"
"${CMAKE_BINARY_DIR}/sequoia-examples"
"${CMAKE_BINARY_DIR}/SequoiaEngine-prefix"
"${CMAKE_BINARY_DIR}/SequoiaExamples-prefix"
"${CMAKE_BINARY_DIR}/SequoiaDocs-prefix"
"${CMAKE_BINARY_DIR}/thirdparty"
)
# Output summary of the configuration
macro(make_config_string FIRST SECOND)
sequoia_make_string_pair(${FIRST} ": ${SECOND}" 20 out)
list(APPEND config_info ${out})
endmacro()
make_config_string("Platform" ${SEQUOIA_PLATFORM_STRING})
make_config_string("Architecture" ${SEQUOIA_ARCHITECTURE_STRING})
make_config_string("Compiler" ${SEQUOIA_COMPILER_STRING})
make_config_string("Build type" ${CMAKE_BUILD_TYPE})
make_config_string("Install directory" ${CMAKE_INSTALL_PREFIX})
sequoia_report_result("Configuration summary" ${config_info})
# Build all dependencies
set(SEQUOIA_EXTERNAL_CMAKE_ARGS
"-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}"
"-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
"-DCMAKE_CONFIGURATION_TYPES:STRING=${CMAKE_CONFIGURATION_TYPES}"
"-DCMAKE_CXX_COMPILER:PATH=${CMAKE_CXX_COMPILER}"
"-DCMAKE_C_COMPILER:PATH=${CMAKE_C_COMPILER}"
)
set(SEQUOIA_EXTERNAL_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/prefix")
set(SEQUOIA_EXTERNAL_PREFIX_PATH "${CMAKE_PREFIX_PATH}")
include(SequoiaSetDownloadDir)
sequoia_set_download_dir(SEQUOIA_EXTERNAL_DOWNLOAD_DIR)
add_subdirectory(thirdparty)
# Build the sequoia projects
include(External_SequoiaEngine)
include(External_SequoiaExamples)
if(SEQUOIA_QT5_FOUND)
include(External_SequoiaEditor)
endif()
if(SEQUOIA_DOCS)
include(External_SequoiaDocs)
endif()