Files
CMake/Tests/RunCMake/ExcludeFromAll/single-config-build-check.cmake
Joerg Bornemann 2cdaf43d96 Allow generator expressions in the EXCLUDE_FROM_ALL target property
This allows for setting EXCLUDE_FROM_ALL, conditional on the build
configuration. However, only the Ninja Multi-Config generator supports
different property values per config. All other multi-config
generators will yield an error in that situation.

Fixes: #20923
2020-07-21 17:16:26 +02:00

18 lines
516 B
CMake

if(expectation STREQUAL "should_not_exist")
set(should_exist FALSE)
elseif(expectation STREQUAL "should_exist")
set(should_exist TRUE)
else()
message(FATAL_ERROR "Encountered unknown expectation: ${expectation}")
endif()
if(EXISTS "${TARGET_FILE_tool_${config}}")
if(NOT should_exist)
message(FATAL_ERROR "${TARGET_FILE_tool_${config}} should not exist.")
endif()
else()
if(should_exist)
message(FATAL_ERROR "${TARGET_FILE_tool_${config}} should exist.")
endif()
endif()