[Cmake-commits] CMake branch, next, updated. v3.3.1-2428-ga3d0518

Stephen Kelly steveire at gmail.com
Mon Aug 24 17:36:50 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  a3d0518c64d2a3848487ac0d2fc93af622bacc61 (commit)
       via  dc02e143313548eaced4e4c6c0635f69e518aaca (commit)
      from  bbc1c4930d4220341cb40b885a8385b553a76962 (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=a3d0518c64d2a3848487ac0d2fc93af622bacc61
commit a3d0518c64d2a3848487ac0d2fc93af622bacc61
Merge: bbc1c49 dc02e14
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Aug 24 17:36:49 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Aug 24 17:36:49 2015 -0400

    Merge topic 'cmState-ProjectName' into next
    
    dc02e143 Revert topic.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc02e143313548eaced4e4c6c0635f69e518aaca
commit dc02e143313548eaced4e4c6c0635f69e518aaca
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Aug 24 23:36:13 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Aug 24 23:36:27 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 6c5370e..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->BuildSystemDirectory->DirectoryEnd->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