From 46e28960a58a25bbf0124b6ab95eda24cc4fe1a4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 7 Feb 2013 00:43:54 +0100 Subject: [PATCH] The COMPATIBLE_INTERFACE does not affect the target it is set on. Test and document this. --- Source/cmTarget.cxx | 24 ++++++++++++------------ Tests/CompatibleInterface/CMakeLists.txt | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 2eaf1c129..4109929ca 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -900,24 +900,24 @@ void cmTarget::DefineProperties(cmake *cm) "Properties which must be compatible with their link interface", "The COMPATIBLE_INTERFACE_BOOL property may contain a list of properties" "for this target which must be consistent when evaluated as a boolean " - "in the INTERFACE of all linked dependencies. For example, if a " - "property \"FOO\" appears in the list, then the \"INTERFACE_FOO\" " - "property content in all dependencies must be consistent with each " - "other, and with the \"FOO\" property in this target. " - "Consistency in this sense has the meaning that if the property is set," - "then it must have the same boolean value as all others, and if the " - "property is not set, then it is ignored."); + "in the INTERFACE of all linked dependees. For example, if a " + "property \"FOO\" appears in the list, then for each dependee, the " + "\"INTERFACE_FOO\" property content in all of its dependencies must be " + "consistent with each other, and with the \"FOO\" property in the " + "dependee. Consistency in this sense has the meaning that if the " + "property is set, then it must have the same boolean value as all " + "others, and if the property is not set, then it is ignored."); cm->DefineProperty ("COMPATIBLE_INTERFACE_STRING", cmProperty::TARGET, "Properties which must be string-compatible with their link interface", "The COMPATIBLE_INTERFACE_STRING property may contain a list of " "properties for this target which must be the same when evaluated as " - "a string in the INTERFACE of all linked dependencies. For example, " - "if a property \"FOO\" appears in the list, then the \"INTERFACE_FOO\" " - "property content in all dependencies must be equal with each " - "other, and with the \"FOO\" property in this target. If the " - "property is not set, then it is ignored."); + "a string in the INTERFACE of all linked dependees. For example, " + "if a property \"FOO\" appears in the list, then for each dependee, the " + "\"INTERFACE_FOO\" property content in all of its dependencies must be " + "equal with each other, and with the \"FOO\" property in the dependee. " + "If the property is not set, then it is ignored."); cm->DefineProperty ("POST_INSTALL_SCRIPT", cmProperty::TARGET, diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt index 329510b05..cd0a37d20 100644 --- a/Tests/CompatibleInterface/CMakeLists.txt +++ b/Tests/CompatibleInterface/CMakeLists.txt @@ -67,3 +67,18 @@ target_compile_definitions(CompatibleInterface PRIVATE $<$>:SOME_DEFINE> ) + +# The COMPATIBLE_INTERFACE_* properties are only read from dependencies +# in the interface. Populating it on the CompatibleInterface target does +# not have any affect on the interpretation of the INTERFACE variants +# in dependencies. +set_property(TARGET iface1 PROPERTY + INTERFACE_NON_RELEVANT_PROP ON +) +set_property(TARGET iface2 PROPERTY + INTERFACE_NON_RELEVANT_PROP ON +) +set_property(TARGET CompatibleInterface APPEND PROPERTY + COMPATIBLE_INTERFACE_BOOL + NON_RELEVANT_PROP +)