GENERATOR_IS_MULTI_CONFIG is always true, even when using single-config generators
Description
GENERATOR_IS_MULTI_CONFIG
does not work as expected. It is always 1
even with single-config generators such as "Ninja" or "Unix Makefiles".
In addition, it is not clear form the current documentation that this is not defined at configure-time, only at generator-time.
Minimal example
CML file
cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
project(foo)
message(STATUS "Is multi-config? ${GENERATOR_IS_MULTI_CONFIG}")
file(GENERATE OUTPUT "${CMAKE_SOURCE_DIR}/test.txt" CONTENT "$<BOOL:GENERATOR_IS_MULTI_CONFIG>")
Command line
cmake -S . -B build -G "Unix Makefiles"
(or -G "Ninja"
, for instance)
Results
-
cat test.txt
outputs1
instead of0
- The
message()
call outputs-- Is multi-config?
with no trailing0
or1
at configure-time. Not sure if this is expected or not, but if it is, it should be mentioned in the docs.