diff options
author | Brad King <brad.king@kitware.com> | 2013-07-15 13:30:34 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-07-15 13:30:34 (GMT) |
commit | aa0b9fa31147181227dc77953ced6795b076699c (patch) | |
tree | dde90868f45a0fdd6b4b8a1331f30d024a129063 /Tests/ExportImport | |
parent | 9f61436803e47be261ea6970f9502e8970bffa3d (diff) | |
parent | 4f7ceb56d1077e5639ca0a60f664a72d61ee4b9e (diff) | |
download | CMake-aa0b9fa31147181227dc77953ced6795b076699c.zip CMake-aa0b9fa31147181227dc77953ced6795b076699c.tar.gz CMake-aa0b9fa31147181227dc77953ced6795b076699c.tar.bz2 |
Merge topic 'IMPORTED-build-dependencies'
4f7ceb5 Test non-IMPORTED libraries in the INTERFACE of IMPORTED libraries.
3405351 Add entire link interface transitive closure as target depends.
Diffstat (limited to 'Tests/ExportImport')
6 files changed, 65 insertions, 0 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index efecd03..73a4b9b 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -184,6 +184,9 @@ set_property(TARGET testSharedLibRequired APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/testSharedLibRequired>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>" ) +set_property(TARGET testSharedLibRequired APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS USING_TESTSHAREDLIBREQUIRED +) set_property(TARGET testSharedLibRequired APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL CUSTOM_PROP diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 3bfbc46..0aa47e8 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -218,3 +218,36 @@ target_compile_definitions(deps_shared_iface2 $<$<BOOL:$<TARGET_PROPERTY:CUSTOM_PROP>>:CUSTOM_PROPERTY_IS_ON> $<$<STREQUAL:$<TARGET_PROPERTY:CUSTOM_STRING>,testcontent>:CUSTOM_STRING_IS_MATCH> ) + +add_subdirectory(excludedFromAll) + +add_executable(iface_test_bld iface_test.cpp) +target_link_libraries(iface_test_bld bld_testSharedLibDepends) + +set_property(TARGET bld_testSharedLibRequired APPEND PROPERTY + LINK_INTERFACE_LIBRARIES + excludedFromAll +) +get_target_property(_configs bld_testSharedLibRequired IMPORTED_CONFIGURATIONS) +foreach(_config ${_configs}) + set_property(TARGET bld_testSharedLibRequired APPEND PROPERTY + IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} + excludedFromAll + ) +endforeach() +unset(_configs) +add_executable(iface_test_exp iface_test.cpp) +target_link_libraries(iface_test_exp testSharedLibDepends) + +set_property(TARGET testSharedLibDepends APPEND PROPERTY + LINK_INTERFACE_LIBRARIES + excludedFromAll +) +get_target_property(_configs testSharedLibDepends IMPORTED_CONFIGURATIONS) +foreach(_config ${_configs}) + set_property(TARGET testSharedLibDepends APPEND PROPERTY + IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} + excludedFromAll + ) +endforeach() +unset(_configs) diff --git a/Tests/ExportImport/Import/A/excludedFromAll/CMakeLists.txt b/Tests/ExportImport/Import/A/excludedFromAll/CMakeLists.txt new file mode 100644 index 0000000..cd5a59b --- /dev/null +++ b/Tests/ExportImport/Import/A/excludedFromAll/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +include(GenerateExportHeader) +add_library(excludedFromAll SHARED EXCLUDE_FROM_ALL excludedFromAll.cpp) +generate_export_header(excludedFromAll) diff --git a/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.cpp b/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.cpp new file mode 100644 index 0000000..2269a04 --- /dev/null +++ b/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.cpp @@ -0,0 +1,7 @@ + +#include "excludedFromAll.h" + +int excludedFromAll() +{ + return 0; +} diff --git a/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.h b/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.h new file mode 100644 index 0000000..4820c76 --- /dev/null +++ b/Tests/ExportImport/Import/A/excludedFromAll/excludedFromAll.h @@ -0,0 +1,4 @@ + +#include "excludedfromall_export.h" + +int EXCLUDEDFROMALL_EXPORT excludedFromAll(); diff --git a/Tests/ExportImport/Import/A/iface_test.cpp b/Tests/ExportImport/Import/A/iface_test.cpp new file mode 100644 index 0000000..fa4474b --- /dev/null +++ b/Tests/ExportImport/Import/A/iface_test.cpp @@ -0,0 +1,11 @@ + +#ifndef USING_TESTSHAREDLIBREQUIRED +#error Expected USING_TESTSHAREDLIBREQUIRED +#endif + +#include "excludedFromAll.h" + +int main(void) +{ + return excludedFromAll(); +} |