diff options
author | Brad King <brad.king@kitware.com> | 2019-04-01 14:31:00 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-04-01 14:31:11 (GMT) |
commit | 922480e6f14fa5b248475fb58ab07c3b2ef5befa (patch) | |
tree | 55bac80dcbb435257450ab51217066b52577f4bb /Tests | |
parent | c5eb01d4d412610673c85ca1bf8b9d15c168ab5e (diff) | |
parent | 6d5872a3969b75686ee7d67449581ab723559bf5 (diff) | |
download | CMake-922480e6f14fa5b248475fb58ab07c3b2ef5befa.zip CMake-922480e6f14fa5b248475fb58ab07c3b2ef5befa.tar.gz CMake-922480e6f14fa5b248475fb58ab07c3b2ef5befa.tar.bz2 |
Merge topic 'allow_aliasing_unkown_targets'
6d5872a396 add_library: Now support aliasing unknown import targets
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3148
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt | 16 | ||||
-rw-r--r-- | Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp | 3 |
2 files changed, 15 insertions, 4 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> diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp index 2ee05e2..541ef92 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp @@ -10,7 +10,8 @@ #include "foo.h" #include "list.h" #include "prefix_foo_bar_bat.h" -#include "target.h" +#include "target1.h" +#include "target2.h" #include "ting.h" int main(int, char**) |