summaryrefslogtreecommitdiffstats
path: root/Tests/ConfigSources/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-10-02 18:31:05 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-04 14:39:00 (GMT)
commit9c9e66289acc7f54dfdb518a92b625f5a34c7c2d (patch)
tree9d378288d391e394c059e8acd1e8a4a263b5bb93 /Tests/ConfigSources/CMakeLists.txt
parent395e5f77fcd900b4a7a48eaa2da2e3554b694cf1 (diff)
downloadCMake-9c9e66289acc7f54dfdb518a92b625f5a34c7c2d.zip
CMake-9c9e66289acc7f54dfdb518a92b625f5a34c7c2d.tar.gz
CMake-9c9e66289acc7f54dfdb518a92b625f5a34c7c2d.tar.bz2
Tests: Enable ConfigSources test on every configuration
Revise the test itself to work in all configurations and verify that certain sources are only built by whatever configuration is tested.
Diffstat (limited to 'Tests/ConfigSources/CMakeLists.txt')
-rw-r--r--Tests/ConfigSources/CMakeLists.txt22
1 files changed, 13 insertions, 9 deletions
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt
index 748aad8..f5dd276 100644
--- a/Tests/ConfigSources/CMakeLists.txt
+++ b/Tests/ConfigSources/CMakeLists.txt
@@ -1,17 +1,21 @@
-
cmake_minimum_required(VERSION 3.0)
-
-project(ConfigSources)
+project(ConfigSources CXX)
add_library(iface INTERFACE)
-set_property(TARGET iface PROPERTY INTERFACE_SOURCES
+target_sources(iface INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp"
"$<$<CONFIG:Debug>:${CMAKE_CURRENT_SOURCE_DIR}/iface_debug_src.cpp>"
- "$<$<CONFIG:Release>:${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist.cpp>"
-)
+ "$<$<NOT:$<CONFIG:Debug>>:${CMAKE_CURRENT_SOURCE_DIR}/iface_other_src.cpp>"
+ "$<$<CONFIG:NotAConfig>:${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist.cpp>"
+ )
+target_compile_definitions(iface INTERFACE
+ "$<$<CONFIG:Debug>:CFG_DEBUG>"
+ "$<$<NOT:$<CONFIG:Debug>>:CFG_OTHER>"
+ )
add_executable(ConfigSources
- $<$<CONFIG:Debug>:main.cpp>
- $<$<CONFIG:Release>:does_not_exist.cpp>
-)
+ $<$<CONFIG:Debug>:main_debug.cpp>
+ $<$<NOT:$<CONFIG:Debug>>:main_other.cpp>
+ $<$<CONFIG:NotAConfig>:does_not_exist.cpp>
+ )
target_link_libraries(ConfigSources iface)