| ... | @@ -5,6 +5,18 @@ if(NOT CMAKE_BUILD_TYPE) | ... | @@ -5,6 +5,18 @@ if(NOT CMAKE_BUILD_TYPE) |
| 5 | "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) | 5 | "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) |
| 6 | endif() | 6 | endif() |
| 7 | | 7 | |
| | 8 | set(_list "Debug;Release;RelWithDebInfo;MinSizeRel") |
| | 9 | list(FIND _list ${CMAKE_BUILD_TYPE} _index) |
| | 10 | if(${_index} EQUAL -1) |
| | 11 | string(REPLACE ";" ", " _list_pretty "${_list}") |
| | 12 | message("::") |
| | 13 | message(":: ERROR: Invalid build type: ${CMAKE_BUILD_TYPE}") |
| | 14 | message("::") |
| | 15 | message(":: valid types: { ${_list_pretty} }") |
| | 16 | message("::") |
| | 17 | message(FATAL_ERROR) |
| | 18 | endif() |
| | 19 | |
| 8 | if(NOT CMAKE_INSTALL_PREFIX) | 20 | if(NOT CMAKE_INSTALL_PREFIX) |
| 9 | set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE STRING | 21 | set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE STRING |
| 10 | "Directory to install zig to" FORCE) | 22 | "Directory to install zig to" FORCE) |