[Cmake-commits] CMake branch, next, updated. v3.3.0-rc1-263-g90cc6d7

Stephen Kelly steveire at gmail.com
Mon Jun 8 16:24:30 EDT 2015


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  90cc6d71587a98361d7f627ea560ed654d41cd88 (commit)
       via  52b9d828ab482f5eaae3313d821d9a4a492f069b (commit)
       via  fe603c7dfb8a3d0dfc892b46f9df0b4c32a892f9 (commit)
       via  8fc53c3ce89e76a4e5cf1968307c513041e9a7b7 (commit)
      from  4d868e122b49e63e7e0ad2474e631cd059858aa6 (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=90cc6d71587a98361d7f627ea560ed654d41cd88
commit 90cc6d71587a98361d7f627ea560ed654d41cd88
Merge: 4d868e1 52b9d82
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jun 8 16:24:30 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jun 8 16:24:30 2015 -0400

    Merge topic 'move-CMP0059-handling' into next
    
    52b9d828 cmMakefile: Move CMP0059 handling to command code.
    fe603c7d cmGetDirectoryPropertyCommand: Move variable to the point of use.
    8fc53c3c cmGetDirectoryPropertyCommand: Extract StoreResult method.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52b9d828ab482f5eaae3313d821d9a4a492f069b
commit 52b9d828ab482f5eaae3313d821d9a4a492f069b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 7 14:50:54 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jun 8 22:23:44 2015 +0200

    cmMakefile: Move CMP0059 handling to command code.
    
    Don't pay a penalty for it in all GetProperty calls.
    
    Additionally, the storage of properties will eventually move to
    cmState, which should only contain state and not logic for policies
    like this.

diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx
index f60eba7..c056d95 100644
--- a/Source/cmGetDirectoryPropertyCommand.cxx
+++ b/Source/cmGetDirectoryPropertyCommand.cxx
@@ -86,6 +86,23 @@ bool cmGetDirectoryPropertyCommand
   const char *prop = 0;
   if (!i->empty())
     {
+    if (*i == "DEFINITIONS")
+      {
+      switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0059))
+        {
+        case cmPolicies::WARN:
+          this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
+                           cmPolicies::GetPolicyWarning(cmPolicies::CMP0059));
+        case cmPolicies::OLD:
+          this->StoreResult(variable,
+                                   this->Makefile->GetDefineFlagsCMP0059());
+        return true;
+        case cmPolicies::NEW:
+        case cmPolicies::REQUIRED_ALWAYS:
+        case cmPolicies::REQUIRED_IF_USED:
+          break;
+        }
+      }
     prop = dir->GetProperty(*i);
     }
   this->StoreResult(variable, prop);
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 36b6c64..33d638b 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -279,6 +279,22 @@ bool cmGetPropertyCommand::HandleDirectoryMode()
       }
     }
 
+  if (this->PropertyName == "DEFINITIONS")
+    {
+    switch(mf->GetPolicyStatus(cmPolicies::CMP0059))
+      {
+      case cmPolicies::WARN:
+        mf->IssueMessage(cmake::AUTHOR_WARNING,
+                         cmPolicies::GetPolicyWarning(cmPolicies::CMP0059));
+      case cmPolicies::OLD:
+        return this->StoreResult(mf->GetDefineFlagsCMP0059());
+      case cmPolicies::NEW:
+      case cmPolicies::REQUIRED_ALWAYS:
+      case cmPolicies::REQUIRED_IF_USED:
+        break;
+      }
+    }
+
   // Get the property.
   return this->StoreResult(mf->GetProperty(this->PropertyName));
 }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a8b163a..63dbe27 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4171,22 +4171,6 @@ const char *cmMakefile::GetProperty(const std::string& prop,
     this->GetListOfMacros(output);
     return output.c_str();
     }
