diff options
author | Brad King <brad.king@kitware.com> | 2013-01-08 19:32:28 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-01-08 19:32:28 (GMT) |
commit | 6095e9fda68810a98be23750b7a0765967d12679 (patch) | |
tree | 54267656062921225eea67aa903ed846d6b076b3 /Tests | |
parent | bc414aebaf80cf7a5c67e79e1a5d1f4417164263 (diff) | |
parent | 9ce1b9ef2946ead0605e766c7dcf1302fe122f3a (diff) | |
download | CMake-6095e9fda68810a98be23750b7a0765967d12679.zip CMake-6095e9fda68810a98be23750b7a0765967d12679.tar.gz CMake-6095e9fda68810a98be23750b7a0765967d12679.tar.bz2 |
Merge topic 'include-dirs-convenience'
9ce1b9e Add CMAKE_BUILD_INTERFACE_INCLUDES build-variable.
Diffstat (limited to 'Tests')
5 files changed, 36 insertions, 1 deletions
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt index 60b36fc..29b69d9 100644 --- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt +++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt @@ -53,6 +53,13 @@ set_target_properties(targetA PROPERTIES LINK_INTERFACE_LIBRARIES "") assert_property(targetA LINK_INTERFACE_LIBRARIES "") +add_subdirectory(subdir) +target_link_libraries(targetA subdirlib) +set_property(TARGET targetA APPEND PROPERTY + INCLUDE_DIRECTORIES + $<TARGET_PROPERTY:subdirlib,INTERFACE_INCLUDE_DIRECTORIES> +) + target_link_libraries(targetA depB depC) assert_property(targetA LINK_INTERFACE_LIBRARIES "") diff --git a/Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt new file mode 100644 index 0000000..61a1a59 --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt @@ -0,0 +1,5 @@ + +set(CMAKE_BUILD_INTERFACE_INCLUDES ON) + +add_library(subdirlib SHARED subdirlib.cpp) +generate_export_header(subdirlib) diff --git a/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.cpp b/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.cpp new file mode 100644 index 0000000..cd2f1a2 --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.cpp @@ -0,0 +1,7 @@ + +#include "subdirlib.h" + +int SubDirLibObject::foo() const +{ + return 0; +} diff --git a/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.h b/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.h new file mode 100644 index 0000000..e386f87 --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.h @@ -0,0 +1,12 @@ + +#ifndef SUBDIRLIB_H +#define SUBDIRLIB_H + +#include "subdirlib_export.h" + +struct SUBDIRLIB_EXPORT SubDirLibObject +{ + int foo() const; +}; + +#endif diff --git a/Tests/CMakeCommands/target_link_libraries/targetA.cpp b/Tests/CMakeCommands/target_link_libraries/targetA.cpp index 6ff65b1..559aef7 100644 --- a/Tests/CMakeCommands/target_link_libraries/targetA.cpp +++ b/Tests/CMakeCommands/target_link_libraries/targetA.cpp @@ -3,6 +3,8 @@ #include "depC.h" #include "depIfaceOnly.h" +#include "subdirlib.h" + int main(int argc, char **argv) { DepA a; @@ -11,5 +13,7 @@ int main(int argc, char **argv) DepIfaceOnly iface_only; - return a.foo() + b.foo() + c.foo() + iface_only.foo(); + SubDirLibObject sd; + + return a.foo() + b.foo() + c.foo() + iface_only.foo() + sd.foo(); } |