| ... | @@ -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) |
| 6 | endif() | 6 | endif() |
| 7 | | 7 | |
| 8 | set(_list "None;Debug;Release;RelWithDebInfo;MinSizeRel") | 8 | set(_list "Debug;Release;RelWithDebInfo;MinSizeRel") |
| 9 | list(FIND _list ${CMAKE_BUILD_TYPE} _index) | 9 | string(TOLOWER "${_list}" _list_lower) |
| 10 | if(${_index} EQUAL -1) | 10 | string(TOLOWER ${CMAKE_BUILD_TYPE} _build_type_lower) |
| 11 | string(REPLACE ";" ", " _list_pretty "${_list}") | 11 | list(FIND _list_lower "${_build_type_lower}" _index) |
| 12 | message("::") | 12 | if(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() |
| 18 | endif() | 23 | endif() |
| 19 | | 24 | |
| 20 | if(NOT CMAKE_INSTALL_PREFIX) | 25 | if(NOT CMAKE_INSTALL_PREFIX) |