From 570eb41e8ba7cb64837af57e5d50a94e45f02446 Mon Sep 17 00:00:00 2001 From: tt4g Date: Mon, 30 Jan 2023 08:16:31 +0900 Subject: [PATCH] Fixed how to get `GENERATOR_IS_MULTI_CONFIG` `GENERATOR_IS_MULTI_CONFIG` is a global property, not a variable. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7660f0b6..cfde37bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,9 +24,10 @@ if(NOT "${CMAKE_BUILD_TYPE}" MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel) message(FATAL_ERROR "Please re-run CMake, specifying -DCMAKE_BUILD_TYPE=Debug , -DCMAKE_BUILD_TYPE=Release , -DCMAKE_BUILD_TYPE=RelWithDebInfo or -DCMAKE_BUILD_TYPE=MinSizeRel .") endif() +get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) option(FRUIT_ALLOW_MULTI_CONFIG "Allow multi-configuration generator. If this option is OFF, enforces that a single configuration is used." OFF) if(FRUIT_ALLOW_MULTI_CONFIG) - if(GENERATOR_IS_MULTI_CONFIG) + if(isMultiConfig) message(STATUS "${CMAKE_PROJECT_NAME} supports the CMake multi-configuration generator," " but is optimized for the `CMAKE_BUILD_TYPE` specified in the CMake configuration step," " and tests will only work in this configuration.")