[Cmake-commits] CMake branch, next, updated. v3.2.2-2873-g2cf25b9

Stephen Kelly steveire at gmail.com
Sun May 17 10:55:06 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  2cf25b949bd3fd8a59aa1cbfc75ad171318d059d (commit)
       via  8b14b7c8f1f260da9bc489ac35ef41f4b34a198e (commit)
       via  3a9eb61e36d44fd60d9e5b71a0dfb3772169c97c (commit)
       via  8c346e25f8d78ebb153ba8e5f26386e3c94dc876 (commit)
       via  12044ae4c1588f3e2b02dbf918c2c16084e5f6e5 (commit)
       via  7d8c677e38166279ad8ba6a54c355fea84c0a8d4 (commit)
       via  48577790e5ec094ad1ff036dbe1302a628cdcd3b (commit)
       via  280371713e58ba5b9c1677e01ed4fc5f6507b4e3 (commit)
       via  8f218be1dd64f0e02d8f89b9f99e5ae7ae2f8cbc (commit)
       via  f8d8d169a06a51c12bebb65784550e834f37afbc (commit)
       via  054dedef890e28431fc49d03afd526c721766b79 (commit)
       via  4005d8dddfb923987a13f349af207fdf305f5b55 (commit)
       via  9417c0499d72f7e9f949e1fd7706a9c3bb0d02ce (commit)
       via  f170985e7aaec7562ca481bab49228ece233c4e4 (commit)
       via  98c5c90361f89f810cdd6fb233f3e822b638f143 (commit)
       via  7872201bf69610579b6b1fab4b5389b692c82089 (commit)
      from  6e17764a2f4ecbf2c0e72712f1e38a4dc8e74116 (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=2cf25b949bd3fd8a59aa1cbfc75ad171318d059d
commit 2cf25b949bd3fd8a59aa1cbfc75ad171318d059d
Merge: 6e17764 8b14b7c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun May 17 10:55:04 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun May 17 10:55:04 2015 -0400

    Merge topic 'clean-up-cmMakefile' into next
    
    8b14b7c8 cmMakefile: Use early return to reduce nested code.
    3a9eb61e cmMakefile: Don't use else after return.
    8c346e25 cmMakefile: Remove redundant conditions.
    12044ae4 cmCTest: Remove unimplemented method.
    7d8c677e cmMakefile: Remove Print() debugging facilities.
    48577790 cmMakefile: Remove duplicate variable initialization.
    28037171 cmMakefile: Don't expect the VarStack iterator to support size().
    8f218be1 cmMakefile: Remove redundant condition.
    f8d8d169 cmMakefile: Rename method to something more appropriate.
    054dedef cmMakefile: Make the public ReadListFile method take one param.
    4005d8dd cmMakefile: Remove CurrentListFile member.
    9417c049 cmMakefile: Port CurrentListFile clients to GetDefinition.
    f170985e cmDefinitions: Make the ClosureKeys method static.
    98c5c903 cmDefinitions: Centralize knowledge of iterator type.
    7872201b cmDefinitions: Remove internal MakeClosure method.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b14b7c8f1f260da9bc489ac35ef41f4b34a198e
commit 8b14b7c8f1f260da9bc489ac35ef41f4b34a198e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun May 17 13:24:18 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:30 2015 +0200

    cmMakefile: Use early return to reduce nested code.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7499c84..f1f4223 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -110,23 +110,24 @@ public:
     ++it;
     if(it == this->VarStack.rend())
       {
-      if(cmLocalGenerator* plg = mf->GetLocalGenerator()->GetParent())
+      cmLocalGenerator* plg = mf->GetLocalGenerator()->GetParent();
+      if(!plg)
         {
-        // Update the definition in the parent directory top scope.  This
-        // directory's scope was initialized by the closure of the parent
-        // scope, so we do not need to localize the definition first.
-        cmMakefile* parent = plg->GetMakefile();
-        if (varDef)
-          {
-          parent->AddDefinition(var, varDef);
-          }
-        else
-          {
-          parent->RemoveDefinition(var);
-          }
-        return true;
+        return false;
         }
-      return false;
+      // Update the definition in the parent directory top scope.  This
+      // directory's scope was initialized by the closure of the parent
+      // scope, so we do not need to localize the definition first.
+      cmMakefile* parent = plg->GetMakefile();
+      if (varDef)
+        {
+        parent->AddDefinition(var, varDef);
+        }
+      else
+        {
+        parent->RemoveDefinition(var);
+        }
+      return true;
       }
     // First localize the definition in the current scope.
     this->GetDefinition(var);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a9eb61e36d44fd60d9e5b71a0dfb3772169c97c
commit 3a9eb61e36d44fd60d9e5b71a0dfb3772169c97c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun May 17 13:20:34 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:30 2015 +0200

    cmMakefile: Don't use else after return.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0a7a39f..7499c84 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -126,10 +126,7 @@ public:
           }
         return true;
         }
