Files
CMake/Tests/RunCMake/NinjaMultiConfig/ExcludeFromAll.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

13 lines
459 B
CMake

enable_language(C)
set(CMAKE_CONFIGURATION_TYPES "Release;Debug" CACHE STRING "")
set(CMAKE_DEFAULT_BUILD_TYPE "Release" CACHE STRING "")
set(CMAKE_CROSS_CONFIGS "all" CACHE STRING "")
set(CMAKE_DEFAULT_CONFIGS "all" CACHE STRING "")
add_executable(release_only_tool main.c)
set_property(TARGET release_only_tool PROPERTY EXCLUDE_FROM_ALL "$<NOT:$<CONFIG:Release>>")
include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
generate_output_files(release_only_tool)