|
|
@@ -907,6 +907,17 @@ void cmTarget::DefineProperties(cmake *cm)
|
|
|
"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.");
|
|
|
+
|
|
|
cm->DefineProperty
|
|
|
("POST_INSTALL_SCRIPT", cmProperty::TARGET,
|
|
|
"Deprecated install support.",
|
|
|
@@ -4511,6 +4522,14 @@ bool getTypedProperty<bool>(cmTarget *tgt, const char *prop, bool *)
|
|
|
return tgt->GetPropertyAsBool(prop);
|
|
|
}
|
|
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+template<>
|
|
|
+const char *getTypedProperty<const char *>(cmTarget *tgt, const char *prop,
|
|
|
+ const char **)
|
|
|
+{
|
|
|
+ return tgt->GetProperty(prop);
|
|
|
+}
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
|
template<typename PropertyType>
|
|
|
bool consistentProperty(PropertyType lhs, PropertyType rhs);
|
|
|
@@ -4522,6 +4541,17 @@ bool consistentProperty(bool lhs, bool rhs)
|
|
|
return lhs == rhs;
|
|
|
}
|
|
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+template<>
|
|
|
+bool consistentProperty(const char *lhs, const char *rhs)
|
|
|
+{
|
|
|
+ if (!lhs && !rhs)
|
|
|
+ return true;
|
|
|
+ if (!lhs || !rhs)
|
|
|
+ return false;
|
|
|
+ return strcmp(lhs, rhs) == 0;
|
|
|
+}
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
|
template<typename PropertyType>
|
|
|
PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt,
|
|
|
@@ -4667,6 +4697,17 @@ bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
|
|
|
0);
|
|
|
}
|
|
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+const char * cmTarget::GetLinkInterfaceDependentStringProperty(
|
|
|
+ const std::string &p,
|
|
|
+ const char *config)
|
|
|
+{
|
|
|
+ return checkInterfacePropertyCompatibility<const char *>(this,
|
|
|
+ p,
|
|
|
+ config,
|
|
|
+ "empty", 0);
|
|
|
+}
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
|
bool isLinkDependentProperty(cmTarget *tgt, const std::string &p,
|
|
|
const char *interfaceProperty,
|
|
|
@@ -4714,6 +4755,14 @@ bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
|
|
|
config);
|
|
|
}
|
|
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p,
|
|
|
+ const char *config)
|
|
|
+{
|
|
|
+ return isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_STRING",
|
|
|
+ config);
|
|
|
+}
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
|
void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
|
|
|
{
|
|
|
@@ -5468,6 +5517,15 @@ bool getLinkInterfaceDependentProperty(cmTarget *tgt,
|
|
|
return tgt->GetLinkInterfaceDependentBoolProperty(prop, config);
|
|
|
}
|
|
|
|
|
|
+template<>
|
|
|
+const char * getLinkInterfaceDependentProperty(cmTarget *tgt,
|
|
|
+ const std::string prop,
|
|
|
+ const char *config,
|
|
|
+ const char **)
|
|
|
+{
|
|
|
+ return tgt->GetLinkInterfaceDependentStringProperty(prop, config);
|
|
|
+}
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
|
template<typename PropertyType>
|
|
|
void checkPropertyConsistency(cmTarget *depender, cmTarget *dependee,
|
|
|
@@ -5536,6 +5594,13 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+ checkPropertyConsistency<const char *>(this, li->Target,
|
|
|
+ "COMPATIBLE_INTERFACE_STRING",
|
|
|
+ emitted, config, 0);
|
|
|
+ if (cmSystemTools::GetErrorOccuredFlag())
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|