summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeCommands
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-14 18:14:55 (GMT)
committerBrad King <brad.king@kitware.com>2020-01-16 18:24:27 (GMT)
commitf0e67da0615bd746626cab8e4dff2ba60c7aa2fe (patch)
treec27fb29e6b769cc5d501c42758ffd4c0892cec9a /Tests/CMakeCommands
parentacee6291039537a176fef70820648fc3d8cb4fb0 (diff)
downloadCMake-f0e67da0615bd746626cab8e4dff2ba60c7aa2fe.zip
CMake-f0e67da0615bd746626cab8e4dff2ba60c7aa2fe.tar.gz
CMake-f0e67da0615bd746626cab8e4dff2ba60c7aa2fe.tar.bz2
target_link_libraries: Fix out-of-dir linking of a list of targets
In a case like target_link_libraries(targetInOtherDir PUBLIC "$<1:a;b>") then all entries in the list need to be looked up in the caller's scope. Previously our `::@(directory-id)` suffix would apply only to the last entry. Instead surround the entire entry by a pair `::@(directory-id);...;::@` so that the `::@` syntax can encode a directory lookup scope change evaluated as the list is processed. Fixes: #20204
Diffstat (limited to 'Tests/CMakeCommands')
-rw-r--r--Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt
index b430834..06d1111 100644
--- a/Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt
@@ -4,8 +4,9 @@ add_executable(SubDirB SubDirB.c)
# be visible to the directory in which TopDir is defined.
target_link_libraries(TopDir PUBLIC debug SameNameImported optimized SameNameImported)
-#FIXME: Demonstrate known issue #20204.
-#target_link_libraries(TopDir PUBLIC "$<1:SameNameImported;SameNameImported>")
+# Link to a list of targets imported in this directory that would not
+# normally be visible to the directory in which TopDir is defined.
+target_link_libraries(TopDir PUBLIC "$<1:SameNameImported;SameNameImported>")
# Link SubDirA to a target imported in this directory that has the same
# name as a target imported in SubDirA's directory. We verify when