diff options
author | Patrick Stotko <stotko@cs.uni-bonn.de> | 2018-05-11 16:06:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-05-15 14:22:35 (GMT) |
commit | c9349cc1b94a08b4f5ed86a397e72ceed50847dd (patch) | |
tree | d7df775c58c8f2c539e848abf7dc513a6f4d9a20 /Tests/RunCMake/target_link_libraries/SubDirTarget.cmake | |
parent | 743f24bac68010c0157dc0349958e09ed1784f5f (diff) | |
download | CMake-c9349cc1b94a08b4f5ed86a397e72ceed50847dd.zip CMake-c9349cc1b94a08b4f5ed86a397e72ceed50847dd.tar.gz CMake-c9349cc1b94a08b4f5ed86a397e72ceed50847dd.tar.bz2 |
target_link_libraries: Allow use with targets in other directories
Previously the command did not allow naming targets on the LHS that
were not created in the calling directory. Lift this restriction to
enable more flexible use by projects.
Fixes: #17943
Diffstat (limited to 'Tests/RunCMake/target_link_libraries/SubDirTarget.cmake')
-rw-r--r-- | Tests/RunCMake/target_link_libraries/SubDirTarget.cmake | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget.cmake b/Tests/RunCMake/target_link_libraries/SubDirTarget.cmake index 32431ce..55c658d 100644 --- a/Tests/RunCMake/target_link_libraries/SubDirTarget.cmake +++ b/Tests/RunCMake/target_link_libraries/SubDirTarget.cmake @@ -1,3 +1,11 @@ enable_language(C) + +add_executable(mainexe empty.c) +add_library(mainlib empty.c) + add_subdirectory(SubDirTarget) -target_link_libraries(subexe m) + +target_link_libraries(subexe mainlib) +target_link_libraries(subexe sublib) +get_property(subexe_libs TARGET subexe PROPERTY INTERFACE_LINK_LIBRARIES) +message(STATUS "subexe: ${subexe_libs}") |