From 7d4e61dcf5d11f5d27ee0aaa56d279f3ce2aa473 Mon Sep 17 00:00:00 2001 From: Lukas Nellen <lukas@nucleares.unam.mx> Date: Thu, 16 May 2019 14:56:29 -0500 Subject: [PATCH] Always set list of valid build types (for ccmake, gui) --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1871368f..114048b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,14 +39,14 @@ if (EXISTS "${CMAKE_SOURCE_DIR}/.git") set (default_build_type "Debug") endif () -set (allowed_build_types "Debug;Release;MinSizeRel;RelWithDebInfo;Coverage") +# Set the possible values of build type for cmake-gui and command line check +set (allowed_build_types Debug Release MinSizeRel RelWithDebInfo Coverage) +set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${allowed_build_types}) if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message (STATUS "Setting build type to '${default_build_type}' as no other 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 ${allowed_build_types}) else (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) # Ignore capitalization when build type is selected manually and check for valid setting string(TOLOWER ${CMAKE_BUILD_TYPE} selected_lower) -- GitLab