diff options
author | Brad King <brad.king@kitware.com> | 2014-07-15 15:34:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-16 17:28:47 (GMT) |
commit | 6e7e881c57e8ff7295a1007d329708143b54baad (patch) | |
tree | 807f56133c933237aba2139682cb9ac925eb1b0a /Tests/CompatibleInterface/CMakeLists.txt | |
parent | 0400cd5dd1be33ebcc2c2d5dba8233a78b1cee68 (diff) | |
download | CMake-6e7e881c57e8ff7295a1007d329708143b54baad.zip CMake-6e7e881c57e8ff7295a1007d329708143b54baad.tar.gz CMake-6e7e881c57e8ff7295a1007d329708143b54baad.tar.bz2 |
Honor $<LINK_ONLY> when checking interface properties
Callers of cmTarget::GetLinkImplementationClosure are interested in the
set of targets whose interface properties propagate to the current
target. This excludes targets guarded by $<LINK_ONLY>.
Teach the CompatibleInterface test to cover suppression of interface
compatibility tests with $<LINK_ONLY>. Although this is not recommended
in practice, it is a way of covering the above behavior.
Diffstat (limited to 'Tests/CompatibleInterface/CMakeLists.txt')
-rw-r--r-- | Tests/CompatibleInterface/CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt index 350b518..668a97b 100644 --- a/Tests/CompatibleInterface/CMakeLists.txt +++ b/Tests/CompatibleInterface/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0) project(CompatibleInterface) @@ -54,6 +54,15 @@ set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200) add_executable(CompatibleInterface main.cpp) target_link_libraries(CompatibleInterface iface1) +add_library(foo STATIC foo.cpp) +add_library(bar SHARED bar.cpp) +set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMEPROP) +set_property(TARGET foo PROPERTY INTERFACE_SOMEPROP ON) +# Use LINK_ONLY to suppress usage requirements and allow the check to pass. +set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_ONLY:foo>) +set_property(TARGET CompatibleInterface PROPERTY SOMEPROP OFF) +target_link_libraries(CompatibleInterface bar) + set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP2 ON) set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP3 ON) set_property(TARGET CompatibleInterface PROPERTY STRING_PROP2 prop2) |