diff options
author | Brad King <brad.king@kitware.com> | 2020-03-31 13:19:34 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-03-31 13:19:42 (GMT) |
commit | 69c8bf69670c32643690a3359876952fa425f846 (patch) | |
tree | 40da2f65e51c1550c07e22e95d63f182e7e547e8 /Tests | |
parent | 76f08a107b344daff524974868ab30353bd9b255 (diff) | |
parent | 2af18704fd85046362eec3671ffdc9161379a9c2 (diff) | |
download | CMake-69c8bf69670c32643690a3359876952fa425f846.zip CMake-69c8bf69670c32643690a3359876952fa425f846.tar.gz CMake-69c8bf69670c32643690a3359876952fa425f846.tar.bz2 |
Merge topic 'link-libs-config-case' into release-3.17
2af18704fd Merge branch 'backport-3.16-link-libs-config-case'
3f976bf201 target_link_libraries: Fix regression in case of $<CONFIG> genex
5a95b5e091 target_link_libraries: Fix regression in case of $<CONFIG> genex
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4544
Diffstat (limited to 'Tests')
4 files changed, 28 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_link_libraries/ConfigCase-result.txt b/Tests/RunCMake/target_link_libraries/ConfigCase-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/ConfigCase-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_link_libraries/ConfigCase-stderr.txt b/Tests/RunCMake/target_link_libraries/ConfigCase-stderr.txt new file mode 100644 index 0000000..953c972 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/ConfigCase-stderr.txt @@ -0,0 +1,13 @@ +^CMake Error at ConfigCase.cmake:[0-9]+ \(add_library\): + Target "impl" links to target "config::impl-Debug" but the target was not + found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or + an ALIAS target is missing\? +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at ConfigCase.cmake:[0-9]+ \(add_library\): + Target "impl" links to target "config::iface-Debug" but the target was not + found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or + an ALIAS target is missing\? +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_link_libraries/ConfigCase.cmake b/Tests/RunCMake/target_link_libraries/ConfigCase.cmake new file mode 100644 index 0000000..fc39478 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/ConfigCase.cmake @@ -0,0 +1,6 @@ +cmake_policy(VERSION 3.15) +enable_language(C) +add_library(iface INTERFACE) +target_link_libraries(iface INTERFACE "config::iface-$<CONFIG>") +add_library(impl empty.c) +target_link_libraries(impl PRIVATE "config::impl-$<CONFIG>" iface) diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake index 0152d4c..8eed986 100644 --- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake @@ -1,5 +1,13 @@ include(RunCMake) +if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug) +else() + set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug) +endif() +run_cmake(ConfigCase) +unset(RunCMake_TEST_OPTIONS) + run_cmake(CMP0023-WARN) run_cmake(CMP0023-NEW) run_cmake(CMP0023-WARN-2) |