-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathForgeBuildType.cmake
More file actions
29 lines (27 loc) · 1.01 KB
/
Copy pathForgeBuildType.cmake
File metadata and controls
29 lines (27 loc) · 1.01 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
# CMake 3.9 or later provides a global property to whether we are multi-config
# or single-config generator. Before 3.9, the defintion of
# CMAKE_CONFIGURATION_TYPES variable indicated multi-config, but developers
# might modify.
if(NOT CMAKE_VERSION VERSION_LESS 3.9)
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
elseif(CMAKE_CONFIGURATION_TYPES)
# CMAKE_CONFIGURATION_TYPES is set by project() call
set(isMultiConfig True)
else()
set(isMultiConfig False)
endif()
if(isMultiConfig)
set(CMAKE_CONFIGURATION_TYPES "Debug;MinSizeRel;Release;RelWithDebInfo"
CACHE STRING "Configurations for Multi-Config CMake Generator" FORCE)
else()
set(default_build_type "Release")
if(EXISTS "${Forge_SOURCE_DIR}/.git")
set(default_build_type "Debug")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build Type" FORCE)
endif()
set_property(CACHE CMAKE_BUILD_TYPE
PROPERTY
STRINGS "Debug" "MinSizeRel" "Release" "RelWithDebInfo")
endif()