diff options
author | Brad King <brad.king@kitware.com> | 2013-01-08 19:32:41 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-01-08 19:32:41 (GMT) |
commit | a9f1bf438054227e989ad1706b785b978e18455c (patch) | |
tree | 1080f95c4292fe6a57e6341a15072694e24bbbe5 /Tests/CMakeCommands/target_link_libraries | |
parent | e41d4951b366cd34a1fd5129deb7e61e906db6ec (diff) | |
parent | 765386279815f208c5f83b1ad2b66776e990feb9 (diff) | |
download | CMake-a9f1bf438054227e989ad1706b785b978e18455c.zip CMake-a9f1bf438054227e989ad1706b785b978e18455c.tar.gz CMake-a9f1bf438054227e989ad1706b785b978e18455c.tar.bz2 |
Merge topic 'LINK_LIBRARIES-property'
7653862 Add LINK_LIBRARIES property for direct target link dependencies
40cf3fb Make linking APIs aware of 'head' target
Diffstat (limited to 'Tests/CMakeCommands/target_link_libraries')
4 files changed, 31 insertions, 1 deletions
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt index 29b69d9..6ffef3f 100644 --- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt +++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt @@ -34,6 +34,13 @@ generate_export_header(depB) target_link_libraries(depB LINK_PRIVATE depA) +add_library(libgenex SHARED libgenex.cpp) +generate_export_header(libgenex) + +set_property(TARGET depB APPEND PROPERTY + LINK_LIBRARIES $<1:libgenex> +) + add_library(depC SHARED depC.cpp) generate_export_header(depC) diff --git a/Tests/CMakeCommands/target_link_libraries/depB.cpp b/Tests/CMakeCommands/target_link_libraries/depB.cpp index 1bbe38b..4f46552 100644 --- a/Tests/CMakeCommands/target_link_libraries/depB.cpp +++ b/Tests/CMakeCommands/target_link_libraries/depB.cpp @@ -3,9 +3,13 @@ #include "depA.h" +#include "libgenex.h" + int DepB::foo() { DepA a; - return a.foo(); + LibGenex lg; + + return a.foo() + lg.foo(); } diff --git a/Tests/CMakeCommands/target_link_libraries/libgenex.cpp b/Tests/CMakeCommands/target_link_libraries/libgenex.cpp new file mode 100644 index 0000000..c925c08 --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/libgenex.cpp @@ -0,0 +1,7 @@ + +#include "libgenex.h" + +int LibGenex::foo() +{ + return 0; +} diff --git a/Tests/CMakeCommands/target_link_libraries/libgenex.h b/Tests/CMakeCommands/target_link_libraries/libgenex.h new file mode 100644 index 0000000..733f9b6 --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/libgenex.h @@ -0,0 +1,12 @@ + +#include "libgenex_export.h" + +#ifndef LIBGENEX_H +#define LIBGENEX_H + +struct LIBGENEX_EXPORT LibGenex +{ + int foo(); +}; + +#endif |