-  else if (prop == "DEFINITIONS")
-    {
-    switch(this->GetPolicyStatus(cmPolicies::CMP0059))
-      {
-      case cmPolicies::WARN:
-          this->IssueMessage(cmake::AUTHOR_WARNING, cmPolicies::
-                             GetPolicyWarning(cmPolicies::CMP0059));
-      case cmPolicies::OLD:
-        output += this->DefineFlagsOrig;
-        return output.c_str();
-      case cmPolicies::NEW:
-      case cmPolicies::REQUIRED_ALWAYS:
-      case cmPolicies::REQUIRED_IF_USED:
-        break;
-      }
-    }
   else if (prop == "LINK_DIRECTORIES")
     {
     output = cmJoin(this->GetLinkDirectories(), ";");
@@ -4674,6 +4658,11 @@ cmState::Snapshot cmMakefile::GetStateSnapshot() const
   return this->StateSnapshot;
 }
 
+const char* cmMakefile::GetDefineFlagsCMP0059() const
+{
+  return this->DefineFlagsOrig.c_str();
+}
+
 //----------------------------------------------------------------------------
 cmPolicies::PolicyStatus
 cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 6f6ed27..86bde0c 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -838,6 +838,8 @@ public:
 
   cmState::Snapshot GetStateSnapshot() const;
 
+  const char* GetDefineFlagsCMP0059() const;
+
 protected:
   // add link libraries and directories to the target
   void AddGlobalLinkInformation(const std::string& name, cmTarget& target);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe603c7dfb8a3d0dfc892b46f9df0b4c32a892f9
commit fe603c7dfb8a3d0dfc892b46f9df0b4c32a892f9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jun 8 22:03:07 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jun 8 22:18:42 2015 +0200

    cmGetDirectoryPropertyCommand: Move variable to the point of use.

diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx
index bb1801c..f60eba7 100644
--- a/Source/cmGetDirectoryPropertyCommand.cxx
+++ b/Source/cmGetDirectoryPropertyCommand.cxx
@@ -26,7 +26,6 @@ bool cmGetDirectoryPropertyCommand
   std::vector<std::string>::const_iterator i = args.begin();
   std::string variable = *i;
   ++i;
-  std::string output = "";
 
   // get the directory argument if there is one
   cmMakefile *dir = this->Makefile;
@@ -79,7 +78,7 @@ bool cmGetDirectoryPropertyCommand
                      "providing the name of the variable to get.");
       return false;
       }
-    output = dir->GetSafeDefinition(*i);
+    std::string output = dir->GetSafeDefinition(*i);
     this->Makefile->AddDefinition(variable, output.c_str());
     return true;
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8fc53c3ce89e76a4e5cf1968307c513041e9a7b7
commit 8fc53c3ce89e76a4e5cf1968307c513041e9a7b7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jun 8 22:00:37 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jun 8 22:18:40 2015 +0200

    cmGetDirectoryPropertyCommand: Extract StoreResult method.

diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx
index 228e53c..bb1801c 100644
--- a/Source/cmGetDirectoryPropertyCommand.cxx
+++ b/Source/cmGetDirectoryPropertyCommand.cxx
@@ -89,12 +89,18 @@ bool cmGetDirectoryPropertyCommand
     {
     prop = dir->GetProperty(*i);
     }
+  this->StoreResult(variable, prop);
+  return true;
+}
+
+void cmGetDirectoryPropertyCommand::StoreResult(std::string const& variable,
+                                                const char* prop)
+{
   if (prop)
     {
     this->Makefile->AddDefinition(variable, prop);
-    return true;
+    return;
     }
   this->Makefile->AddDefinition(variable, "");
-  return true;
 }
 
diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h
index 6c5750a..f418886 100644
--- a/Source/cmGetDirectoryPropertyCommand.h
+++ b/Source/cmGetDirectoryPropertyCommand.h
@@ -40,8 +40,9 @@ public:
   virtual std::string GetName() const { return "get_directory_property";}
 
   cmTypeMacro(cmGetDirectoryPropertyCommand, cmCommand);
-};
-
 
+private:
+  void StoreResult(const std::string& variable, const char* prop);
+};
 
 #endif

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

Summary of changes:
 Source/cmGetDirectoryPropertyCommand.cxx |   30 ++++++++++++++++++++++++++----
 Source/cmGetDirectoryPropertyCommand.h   |    5 +++--
 Source/cmGetPropertyCommand.cxx          |   16 ++++++++++++++++
 Source/cmMakefile.cxx                    |   21 +++++----------------
 Source/cmMakefile.h                      |    2 ++
 5 files changed, 52 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list