| 1 |
# Set a default build type if none was specified |
| 2 |
set(default_build_type "Release") |
| 3 |
if(EXISTS "${CMAKE_SOURCE_DIR}/.git") |
| 4 |
set(default_build_type "Debug") |
| 5 |
endif() |
| 6 |
|
| 7 |
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) |
| 8 |
message(STATUS "Setting build type to '${default_build_type}' as none was specified.") |
| 9 |
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE |
| 10 |
STRING "Choose the type of build." FORCE) |
| 11 |
# Set the possible values of build type for cmake-gui |
| 12 |
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS |
| 13 |
"Debug" "Release" "MinSizeRel" "RelWithDebInfo") |
| 14 |
endif() |
| 15 |
|