diff options
author | Brad King <brad.king@kitware.com> | 2022-04-01 17:20:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-04-01 17:59:51 (GMT) |
commit | 6d34cc3cb8062647030df9bf7a890615844d3d8f (patch) | |
tree | b572bb4653b4624c6f7095d4ea04dd9576fa0f11 /Tests/ExportImport/Export | |
parent | 6e1be5dbefab3e7317502e3d0fe4b132d0162ae5 (diff) | |
download | CMake-6d34cc3cb8062647030df9bf7a890615844d3d8f.zip CMake-6d34cc3cb8062647030df9bf7a890615844d3d8f.tar.gz CMake-6d34cc3cb8062647030df9bf7a890615844d3d8f.tar.bz2 |
export: Fix TARGET_NAME lookup for out-of-dir linking
Improve the logic added by commit f0e67da061 (target_link_libraries: Fix
out-of-dir linking of a list of targets, 2020-01-14, v3.17.0-rc1~149^2)
to, while exporting targets, look up referenced target names in the
correct directory.
Diffstat (limited to 'Tests/ExportImport/Export')
-rw-r--r-- | Tests/ExportImport/Export/SubDirLinkA/CMakeLists.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Tests/ExportImport/Export/SubDirLinkA/CMakeLists.txt b/Tests/ExportImport/Export/SubDirLinkA/CMakeLists.txt index 1aa41d2..ccba264 100644 --- a/Tests/ExportImport/Export/SubDirLinkA/CMakeLists.txt +++ b/Tests/ExportImport/Export/SubDirLinkA/CMakeLists.txt @@ -1,6 +1,9 @@ add_library(SubDirLinkAImported IMPORTED INTERFACE) target_compile_definitions(SubDirLinkAImported INTERFACE DEF_SubDirLinkAImportedForExport) -target_link_libraries(TopDirLib PUBLIC debug "$<1:SubDirLinkAImported;SubDirLinkAImported>" optimized "$<1:SubDirLinkAImported;SubDirLinkAImported>") +target_link_libraries(TopDirLib PUBLIC + debug "$<1:$<TARGET_NAME:SubDirLinkAImported>;$<TARGET_NAME:SubDirLinkAImported>>" + optimized "$<1:$<TARGET_NAME:SubDirLinkAImported>;$<TARGET_NAME:SubDirLinkAImported>>" +) add_library(SubDirLinkA STATIC SubDirLinkA.c) |