diff options
author | Brad King <brad.king@kitware.com> | 2020-05-19 13:54:07 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-05-19 13:56:48 (GMT) |
commit | 2f3a356ea8dd8305ce4360c1652e2e5abfa9f1cf (patch) | |
tree | 0df2aab1804015383f60cb7a86e9e4c784743ccf /Tests | |
parent | e14894c4f71d3c46409843ade362e12d639df4a6 (diff) | |
parent | 70c85c1d6f7499acfc837897b54e81f89ca9ec70 (diff) | |
download | CMake-2f3a356ea8dd8305ce4360c1652e2e5abfa9f1cf.zip CMake-2f3a356ea8dd8305ce4360c1652e2e5abfa9f1cf.tar.gz CMake-2f3a356ea8dd8305ce4360c1652e2e5abfa9f1cf.tar.bz2 |
Merge topic 'src-named-for-config'
70c85c1d6f Tests: Add case for source files named with CONFIG genex
3b547e2e4b VS: Simplify logic adding source file C/C++ language flag to MSVC
27ead9d4b7 VS: Compute managed type from an existing configuration
1222327c89 VS: Write custom commands for sources from all configurations
65fe58a4b4 cmVisualStudio10TargetGenerator: Adopt Windows Store and Phone infrastructure
3fa3b7a402 cmGeneratorTarget: Remove default config from Get* methods
d6a88d2158 cmTarget: Replace "perConfig" constructor boolean with enum
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4761
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/ConfigSources/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt index c5f9c50..6e69e8b 100644 --- a/Tests/ConfigSources/CMakeLists.txt +++ b/Tests/ConfigSources/CMakeLists.txt @@ -5,6 +5,12 @@ if(NOT _isMultiConfig AND NOT CMAKE_BUILD_TYPE) endif() project(ConfigSources CXX) +# Source file(s) named with the configuration(s). +file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/config_$<CONFIG>.cpp" + CONTENT "void config_$<CONFIG>() {}\n" + ) + # Per-config sources via INTERFACE_SOURCES. add_library(iface INTERFACE) target_sources(iface INTERFACE @@ -21,6 +27,7 @@ add_executable(ConfigSources $<$<CONFIG:Debug>:main_debug.cpp> $<$<NOT:$<CONFIG:Debug>>:main_other.cpp> $<$<CONFIG:NotAConfig>:does_not_exist.cpp> + ${CMAKE_CURRENT_BINARY_DIR}/config_$<CONFIG>.cpp ) target_link_libraries(ConfigSources iface) |