diff options
author | Brad King <brad.king@kitware.com> | 2013-01-30 14:38:52 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-01-30 14:38:52 (GMT) |
commit | da2b0245a380282892be8007f4c3d184a91bcfe0 (patch) | |
tree | ee9c9236f472bc2ec09f22b4c04854c0908cb019 /Tests | |
parent | 7462a8a8c3417e559e54d6de7eef837e2adfd2e6 (diff) | |
parent | 7bf490e9bb6128082aa178f28691b3fc418322fe (diff) | |
download | CMake-da2b0245a380282892be8007f4c3d184a91bcfe0.zip CMake-da2b0245a380282892be8007f4c3d184a91bcfe0.tar.gz CMake-da2b0245a380282892be8007f4c3d184a91bcfe0.tar.bz2 |
Merge topic 'fix-target-property-commands'
7bf490e Make subclasses responsible for joining content.
f6b16d4 Don't allow targets args in the new target commands.
b3a7e19 Make the Property name protected so that subclasses can use it.
Diffstat (limited to 'Tests')
6 files changed, 28 insertions, 8 deletions
diff --git a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt index 3eca7fc..8a4437b 100644 --- a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt +++ b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt @@ -17,7 +17,8 @@ add_executable(consumer ) target_compile_definitions(consumer - PRIVATE target_compile_definitions importedlib + PRIVATE $<TARGET_PROPERTY:target_compile_definitions,INTERFACE_COMPILE_DEFINITIONS> $<$<TARGET_DEFINED:notdefined>:SHOULD_NOT_BE_DEFINED> $<$<TARGET_DEFINED:target_compile_definitions>:SHOULD_BE_DEFINED> + -DDASH_D_DEFINE ) diff --git a/Tests/CMakeCommands/target_compile_definitions/consumer.cpp b/Tests/CMakeCommands/target_compile_definitions/consumer.cpp index f835b6c..1a46aa5 100644 --- a/Tests/CMakeCommands/target_compile_definitions/consumer.cpp +++ b/Tests/CMakeCommands/target_compile_definitions/consumer.cpp @@ -19,4 +19,8 @@ #error Expected SHOULD_BE_DEFINED #endif +#ifndef DASH_D_DEFINE +#error Expected DASH_D_DEFINE +#endif + int main() { return 0; } diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt index e190161..7529283 100644 --- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt +++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt @@ -43,5 +43,6 @@ add_executable(consumer ) target_include_directories(consumer - PRIVATE target_include_directories + PRIVATE $<TARGET_PROPERTY:target_include_directories,INTERFACE_INCLUDE_DIRECTORIES> + relative_dir ) diff --git a/Tests/CMakeCommands/target_include_directories/consumer.cpp b/Tests/CMakeCommands/target_include_directories/consumer.cpp index 5d88488..82b800a 100644 --- a/Tests/CMakeCommands/target_include_directories/consumer.cpp +++ b/Tests/CMakeCommands/target_include_directories/consumer.cpp @@ -2,6 +2,7 @@ #include "common.h" #include "publicinclude.h" #include "interfaceinclude.h" +#include "relative_dir.h" #ifdef PRIVATEINCLUDE_DEFINE #error Unexpected PRIVATEINCLUDE_DEFINE @@ -19,4 +20,8 @@ #error Expected CURE_DEFINE #endif +#ifndef RELATIVE_DIR_DEFINE +#error Expected RELATIVE_DIR_DEFINE +#endif + int main() { return 0; } diff --git a/Tests/CMakeCommands/target_include_directories/relative_dir/relative_dir.h b/Tests/CMakeCommands/target_include_directories/relative_dir/relative_dir.h new file mode 100644 index 0000000..7017b61 --- /dev/null +++ b/Tests/CMakeCommands/target_include_directories/relative_dir/relative_dir.h @@ -0,0 +1,2 @@ + +#define RELATIVE_DIR_DEFINE diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 187c48a..e9bd2ba 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -159,15 +159,18 @@ endif() add_executable(deps_iface deps_iface.c) target_link_libraries(deps_iface testLibDepends) -target_include_directories(deps_iface PRIVATE testLibDepends) -target_compile_definitions(deps_iface PRIVATE testLibDepends) +target_include_directories(deps_iface PRIVATE $<TARGET_PROPERTY:testLibDepends,INTERFACE_INCLUDE_DIRECTORIES>) +target_compile_definitions(deps_iface PRIVATE $<TARGET_PROPERTY:testLibDepends,INTERFACE_COMPILE_DEFINITIONS>) add_executable(deps_shared_iface deps_shared_iface.cpp) target_link_libraries(deps_shared_iface testSharedLibDepends) -target_include_directories(deps_shared_iface PRIVATE testSharedLibDepends) +target_include_directories(deps_shared_iface + PRIVATE + $<TARGET_PROPERTY:testSharedLibDepends,INTERFACE_INCLUDE_DIRECTORIES> +) target_compile_definitions(deps_shared_iface PRIVATE - testSharedLibDepends + $<TARGET_PROPERTY:testSharedLibDepends,INTERFACE_COMPILE_DEFINITIONS> $<$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>:PIC_PROPERTY_IS_ON> $<$<BOOL:$<TARGET_PROPERTY:CUSTOM_PROP>>:CUSTOM_PROPERTY_IS_ON> $<$<STREQUAL:$<TARGET_PROPERTY:CUSTOM_STRING>,testcontent>:CUSTOM_STRING_IS_MATCH> @@ -197,9 +200,13 @@ endif() add_executable(deps_shared_iface2 deps_shared_iface.cpp) target_link_libraries(deps_shared_iface2 bld_testSharedLibDepends bld_subdirlib) -target_include_directories(deps_shared_iface2 PRIVATE bld_testSharedLibDepends bld_subdirlib) +target_include_directories(deps_shared_iface2 + PRIVATE + $<TARGET_PROPERTY:bld_testSharedLibDepends,INTERFACE_INCLUDE_DIRECTORIES> + $<TARGET_PROPERTY:bld_subdirlib,INTERFACE_INCLUDE_DIRECTORIES> +) target_compile_definitions(deps_shared_iface2 - PRIVATE bld_testSharedLibDepends TEST_SUBDIR_LIB + PRIVATE $<TARGET_PROPERTY:bld_testSharedLibDepends,INTERFACE_COMPILE_DEFINITIONS> TEST_SUBDIR_LIB $<$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>:PIC_PROPERTY_IS_ON> $<$<BOOL:$<TARGET_PROPERTY:CUSTOM_PROP>>:CUSTOM_PROPERTY_IS_ON> $<$<STREQUAL:$<TARGET_PROPERTY:CUSTOM_STRING>,testcontent>:CUSTOM_STRING_IS_MATCH> |