From 1226919b165b81a0d9973c1da7b6142590eea127 Mon Sep 17 00:00:00 2001 From: Pauli Date: Sun, 8 Jul 2018 13:32:24 +0300 Subject: [PATCH] Fix the CMAKE_BUILD_TYPE help string and make it list of strings in gui While testing the build dependency issues I noticed that cmake C module overwrites our CMAKE_BUILD_TYPE help. I decided to fix the help and make the build type a gui string which makes it easier to select build configuration. --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d6118c65..562c10fca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,12 +2,16 @@ # Set up build types if(CMAKE_CONFIGURATION_TYPES) - SET(CMAKE_CONFIGURATION_TYPES Release RelWithDebInfo) - SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "List of supported configuration types" FORCE) + SET(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo" CACHE STRING "List of supported configuration types" FORCE) else(CMAKE_CONFIGURATION_TYPES) + set(DFHACK_TYPE_HELP "Choose the type of build, options are: Release and RelWithDebInfo") + # Prevent cmake C module attempts to overwrite our help string if (NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Release RelWithDebInfo.") + SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "${DFHACK_TYPE_HELP}") + else (NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "${DFHACK_TYPE_HELP}") endif (NOT CMAKE_BUILD_TYPE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release;RelWithDebInfo") endif(CMAKE_CONFIGURATION_TYPES) OPTION(BUILD_DOCS "Choose whether to build the documentation (requires python and Sphinx)." OFF)