-      else
-        {
-        return false;
-        }
+      return false;
       }
     // First localize the definition in the current scope.
     this->GetDefinition(var);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c346e25f8d78ebb153ba8e5f26386e3c94dc876
commit 8c346e25f8d78ebb153ba8e5f26386e3c94dc876
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun May 17 12:07:10 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:30 2015 +0200

    cmMakefile: Remove redundant conditions.
    
    This container is never empty.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8557a12..0a7a39f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1722,8 +1722,7 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value)
     }
 
   this->Internal->SetDefinition(name, value);
-  if (!this->Internal->VarUsageStack.empty() &&
-      this->VariableInitialized(name))
+  if (this->VariableInitialized(name))
     {
     this->CheckForUnused("changing definition", name);
     this->Internal->VarUsageStack.top().erase(name);
@@ -1798,8 +1797,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
 void cmMakefile::AddDefinition(const std::string& name, bool value)
 {
   this->Internal->SetDefinition(name, value ? "ON" : "OFF");
-  if (!this->Internal->VarUsageStack.empty() &&
-      this->VariableInitialized(name))
+  if (this->VariableInitialized(name))
     {
     this->CheckForUnused("changing definition", name);
     this->Internal->VarUsageStack.top().erase(name);
@@ -1896,8 +1894,7 @@ void cmMakefile::CheckForUnused(const char* reason,
 void cmMakefile::RemoveDefinition(const std::string& name)
 {
   this->Internal->RemoveDefinition(name);
-  if (!this->Internal->VarUsageStack.empty() &&
-      this->VariableInitialized(name))
+  if (this->VariableInitialized(name))
     {
     this->CheckForUnused("unsetting", name);
     this->Internal->VarUsageStack.top().erase(name);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12044ae4c1588f3e2b02dbf918c2c16084e5f6e5
commit 12044ae4c1588f3e2b02dbf918c2c16084e5f6e5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 16 16:46:12 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:30 2015 +0200

    cmCTest: Remove unimplemented method.

diff --git a/Source/cmTest.h b/Source/cmTest.h
index c6e7e42..ca88afe 100644
--- a/Source/cmTest.h
+++ b/Source/cmTest.h
@@ -40,11 +40,6 @@ public:
     return this->Command;
     }
 
-  /**
-   * Print the structure to std::cout.
-   */
-  void Print() const;
-
   ///! Set/Get a property of this source file
   void SetProperty(const std::string& prop, const char *value);
   void AppendProperty(const std::string& prop,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d8c677e38166279ad8ba6a54c355fea84c0a8d4
commit 7d8c677e38166279ad8ba6a54c355fea84c0a8d4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 16 16:43:17 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:30 2015 +0200

    cmMakefile: Remove Print() debugging facilities.
    
    They don't print things that are important in the modern implementation.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 577e07d..8557a12 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -251,59 +251,6 @@ cmMakefile::~cmMakefile()
   }
 }
 
-void cmMakefile::PrintStringVector(const char* s,
-                                   const std::vector<std::string>& v) const
-{
-  std::cout << s << ": ( \n" << cmWrap('"', v, '"', " ") << ")\n";
-}
-
-void cmMakefile
-::PrintStringVector(const char* s,
-                    const std::vector<std::pair<std::string, bool> >& v) const
-{
-  std::cout << s << ": ( \n";
-  for(std::vector<std::pair<std::string, bool> >::const_iterator i
-        = v.begin(); i != v.end(); ++i)
-    {
-    std::cout << i->first << " " << i->second;
-    }
-  std::cout << " )\n";
-}
-
-
-// call print on all the classes in the makefile
-void cmMakefile::Print() const
-{
-  // print the class lists
-  std::cout << "classes:\n";
-
-  std::cout << " this->Targets: ";
-  for (cmTargets::iterator l = this->Targets.begin();
-       l != this->Targets.end(); l++)
-    {
-    std::cout << l->first << std::endl;
-    }
-
-  std::cout << " this->StartOutputDirectory; " <<
-    this->GetCurrentBinaryDirectory() << std::endl;
-  std::cout << " this->HomeOutputDirectory; " <<
-    this->GetHomeOutputDirectory() << std::endl;
-  std::cout << " this->cmStartDirectory; " <<
-    this->GetCurrentSourceDirectory() << std::endl;
-  std::cout << " this->cmHomeDirectory; " <<
-    this->GetHomeDirectory() << std::endl;
-  std::cout << " this->ProjectName; "
-            <<  this->ProjectName << std::endl;
-  this->PrintStringVector("this->LinkDirectories", this->LinkDirectories);
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-  for( std::vector<cmSourceGroup>::const_iterator i =
-         this->SourceGroups.begin(); i != this->SourceGroups.end(); ++i)
-    {
-    std::cout << "Source Group: " << i->GetName() << std::endl;
-    }
-#endif
-}
-
 //----------------------------------------------------------------------------
 void cmMakefile::IssueMessage(cmake::MessageType t,
                               std::string const& text) const
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index a20bd56..5d6419a 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -154,11 +154,6 @@ public:
    */
   void FinalPass();
 
-  /**
-   * Print the object state to std::cout.
-   */
-  void Print() const;
-
   /** Add a custom command to the build.  */
   void AddCustomCommandToTarget(const std::string& target,
                                 const std::vector<std::string>& byproducts,
@@ -924,10 +919,6 @@ private:
 
   friend class cmMakeDepend;    // make depend needs direct access
                                 // to the Sources array
-  void PrintStringVector(const char* s, const
-                         std::vector<std::pair<std::string, bool> >& v) const;
-  void PrintStringVector(const char* s,
-                         const std::vector<std::string>& v) const;
 
   void AddDefaultDefinitions();
   typedef std::vector<cmFunctionBlocker*> FunctionBlockersType;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48577790e5ec094ad1ff036dbe1302a628cdcd3b
commit 48577790e5ec094ad1ff036dbe1302a628cdcd3b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 16 16:39:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:30 2015 +0200

    cmMakefile: Remove duplicate variable initialization.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index bb7f25b..577e07d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -151,10 +151,6 @@ cmMakefile::cmMakefile(cmLocalGenerator* localGenerator)
   this->Internal->VarUsageStack.push(std::set<std::string>());
   this->Internal->IsSourceFileTryCompile = false;
 
-  // Initialize these first since AddDefaultDefinitions calls AddDefinition
-  this->WarnUnused = false;
-  this->CheckSystemVars = false;
-
   this->GeneratingBuildSystem = false;
   this->SuppressWatches = false;
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=280371713e58ba5b9c1677e01ed4fc5f6507b4e3
commit 280371713e58ba5b9c1677e01ed4fc5f6507b4e3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 16 07:29:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:29 2015 +0200

    cmMakefile: Don't expect the VarStack iterator to support size().

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 20e348b..bb7f25b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -105,9 +105,8 @@ public:
 
   bool RaiseScope(std::string const& var, const char* varDef, cmMakefile* mf)
   {
-    assert(this->VarStack.size() > 0);
-
     std::list<cmDefinitions>::reverse_iterator it = this->VarStack.rbegin();
+    assert(it != this->VarStack.rend());
     ++it;
     if(it == this->VarStack.rend())
       {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f218be1dd64f0e02d8f89b9f99e5ae7ae2f8cbc
commit 8f218be1dd64f0e02d8f89b9f99e5ae7ae2f8cbc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 2 10:25:13 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:29 2015 +0200

    cmMakefile: Remove redundant condition.
    
    As this is called in the constructor, the definition will never be already
    set.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 54403f3..20e348b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -230,18 +230,12 @@ cmMakefile::cmMakefile(cmLocalGenerator* localGenerator)
   {
   const char* dir = this->GetCMakeInstance()->GetHomeDirectory();
   this->AddDefinition("CMAKE_SOURCE_DIR", dir);
-  if ( !this->GetDefinition("CMAKE_CURRENT_SOURCE_DIR") )
-    {
-    this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", dir);
-    }
+  this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", dir);
   }
   {
   const char* dir = this->GetCMakeInstance()->GetHomeOutputDirectory();
   this->AddDefinition("CMAKE_BINARY_DIR", dir);
-  if ( !this->GetDefinition("CMAKE_CURRENT_BINARY_DIR") )
-    {
-    this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", dir);
-    }
+  this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", dir);
   }
 }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f8d8d169a06a51c12bebb65784550e834f37afbc
commit f8d8d169a06a51c12bebb65784550e834f37afbc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 16 07:30:33 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:29 2015 +0200

    cmMakefile: Rename method to something more appropriate.
    
    Allow the name to be used for something more-suitable.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 46c75dc..54403f3 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4355,7 +4355,7 @@ void cmMakefile::AddCMakeDependFilesFromUser()
     }
 }
 
-std::string cmMakefile::GetListFileStack() const
+std::string cmMakefile::FormatListFileStack() const
 {
   std::ostringstream tmp;
   size_t depth = this->ListFileStack.size();
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 1b9867f..a20bd56 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -592,7 +592,7 @@ public:
     { this->ListFiles.push_back(file);}
   void AddCMakeDependFilesFromUser();
 
-  std::string GetListFileStack() const;
+  std::string FormatListFileStack() const;
 
   /**
    * Get the current context backtrace.
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 3cd92cb..b9ffe5e 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -375,7 +375,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
       comment += "Run arguments : ";
       comment += runArgs;
       comment += "\n";
-      comment += "   Called from: " + this->Makefile->GetListFileStack();
+      comment += "   Called from: " + this->Makefile->FormatListFileStack();
       cmsys::SystemTools::ReplaceString(comment, "\n", "\n# ");
       file << comment << "\n\n";
 
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index d82087f..bfd79eb 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -130,7 +130,7 @@ static std::string cmakemainGetStack(void *clientdata)
   cmMakefile* mf=cmakemainGetMakefile(clientdata);
   if (mf)
     {
-    msg = mf->GetListFileStack();
+    msg = mf->FormatListFileStack();
     if (!msg.empty())
       {
       msg = "\n   Called from: " + msg;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=054dedef890e28431fc49d03afd526c721766b79
commit 054dedef890e28431fc49d03afd526c721766b79
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 15 00:09:53 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:29 2015 +0200

    cmMakefile: Make the public ReadListFile method take one param.
    
    Make the existing method a private overload. All external callers
    invoke the method with only one argument.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7a6d039..46c75dc 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -604,12 +604,14 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE",
                       this->GetDefinition("CMAKE_CURRENT_LIST_FILE"));
-  return this->ReadListFile(listfile, noPolicyScope);
+  return this->ReadListFile(listfile, noPolicyScope, false);
+}
+
+bool cmMakefile::ReadListFile(const char* listfile)
+{
+  return this->ReadListFile(listfile, true, false);
 }
 
-//----------------------------------------------------------------------------
-// Parse the given CMakeLists.txt file executing all commands
-//
 bool cmMakefile::ReadListFile(const char* listfile,
                               bool noPolicyScope,
                               bool requireProjectCommand)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 082b66c..1b9867f 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -81,12 +81,7 @@ public:
    */
   ~cmMakefile();
 
-  /**
-   * Read and parse a CMakeLists.txt file.
-   */
-  bool ReadListFile(const char* listfile,
-                    bool noPolicyScope = true,
-                    bool requireProjectCommand = false);
+  bool ReadListFile(const char* listfile);
 
   bool ReadDependentFile(const char* listfile, bool noPolicyScope = true);
 
@@ -914,6 +909,10 @@ private:
 
   cmState::Snapshot StateSnapshot;
 
+  bool ReadListFile(const char* listfile,
+                    bool noPolicyScope,
+                    bool requireProjectCommand);
+
   bool ReadListFileInternal(const char* filenametoread,
                             bool noPolicyScope,
                             bool requireProjectCommand);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4005d8dddfb923987a13f349af207fdf305f5b55
commit 4005d8dddfb923987a13f349af207fdf305f5b55
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu May 14 23:49:10 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:29 2015 +0200

    cmMakefile: Remove CurrentListFile member.
    
    It is never read externally.  The CollapseFullPath removed in this commit
    is a repeat of a similar call inside ReadListFile.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ca5419a..7a6d039 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -595,7 +595,6 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
 bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile);
-  this->cmCurrentListFile = listfile;
   std::string curSrc = this->GetCurrentSourceDirectory();
   return this->ReadListFile(listfile, true,
                             curSrc == this->GetHomeDirectory());
@@ -605,11 +604,7 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE",
                       this->GetDefinition("CMAKE_CURRENT_LIST_FILE"));
-  this->cmCurrentListFile =
-    cmSystemTools::CollapseFullPath(listfile,
-                                    this->GetCurrentSourceDirectory());
-  return this->ReadListFile(this->cmCurrentListFile.c_str(),
-                            noPolicyScope);
+  return this->ReadListFile(listfile, noPolicyScope);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index e0eef6f..082b66c 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -435,14 +435,6 @@ public:
   void SetCurrentBinaryDirectory(const std::string& dir);
   const char* GetCurrentBinaryDirectory() const;
 
-  /* Get the current CMakeLists.txt file that is being processed.  This
-   * is just used in order to be able to 'branch' from one file to a second
-   * transparently */
-  const char* GetCurrentListFile() const
-    {
-      return this->cmCurrentListFile.c_str();
-    }
-
   //@}
 
   /**
@@ -861,8 +853,6 @@ protected:
   // Check for a an unused variable
   void CheckForUnused(const char* reason, const std::string& name) const;
 
-  std::string cmCurrentListFile;
-
   std::string ProjectName;    // project name
 
   // libraries, classes, and executables

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9417c0499d72f7e9f949e1fd7706a9c3bb0d02ce
commit 9417c0499d72f7e9f949e1fd7706a9c3bb0d02ce
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu May 14 23:47:40 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:29 2015 +0200

    cmMakefile: Port CurrentListFile clients to GetDefinition.
    
    There is no need to store this as a member variable.

diff --git a/Source/cmExtraQbsGenerator.cxx b/Source/cmExtraQbsGenerator.cxx
index 4cc4650..c15f8da 100644
--- a/Source/cmExtraQbsGenerator.cxx
+++ b/Source/cmExtraQbsGenerator.cxx
@@ -182,7 +182,9 @@ void cmExtraQbsGenerator::AppendSources(cmGeneratedFileStream &fout,
   std::vector<cmSourceFile *> genSources;
   std::vector<cmSourceFile *>::const_iterator itr = sources.begin();
   fout << "\t\t\tfiles: [\n"
-       << "\t\t\t\t\"" << t.GetMakefile()->GetCurrentListFile() << "\",\n";
+       << "\t\t\t\t\""
+       << t.GetMakefile()->GetDefinition("CMAKE_CURRENT_LIST_FILE")
+       << "\",\n";
   for (; itr != sources.end(); ++itr)
     {
     if (!(*itr)->GetPropertyAsBool("GENERATED"))
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index f1f1202..bcae486 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -305,8 +305,8 @@ void cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os)
   cmGlobalNinjaGenerator::WriteDivider(os);
   os
     << "# Write statements declared in CMakeLists.txt:" << std::endl
-    << "# " << this->Makefile->GetCurrentListFile() << std::endl
-    ;
+    << "# "
+    << this->Makefile->GetDefinition("CMAKE_CURRENT_LIST_FILE") << std::endl;
   if(this->IsRootMakefile())
     os << "# Which is the root file." << std::endl;
   cmGlobalNinjaGenerator::WriteDivider(os);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9f9171c..ca5419a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -603,7 +603,8 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
 
 bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
 {
-  this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile());
+  this->AddDefinition("CMAKE_PARENT_LIST_FILE",
+                      this->GetDefinition("CMAKE_CURRENT_LIST_FILE"));
   this->cmCurrentListFile =
     cmSystemTools::CollapseFullPath(listfile,
                                     this->GetCurrentSourceDirectory());

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f170985e7aaec7562ca481bab49228ece233c4e4
commit f170985e7aaec7562ca481bab49228ece233c4e4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 16 05:33:30 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:18 2015 +0200

    cmDefinitions: Make the ClosureKeys method static.
    
    For consistency with all other closure-related methods.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 6fcc002..e2c6876 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -105,18 +105,24 @@ cmDefinitions cmDefinitions::MakeClosure(StackConstIter begin,
 
 //----------------------------------------------------------------------------
 std::vector<std::string>
-cmDefinitions::ClosureKeys(std::set<std::string>& bound) const
+cmDefinitions::ClosureKeys(StackConstIter begin, StackConstIter end)
 {
+  std::set<std::string> bound;
   std::vector<std::string> defined;
-  defined.reserve(this->Map.size());
-  for(MapType::const_iterator mi = this->Map.begin();
-      mi != this->Map.end(); ++mi)
+
+  for (StackConstIter it = begin; it != end; ++it)
     {
-    // Use this key if it is not already set or unset.
-    if(bound.insert(mi->first).second && mi->second.Exists)
+    defined.reserve(defined.size() + it->Map.size());
+    for(MapType::const_iterator mi = it->Map.begin();
+        mi != it->Map.end(); ++mi)
       {
-      defined.push_back(mi->first);
+      // Use this key if it is not already set or unset.
+      if(bound.insert(mi->first).second && mi->second.Exists)
+        {
+        defined.push_back(mi->first);
+        }
       }
     }
+
   return defined;
 }
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index b95ae6b..80643a9 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -44,8 +44,8 @@ public:
   /** Get the set of all local keys.  */
   std::vector<std::string> LocalKeys() const;
 
-  std::vector<std::string>
-  ClosureKeys(std::set<std::string>& bound) const;
+  static std::vector<std::string> ClosureKeys(StackConstIter begin,
+                                              StackConstIter end);
 
   static cmDefinitions MakeClosure(StackConstIter begin, StackConstIter end);
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7b8d3af..9f9171c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -94,16 +94,8 @@ public:
 
   std::vector<std::string> ClosureKeys() const
   {
-    std::vector<std::string> closureKeys;
-    std::set<std::string> bound;
-    for (std::list<cmDefinitions>::const_reverse_iterator it =
-         this->VarStack.rbegin(); it != this->VarStack.rend(); ++it)
-      {
-      std::vector<std::string> const& localKeys = it->ClosureKeys(bound);
-      closureKeys.insert(closureKeys.end(),
-                         localKeys.begin(), localKeys.end());
-      }
-    return closureKeys;
+    return cmDefinitions::ClosureKeys(this->VarStack.rbegin(),
+                                      this->VarStack.rend());
   }
 
   void PopDefinitions()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98c5c90361f89f810cdd6fb233f3e822b638f143
commit 98c5c90361f89f810cdd6fb233f3e822b638f143
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 16 05:33:25 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:18 2015 +0200

    cmDefinitions: Centralize knowledge of iterator type.
    
    Currently we process a list of definitions, but that will change.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 581f259..6fcc002 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -18,32 +18,29 @@ cmDefinitions::Def cmDefinitions::NoDef;
 
 //----------------------------------------------------------------------------
 cmDefinitions::Def const& cmDefinitions::GetInternal(
-  const std::string& key,
-  std::list<cmDefinitions>::reverse_iterator rbegin,
-  std::list<cmDefinitions>::reverse_iterator rend)
+  const std::string& key, StackIter begin, StackIter end)
 {
-  assert(rbegin != rend);
-  MapType::const_iterator i = rbegin->Map.find(key);
-  if (i != rbegin->Map.end())
+  assert(begin != end);
+  MapType::const_iterator i = begin->Map.find(key);
+  if (i != begin->Map.end())
     {
     return i->second;
     }
-  std::list<cmDefinitions>::reverse_iterator rit = rbegin;
-  ++rit;
-  if (rit == rend)
+  StackIter it = begin;
+  ++it;
+  if (it == end)
     {
     return cmDefinitions::NoDef;
     }
-  Def const& def = cmDefinitions::GetInternal(key, rit, rend);
-  return rbegin->Map.insert(MapType::value_type(key, def)).first->second;
+  Def const& def = cmDefinitions::GetInternal(key, it, end);
+  return begin->Map.insert(MapType::value_type(key, def)).first->second;
 }
 
 //----------------------------------------------------------------------------
 const char* cmDefinitions::Get(const std::string& key,
-    std::list<cmDefinitions>::reverse_iterator rbegin,
-    std::list<cmDefinitions>::reverse_iterator rend)
+    StackIter begin, StackIter end)
 {
-  Def const& def = cmDefinitions::GetInternal(key, rbegin, rend);
+  Def const& def = cmDefinitions::GetInternal(key, begin, end);
   return def.Exists? def.c_str() : 0;
 }
 
@@ -77,14 +74,12 @@ std::vector<std::string> cmDefinitions::LocalKeys() const
 }
 
 //----------------------------------------------------------------------------
