CMake: Fill in default configuration in cmake-gui

The Debug configuration is the default, but it is not filled in in cmake-gui.
Do this, and set Debug and Release as available options.

See https://trac.wxwidgets.org/ticket/18438
This commit is contained in:
Maarten Bent 2019-07-19 01:10:12 +02:00
parent 60b0a1fde2
commit 46f01bfe8b

View File

@ -17,6 +17,15 @@ if(NOT CMAKE_CONFIGURATION_TYPES)
endif() endif()
endif() endif()
# https://blog.kitware.com/cmake-and-the-default-build-type/
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(default_build_type "Debug")
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()
if(APPLE AND NOT CMAKE_OSX_DEPLOYMENT_TARGET) if(APPLE AND NOT CMAKE_OSX_DEPLOYMENT_TARGET)
# If no deployment target has been set default to the minimum supported # If no deployment target has been set default to the minimum supported
# OS X version (this has to be set before the first project() call) # OS X version (this has to be set before the first project() call)