authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2020-02-12 21:04:34-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-02-12 21:04:34-05:00
log1fb70497d24da9c0cb6f0e025948fa40eaaa36af
tree4b7cdefed55f1cfbe3093821f0977c59d2744b6f
parent08666a057ac9738e926df7ac02932043ae2d5997
parent471662f7c94b881821803b4d1379deee5e6d59ae
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #4441 from mikdusan/stage1-cmake

stage1: limit cmake checks on build type

1 files changed, 15 insertions(+), 10 deletions(-)

CMakeLists.txt+15-10
...@@ -5,16 +5,21 @@ if(NOT CMAKE_BUILD_TYPE)...@@ -5,16 +5,21 @@ if(NOT CMAKE_BUILD_TYPE)
5 "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)5 "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
6endif()6endif()
77
8set(_list "None;Debug;Release;RelWithDebInfo;MinSizeRel")8set(_list "Debug;Release;RelWithDebInfo;MinSizeRel")
9list(FIND _list ${CMAKE_BUILD_TYPE} _index)9string(TOLOWER "${_list}" _list_lower)
10if(${_index} EQUAL -1)10string(TOLOWER ${CMAKE_BUILD_TYPE} _build_type_lower)
11 string(REPLACE ";" ", " _list_pretty "${_list}")11list(FIND _list_lower "${_build_type_lower}" _index)
12 message("::")12if(NOT ${_index} EQUAL -1)
13 message(":: ERROR: Invalid build type: ${CMAKE_BUILD_TYPE}")13 list(FIND _list "${CMAKE_BUILD_TYPE}" _index)
14 message("::")14 if(${_index} EQUAL -1)
15 message(":: valid types: { ${_list_pretty} }")15 string(REPLACE ";" ", " _list_pretty "${_list}")
16 message("::")16 message("::")
17 message(FATAL_ERROR)17 message(":: ERROR: build type case-mismatch: ${CMAKE_BUILD_TYPE}")
18 message("::")
19 message(":: valid types: { ${_list_pretty} }")
20 message("::")
21 message(FATAL_ERROR)
22 endif()
18endif()23endif()
1924
20if(NOT CMAKE_INSTALL_PREFIX)25if(NOT CMAKE_INSTALL_PREFIX)