-cmDefinitions cmDefinitions::MakeClosure(
-    std::list<cmDefinitions>::const_reverse_iterator rbegin,
-    std::list<cmDefinitions>::const_reverse_iterator rend)
+cmDefinitions cmDefinitions::MakeClosure(StackConstIter begin,
+                                         StackConstIter end)
 {
   cmDefinitions closure;
   std::set<std::string> undefined;
-  for (std::list<cmDefinitions>::const_reverse_iterator it = rbegin;
-       it != rend; ++it)
+  for (StackConstIter it = begin; it != end; ++it)
     {
     // Consider local definitions.
     for(MapType::const_iterator mi = it->Map.begin();
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index e762b41..b95ae6b 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -28,12 +28,13 @@
  */
 class cmDefinitions
 {
+  typedef std::list<cmDefinitions>::reverse_iterator StackIter;
+  typedef std::list<cmDefinitions>::const_reverse_iterator StackConstIter;
 public:
   /** Get the value associated with a key; null if none.
       Store the result locally if it came from a parent.  */
   static const char* Get(const std::string& key,
-                         std::list<cmDefinitions>::reverse_iterator rbegin,
-                         std::list<cmDefinitions>::reverse_iterator rend);
+                         StackIter begin, StackIter end);
 
   /** Set (or unset if null) a value associated with a key.  */
   void Set(const std::string& key, const char* value);
@@ -46,9 +47,7 @@ public:
   std::vector<std::string>
   ClosureKeys(std::set<std::string>& bound) const;
 
-  static cmDefinitions MakeClosure(
-      std::list<cmDefinitions>::const_reverse_iterator rbegin,
-      std::list<cmDefinitions>::const_reverse_iterator rend);
+  static cmDefinitions MakeClosure(StackConstIter begin, StackConstIter end);
 
 private:
   // String with existence boolean.
@@ -74,8 +73,7 @@ private:
   MapType Map;
 
   static Def const& GetInternal(const std::string& key,
-    std::list<cmDefinitions>::reverse_iterator rbegin,
-    std::list<cmDefinitions>::reverse_iterator rend);
+    StackIter begin, StackIter end);
 };
 
 #endif

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7872201bf69610579b6b1fab4b5389b692c82089
commit 7872201bf69610579b6b1fab4b5389b692c82089
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 16 05:33:19 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun May 17 16:50:18 2015 +0200

    cmDefinitions: Remove internal MakeClosure method.
    
    There is no need to have a separate method, or to pass an external
    set to it.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index f54bc4d..581f259 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -81,18 +81,8 @@ cmDefinitions cmDefinitions::MakeClosure(
     std::list<cmDefinitions>::const_reverse_iterator rbegin,
     std::list<cmDefinitions>::const_reverse_iterator rend)
 {
-  std::set<std::string> undefined;
   cmDefinitions closure;
-  closure.MakeClosure(undefined, rbegin, rend);
-  return closure;
-}
-
-//----------------------------------------------------------------------------
-void
-cmDefinitions::MakeClosure(std::set<std::string>& undefined,
-    std::list<cmDefinitions>::const_reverse_iterator rbegin,
-    std::list<cmDefinitions>::const_reverse_iterator rend)
-{
+  std::set<std::string> undefined;
   for (std::list<cmDefinitions>::const_reverse_iterator it = rbegin;
        it != rend; ++it)
     {
@@ -101,12 +91,12 @@ cmDefinitions::MakeClosure(std::set<std::string>& undefined,
         mi != it->Map.end(); ++mi)
       {
       // Use this key if it is not already set or unset.
-      if(this->Map.find(mi->first) == this->Map.end() &&
+      if(closure.Map.find(mi->first) == closure.Map.end() &&
          undefined.find(mi->first) == undefined.end())
         {
         if(mi->second.Exists)
           {
-          this->Map.insert(*mi);
+          closure.Map.insert(*mi);
           }
         else
           {
@@ -115,6 +105,7 @@ cmDefinitions::MakeClosure(std::set<std::string>& undefined,
         }
       }
     }
+  return closure;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index b244793..e762b41 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -76,9 +76,6 @@ private:
   static Def const& GetInternal(const std::string& key,
     std::list<cmDefinitions>::reverse_iterator rbegin,
     std::list<cmDefinitions>::reverse_iterator rend);
-  void MakeClosure(std::set<std::string>& undefined,
-                   std::list<cmDefinitions>::const_reverse_iterator rbegin,
-                   std::list<cmDefinitions>::const_reverse_iterator rend);
 };
 
 #endif

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list