[Cmake-commits] CMake branch, next, updated. v3.3.1-2421-g638e36e

Stephen Kelly steveire at gmail.com
Mon Aug 24 15:52:43 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  638e36e30d9430d2fe134d1a4c3903e37b589ff4 (commit)
       via  19e9b6d4a22c2b4e6d3f66a701fe3283b555d186 (commit)
      from  9908727dfa4a0bfeb38aaf5e1111e5127361aee8 (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=638e36e30d9430d2fe134d1a4c3903e37b589ff4
commit 638e36e30d9430d2fe134d1a4c3903e37b589ff4
Merge: 9908727 19e9b6d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Aug 24 15:52:42 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Aug 24 15:52:42 2015 -0400

    Merge topic 'cmState-ProjectName' into next
    
    19e9b6d4 Revert topic.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19e9b6d4a22c2b4e6d3f66a701fe3283b555d186
commit 19e9b6d4a22c2b4e6d3f66a701fe3283b555d186
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Aug 24 21:51:44 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Aug 24 21:51:56 2015 +0200

    Revert topic.

diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 7da334e..591a2cd 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -115,9 +115,7 @@ void CCONV cmAddCacheDefinition(void *arg, const char* name,
 const char* CCONV cmGetProjectName(void *arg)
 {
   cmMakefile *mf = static_cast<cmMakefile *>(arg);
-  static std::string name;
-  name = mf->GetProjectName();
-  return name.c_str();
+  return mf->GetProjectName();
 }
 
 const char* CCONV cmGetHomeDirectory(void *arg)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 17bafbe..503c455 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2102,19 +2102,18 @@ void cmGlobalGenerator::FillProjectMap()
   for(i = 0; i < this->LocalGenerators.size(); ++i)
     {
     // for each local generator add all projects
-    cmState::Snapshot snp = this->LocalGenerators[i]->GetStateSnapshot();
+    cmLocalGenerator *lg = this->LocalGenerators[i];
     std::string name;
     do
       {
-      std::string snpProjName = snp.GetProjectName();
-      if (name != snpProjName)
+      if (name != lg->GetMakefile()->GetProjectName())
         {
-        name = snpProjName;
+        name = lg->GetMakefile()->GetProjectName();
         this->ProjectMap[name].push_back(this->LocalGenerators[i]);
         }
-      snp = snp.GetBuildsystemDirectoryParent();
+      lg = lg->GetParent();
       }
-    while (snp.IsValid());
+    while (lg);
     }
 }
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index dbf41cc..2296d5a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1525,7 +1525,7 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent)
                     parent->GetProperty("LINK_DIRECTORIES"));
 
   // the initial project name
-  this->SetProjectName(parent->GetProjectName());
+  this->ProjectName = parent->ProjectName;
 
   // Copy include regular expressions.
   this->ComplainFileRegularExpression = parent->ComplainFileRegularExpression;
@@ -2044,15 +2044,11 @@ void cmMakefile::RemoveCacheDefinition(const std::string& name)
   this->GetState()->RemoveCacheEntry(name);
 }
 
-void cmMakefile::SetProjectName(std::string const& p)
+void cmMakefile::SetProjectName(const char* p)
 {
-  this->StateSnapshot.SetProjectName(p);
+  this->ProjectName = p;
 }
 
-std::string cmMakefile::GetProjectName() const
-{
-  return this->StateSnapshot.GetProjectName();
-}
 
 void cmMakefile::AddGlobalLinkInformation(const std::string& name,
                                           cmTarget& target)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 81bb510..055170a 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -274,12 +274,15 @@ public:
   /**
    * Specify the name of the project for this build.
    */
-  void SetProjectName(std::string const& name);
+  void SetProjectName(const char*);
 
   /**
    * Get the name of the project for this build.
    */
-  std::string GetProjectName() const;
+  const char* GetProjectName() const
+    {
+      return this->ProjectName.c_str();
+    }
 
   /** Get the configurations to be generated.  */
   std::string GetConfigurations(std::vector<std::string>& configs,
@@ -810,6 +813,8 @@ protected:
 
   mutable std::set<cmListFileContext> CMP0054ReportedIds;
 
+  std::string ProjectName;    // project name
+
   // libraries, classes, and executables
   mutable cmTargets Targets;
 #if defined(CMAKE_BUILD_WITH_CMAKE)
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 7123125..46d7e01 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -20,7 +20,7 @@ bool cmProjectCommand
     this->SetError("PROJECT called with incorrect number of arguments");
     return false;
     }
-  this->Makefile->SetProjectName(args[0]);
+  this->Makefile->SetProjectName(args[0].c_str());
 
   std::string bindir = args[0];
   bindir += "_BINARY_DIR";
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index ce12b97..53fdae0 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -38,8 +38,6 @@ struct cmState::SnapshotDataType
   std::vector<std::string>::size_type IncludeDirectoryPosition;
   std::vector<std::string>::size_type CompileDefinitionsPosition;
   std::vector<std::string>::size_type CompileOptionsPosition;
-
-  std::string ProjectName;
 };
 
 struct cmState::PolicyStackEntry: public cmPolicies::PolicyMap
@@ -1314,16 +1312,6 @@ cmState::Directory cmState::Snapshot::GetDirectory() const
   return Directory(this->Position->BuildSystemDirectory, *this);
 }
 
-void cmState::Snapshot::SetProjectName(const std::string& name)
-{
-  this->Position->ProjectName = name;
-}
-
-std::string cmState::Snapshot::GetProjectName() const
-{
-  return this->Position->ProjectName;
-}
-
 cmState::Directory::Directory(
     cmLinkedTree<BuildsystemDirectoryStateType>::iterator iter,
     const cmState::Snapshot& snapshot)
diff --git a/Source/cmState.h b/Source/cmState.h
index c3ff4e8..e503cd2 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -86,9 +86,6 @@ public:
 
     Directory GetDirectory() const;
 
-    void SetProjectName(std::string const& name);
-    std::string GetProjectName() const;
-
     struct StrictWeakOrder
     {
       bool operator()(const cmState::Snapshot& lhs,

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

Summary of changes:
 Source/cmCPluginAPI.cxx      |    4 +---
 Source/cmGlobalGenerator.cxx |   11 +++++------
 Source/cmMakefile.cxx        |   10 +++-------
 Source/cmMakefile.h          |    9 +++++++--
 Source/cmProjectCommand.cxx  |    2 +-
 Source/cmState.cxx           |   12 ------------
 Source/cmState.h             |    3 ---
 7 files changed, 17 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list