summaryrefslogtreecommitdiffstats
path: root/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-03-26 12:25:00 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2019-03-26 19:54:48 (GMT)
commit6d5872a3969b75686ee7d67449581ab723559bf5 (patch)
treea60baab406470a3828d54a2d07a4cb56f52374ef /Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
parent9fbad8b40be8e915f84f51842d88e97b0c949b2b (diff)
downloadCMake-6d5872a3969b75686ee7d67449581ab723559bf5.zip
CMake-6d5872a3969b75686ee7d67449581ab723559bf5.tar.gz
CMake-6d5872a3969b75686ee7d67449581ab723559bf5.tar.bz2
add_library: Now support aliasing unknown import targets
Fixes #18327
Diffstat (limited to 'Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt')
-rw-r--r--Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt16
1 files changed, 13 insertions, 3 deletions
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index 5b99ea7..a9edf9a 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -17,7 +17,8 @@ create_header(bing)
create_header(bung)
create_header(arguments)
create_header(list)
-create_header(target)
+create_header(target1)
+create_header(target2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -69,14 +70,23 @@ set_property(TARGET lib4 APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BI
set_property(TARGET lib4 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foh;$<TARGET_PROPERTY:lib3,INTERFACE_INCLUDE_DIRECTORIES>")
add_library(somelib::withcolons UNKNOWN IMPORTED)
-set_property(TARGET somelib::withcolons PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/target")
-set_property(TARGET somelib::withcolons PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/target")
+set_property(TARGET somelib::withcolons PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/target1")
+set_property(TARGET somelib::withcolons PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/target1")
set_property(TARGET TargetIncludeDirectories
APPEND PROPERTY INCLUDE_DIRECTORIES
"$<TARGET_PROPERTY:somelib::withcolons,INTERFACE_INCLUDE_DIRECTORIES>"
)
+add_library(somelib_aliased UNKNOWN IMPORTED GLOBAL)
+set_property(TARGET somelib_aliased PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/target2")
+add_library(somelib::withcolons2 ALIAS somelib_aliased)
+
+set_property(TARGET TargetIncludeDirectories
+ APPEND PROPERTY INCLUDE_DIRECTORIES
+ "$<TARGET_PROPERTY:somelib::withcolons2,INTERFACE_INCLUDE_DIRECTORIES>"
+)
+
add_custom_target(test_custom_target
"some_bogus_custom_tool"
$<TARGET_PROPERTY:TargetIncludeDirectories,COMPILE_DEFINITIONS>