[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1562-g8500b55

Stephen Kelly steveire at gmail.com
Fri Jan 11 18:04:20 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  8500b5598cf85b40afb531266a3e49c11346ec2d (commit)
       via  e5314d1aca7d77ab1c27068fa01bab788c48837e (commit)
      from  1ca019c875ceb911bca19636647186cd073e1113 (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=8500b5598cf85b40afb531266a3e49c11346ec2d
commit 8500b5598cf85b40afb531266a3e49c11346ec2d
Merge: 1ca019c e5314d1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jan 11 18:04:19 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 11 18:04:19 2013 -0500

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


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e5314d1aca7d77ab1c27068fa01bab788c48837e
commit e5314d1aca7d77ab1c27068fa01bab788c48837e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Dec 5 14:59:39 2012 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Jan 11 17:40:22 2013 +0100

    Add a way to check INTERFACE user property compatibility.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9b50b8e..3f93ed3 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -5299,6 +5299,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 +5371,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:
 Source/cmTarget.cxx |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Source/cmTarget.h   |    2 +
 Source/cmake.cxx    |    7 ++++++
 Source/cmake.h      |    2 +
 4 files changed, 68 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list