diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-01-30 22:38:04 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-01-31 16:34:20 (GMT) |
commit | 0b92602b816e2584db3781b120a1e5200da72ada (patch) | |
tree | ccf0d78b89d14d2bc317725b81ff3281d8b83ed1 /Tests/CMakeCommands/target_include_directories | |
parent | 0fa7f69c0e2cdcd8b7ece400651ee7821b2ede4b (diff) | |
download | CMake-0b92602b816e2584db3781b120a1e5200da72ada.zip CMake-0b92602b816e2584db3781b120a1e5200da72ada.tar.gz CMake-0b92602b816e2584db3781b120a1e5200da72ada.tar.bz2 |
Add the $<LINKED:...> generator expression.
This is both a short form of using a TARGET_DEFINED expression
together with a TARGET_PROPERTY definition, and a way to strip
non-target content from interface properties when exporting.
Diffstat (limited to 'Tests/CMakeCommands/target_include_directories')
-rw-r--r-- | Tests/CMakeCommands/target_include_directories/CMakeLists.txt | 11 | ||||
-rw-r--r-- | Tests/CMakeCommands/target_include_directories/consumer.cpp | 5 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt index 7529283..a564918 100644 --- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt +++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt @@ -17,6 +17,9 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/poison/common.h" "#error Should not be i file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/cure") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cure/common.h" "#define CURE_DEFINE\n") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/linkedinclude") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/linkedinclude/linkedinclude.h" "#define LINKEDINCLUDE_DEFINE\n") + add_executable(target_include_directories "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" ) @@ -42,7 +45,13 @@ add_executable(consumer "${CMAKE_CURRENT_SOURCE_DIR}/consumer.cpp" ) +add_library(linked UNKNOWN IMPORTED) +set_property(TARGET linked PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/linkedinclude") + target_include_directories(consumer - PRIVATE $<TARGET_PROPERTY:target_include_directories,INTERFACE_INCLUDE_DIRECTORIES> + PRIVATE + $<TARGET_PROPERTY:target_include_directories,INTERFACE_INCLUDE_DIRECTORIES> + $<LINKED:linked> relative_dir ) diff --git a/Tests/CMakeCommands/target_include_directories/consumer.cpp b/Tests/CMakeCommands/target_include_directories/consumer.cpp index 82b800a..ccffd9c 100644 --- a/Tests/CMakeCommands/target_include_directories/consumer.cpp +++ b/Tests/CMakeCommands/target_include_directories/consumer.cpp @@ -3,6 +3,7 @@ #include "publicinclude.h" #include "interfaceinclude.h" #include "relative_dir.h" +#include "linkedinclude.h" #ifdef PRIVATEINCLUDE_DEFINE #error Unexpected PRIVATEINCLUDE_DEFINE @@ -24,4 +25,8 @@ #error Expected RELATIVE_DIR_DEFINE #endif +#ifndef LINKEDINCLUDE_DEFINE +#error Expected LINKEDINCLUDE_DEFINE +#endif + int main() { return 0; } |