IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 1f0b280d authored by Lukas Nellen's avatar Lukas Nellen :footprints: Committed by Hans Dembinski
Browse files

Simplify: use "IN_LIST" condition

parent 7d4e61dc
No related branches found
No related tags found
No related merge requests found
...@@ -49,15 +49,9 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) ...@@ -49,15 +49,9 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
STRING "Choose the type of build." FORCE) STRING "Choose the type of build." FORCE)
else (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) else (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
# Ignore capitalization when build type is selected manually and check for valid setting # Ignore capitalization when build type is selected manually and check for valid setting
string(TOLOWER ${CMAKE_BUILD_TYPE} selected_lower) string (TOLOWER ${CMAKE_BUILD_TYPE} selected_lower)
foreach(build ${allowed_build_types}) string (TOLOWER "${allowed_build_types}" build_types_lower)
string(TOLOWER ${build} build_lower) if (NOT selected_lower IN_LIST build_types_lower)
if (build_lower STREQUAL selected_lower)
set (CMAKE_BUILD_TYPE ${build})
set (build_type_found True)
endif()
endforeach()
if (NOT build_type_found)
message (FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE} [allowed: ${allowed_build_types}]") message (FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE} [allowed: ${allowed_build_types}]")
endif () endif ()
message (STATUS "Build type is: ${CMAKE_BUILD_TYPE}") message (STATUS "Build type is: ${CMAKE_BUILD_TYPE}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment