[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1566-g1f19abf

Stephen Kelly steveire at gmail.com
Fri Jan 11 18:15:27 EST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  1f19abff7e917005926a78984e778436a5ccb190 (commit)
       via  535806465c32e08a81baa086f6ba7f1a52794b5b (commit)
      from  5bfe77e0f6892393c546dbb804a151ff2a172521 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f19abff7e917005926a78984e778436a5ccb190
commit 1f19abff7e917005926a78984e778436a5ccb190
Merge: 5bfe77e 5358064
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jan 11 18:15:26 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 11 18:15:26 2013 -0500

    Merge topic 'compatible-INTERFACE-user-properties' into next
    
    5358064 Add a way to check INTERFACE user property compatibility.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=535806465c32e08a81baa086f6ba7f1a52794b5b
commit 535806465c32e08a81baa086f6ba7f1a52794b5b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Dec 5 14:59:39 2012 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Jan 12 00:14:46 2013 +0100

    Add a way to check INTERFACE user property compatibility.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9b50b8e..6f3f638 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -892,6 +892,19 @@ void cmTarget::DefineProperties(cmake *cm)
      "requirement for their INTERFACE_POSITION_INDEPENDENT_CODE property.");
 
   cm->DefineProperty
+    ("COMPATIBLE_INTERFACE_BOOL", cmProperty::TARGET,
+     "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.");
+
+  cm->DefineProperty
     ("POST_INSTALL_SCRIPT", cmProperty::TARGET,
      "Deprecated install support.",
      "The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the "
@@ -5299,6 +5312,58 @@ std::string cmTarget::CheckCMP0004(std::string const& item)
 }
 
 //----------------------------------------------------------------------------
+void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
+                                          const char* config)
+{
+  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
+
+  std::set<cmStdString> emitted;
+
+  for(cmComputeLinkInformation::ItemVector::const_iterator li =
+      deps.begin();
+      li != deps.end(); ++li)
+    {
+    if (!li->Target)
+      {
+      continue;
+      }
+    const char *prop = li->Target->GetProperty("COMPATIBLE_INTERFACE_BOOL");
+    if (!prop)
+      {
+      continue;
+      }
+
+    std::vector<std::string> props;
+    cmSystemTools::ExpandListArgument(prop, props);
+
+    for(std::vector<std::string>::iterator pi = props.begin();
+        pi != props.end(); ++pi)
+      {
+      if (this->Makefile->GetCMakeInstance()
+                        ->GetIsPropertyDefined(pi->c_str(),
+                                                cmProperty::TARGET))
+        {
+        cmOStringStream e;
+        e << "Target \"" << li->Target->GetName() << "\" has property \""
+          << *pi << "\" listed in its COMPATIBLE_INTERFACE_BOOL property.  "
+            "This is not allowed.  Only user-defined properties may appear "
+            "listed in the COMPATIBLE_INTERFACE_BOOL property.";
+        this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+        return;
+        }
+      if(emitted.insert(*pi).second)
+        {
+        this->GetLinkInterfaceDependentBoolProperty(*pi, config);
+        if (cmSystemTools::GetErrorOccuredFlag())
+          {
+          return;
+          }
+        }
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 cmComputeLinkInformation*
 cmTarget::GetLinkInformation(const char* config, cmTarget *head)
 {
@@ -5319,6 +5384,11 @@ cmTarget::GetLinkInformation(const char* config, cmTarget *head)
       info = 0;
       }
 
+    if (info)
+      {
+      this->CheckPropertyCompatibility(info, config);
+      }
+
     // Store the information for this configuration.
     cmTargetLinkInformationMap::value_type entry(key, info);
     i = this->LinkInformation.insert(entry).first;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index b4d053d..0963c5c 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -626,6 +626,8 @@ private:
                                         cmTarget *head);
 
   cmTargetLinkInformationMap LinkInformation;
+  void CheckPropertyCompatibility(cmComputeLinkInformation *info,
+                                  const char* config);
 
   bool ComputeLinkInterface(const char* config, LinkInterface& iface,
                                         cmTarget *head);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index a44c825..c33d781 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -3552,6 +3552,13 @@ void cmake::DefineProperty(const char *name, cmProperty::ScopeType scope,
                                                   chained);
 }
 
+bool cmake::GetIsPropertyDefined(const char *name,
+                                 cmProperty::ScopeType scope)
+{
+  this->PropertyDefinitions[scope].find(name) !=
+                                      this->PropertyDefinitions[scope].end();
+}
+
 cmPropertyDefinition *cmake
 ::GetPropertyDefinition(const char *name,
                         cmProperty::ScopeType scope)
diff --git a/Source/cmake.h b/Source/cmake.h
index e5aa076..f6fe0d6 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -341,6 +341,8 @@ class cmake
                       bool chain = false,
                       const char *variableGroup = 0);
 
+  bool GetIsPropertyDefined(const char *name, cmProperty::ScopeType scope);
+
   // get property definition
   cmPropertyDefinition *GetPropertyDefinition
   (const char *name, cmProperty::ScopeType scope);

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list