diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-31 15:35:44 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-31 15:59:45 +0200 |
commit | 1616d0d8e21450e20390bb1aa93c547079b1e5aa (patch) | |
tree | 308bf1c2eb9dafe94f7ed5ecbea1fdbc72164997 | |
parent | 10bd169bd4e1416c941faa2d5bc6a5be2e2fbfb8 (diff) |
cmake: fix build type not correctly set
It needs to be forced to actually take effect.
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e07ee41..ab4405cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,11 @@ set(CMAKE_SKIP_INSTALL_RPATH FALSE) set(CMAKE_SKIP_RPATH FALSE) if(NOT GENERATOR_IS_MULTI_CONFIG) + if(CMAKE_BUILD_TYPE STREQUAL "") + set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE) + endif() string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "" FORCE) endif() set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) @@ -46,12 +50,6 @@ if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY AND NOT DEFINED CMAKE_LIBRARY_OUTP endif() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/bin") -if(NOT GENERATOR_IS_MULTI_CONFIG) -if(CMAKE_BUILD_TYPE STREQUAL "") - set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE) -endif() -endif() - function(sets type) set(i 0) list(LENGTH ARGN max) @@ -100,6 +98,7 @@ if(NOT "$ENV{FLOORMAT_NO_USERCONFIG}" AND NOT FLOORMAT_NO_USERCONFIG) fm_load_userconfig() if(NOT GENERATOR_IS_MULTI_CONFIG) string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "" FORCE) endif() endif() |