diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2018-06-26 14:21:05 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2018-06-27 16:38:36 (GMT) |
commit | cc9f88af53b6dd95d3fc1786166dd05599e2ba91 (patch) | |
tree | 8d5bb84ed7ec6b6757a87f792c81e6ba7a017f99 /Tests/BuildDepends | |
parent | b142b721419f5653b7eeea65c5c899970be58812 (diff) | |
download | CMake-cc9f88af53b6dd95d3fc1786166dd05599e2ba91.zip CMake-cc9f88af53b6dd95d3fc1786166dd05599e2ba91.tar.gz CMake-cc9f88af53b6dd95d3fc1786166dd05599e2ba91.tar.bz2 |
LINK_DEPENDS: add support for property INTERFACE_LINK_DEPENDS
Fixes: #17997
Diffstat (limited to 'Tests/BuildDepends')
-rw-r--r-- | Tests/BuildDepends/CMakeLists.txt | 11 | ||||
-rw-r--r-- | Tests/BuildDepends/Project/CMakeLists.txt | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 3b4ff60..39a5131 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -345,6 +345,17 @@ is not newer than dependency ${TEST_LINK_DEPENDS} ") endif() + + set(linkdep2 ${BuildDepends_BINARY_DIR}/Project/linkdep2${CMAKE_EXECUTABLE_SUFFIX}) + if(${linkdep2} IS_NEWER_THAN ${TEST_LINK_DEPENDS}) + message("INTERFACE_LINK_DEPENDS worked") + else() + message(SEND_ERROR "INTERFACE_LINK_DEPENDS failed. Executable + ${linkdep2} +is not newer than dependency + ${TEST_LINK_DEPENDS} +") + endif() endif() if(EXISTS "${link_depends_no_shared_check_txt}") diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index 127b365..09be3ea 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -107,6 +107,11 @@ set_property( if(TEST_LINK_DEPENDS) add_executable(linkdep linkdep.cxx) set_property(TARGET linkdep PROPERTY LINK_DEPENDS ${TEST_LINK_DEPENDS}) + + add_library(foo_interface INTERFACE) + set_property(TARGET foo_interface PROPERTY INTERFACE_LINK_DEPENDS $<1:${TEST_LINK_DEPENDS}>) + add_executable(linkdep2 linkdep.cxx) + target_link_libraries(linkdep2 PRIVATE foo_interface) endif() add_library(link_depends_no_shared_lib SHARED link_depends_no_shared_lib.c |