From 9b7b782020f695248ca8f293f5bd8f81fa3a8dae Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 11 Jan 2021 08:46:51 +0100 Subject: [PATCH] Fixed cmake error when build type was left unset --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 795cdc2fd..321cfc263 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,10 @@ else() set(EXTRA_MAGICDBS "" CACHE STRING "List of compiled magicdb files separated with a :") endif() -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE FORCE) -endif(NOT CMAKE_BUILD_TYPE) +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Using Release build type as it was left unset" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release") +endif() set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")