From 6d1b841299d2d20a62fe98fa613731120fd51bac Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Thu, 14 Jul 2022 18:51:55 +0200 Subject: [PATCH] Change to default build type if CMAKE_BUILD_TYPE is unknown --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0412ecf..c4d88f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,11 @@ if (NOT is_multi_config) CACHE STRING "Choose the type of build." FORCE ) elseif (NOT CMAKE_BUILD_TYPE IN_LIST allowed_build_types) - message(FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE}") + message(WARNING "Unknown build type '${CMAKE_BUILD_TYPE}'. " + "Defaulting to '${default_build_type}'") + set(CMAKE_BUILD_TYPE "${default_build_type}" + CACHE STRING "Choose the type of build." FORCE + ) endif () endif () -- GitLab