[Cmake-commits] CMake branch, next, updated. v3.2.2-2013-gc0355d5

Brad King brad.king at kitware.com
Tue Apr 21 09:41:58 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  c0355d5e95d310d89acf2bff51e3b9411f017896 (commit)
       via  8dc3a67c9c3c5b49fe7a3b69dab7d60475414c59 (commit)
       via  0f3c8cfa96a3b7c426e5a9cc341410fefd2baf75 (commit)
      from  26190e484f2166efd2134cdeec372da51ea3862d (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=c0355d5e95d310d89acf2bff51e3b9411f017896
commit c0355d5e95d310d89acf2bff51e3b9411f017896
Merge: 26190e4 8dc3a67
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 21 09:41:58 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 21 09:41:58 2015 -0400

    Merge topic 'clean-up-cmMakefile' into next
    
    8dc3a67c cmMakefile: Out-of-line the directory methods.
    0f3c8cfa cmMakefile: Use method abstraction to access directories.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8dc3a67c9c3c5b49fe7a3b69dab7d60475414c59
commit 8dc3a67c9c3c5b49fe7a3b69dab7d60475414c59
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Apr 16 09:24:16 2015 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 21 09:41:27 2015 -0400

    cmMakefile: Out-of-line the directory methods.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3bbc5d8..7beb932 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1667,6 +1667,37 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
     }
 }
 
+void cmMakefile::SetCurrentSourceDirectory(const std::string& dir)
+{
+  this->cmStartDirectory = dir;
+  cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
+  this->cmStartDirectory =
+    cmSystemTools::CollapseFullPath(this->cmStartDirectory);
+  this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
+                      this->cmStartDirectory.c_str());
+}
+
+const char* cmMakefile::GetCurrentSourceDirectory() const
+{
+  return this->cmStartDirectory.c_str();
+}
+
+void cmMakefile::SetCurrentBinaryDirectory(const std::string& dir)
+{
+  this->StartOutputDirectory = dir;
+  cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
+  this->StartOutputDirectory =
+    cmSystemTools::CollapseFullPath(this->StartOutputDirectory);
+  cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str());
+  this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
+                      this->StartOutputDirectory.c_str());
+}
+
+const char* cmMakefile::GetCurrentBinaryDirectory() const
+{
+  return this->StartOutputDirectory.c_str();
+}
+
 //----------------------------------------------------------------------------
 void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
                                        bool before)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 8472825..55b2cbd 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -447,43 +447,10 @@ public:
    */
   void SetArgcArgv(const std::vector<std::string>& args);
 
-  //@{
-  /**
-   * Set/Get the start directory (or output directory). The start directory
-   * is the directory of the CMakeLists.txt file that started the current
-   * round of processing. Remember that CMake processes CMakeLists files by
-   * recursing up the tree starting at the StartDirectory and going up until
-   * it reaches the HomeDirectory.
-   */
-  void SetCurrentSourceDirectory(const std::string& dir)
-    {
-      this->cmStartDirectory = dir;
-      cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
-      this->cmStartDirectory =
-        cmSystemTools::CollapseFullPath(this->cmStartDirectory);
-      this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
-                          this->cmStartDirectory.c_str());
-    }
-  void SetCurrentBinaryDirectory(const std::string& dir)
-    {
-      this->StartOutputDirectory = dir;
-      cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
-      this->StartOutputDirectory =
-        cmSystemTools::CollapseFullPath(this->StartOutputDirectory);
-      cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str());
-      this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
-                          this->StartOutputDirectory.c_str());
-    }
-  //@}
-
-  const char* GetCurrentSourceDirectory() const
-    {
-      return this->cmStartDirectory.c_str();
-    }
-  const char* GetCurrentBinaryDirectory() const
-    {
-      return this->StartOutputDirectory.c_str();
-    }
+  void SetCurrentSourceDirectory(const std::string& dir);
+  const char* GetCurrentSourceDirectory() const;
+  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

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f3c8cfa96a3b7c426e5a9cc341410fefd2baf75
commit 0f3c8cfa96a3b7c426e5a9cc341410fefd2baf75
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Apr 16 22:37:08 2015 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 21 09:41:27 2015 -0400

    cmMakefile: Use method abstraction to access directories.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9fe02cb..3bbc5d8 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -225,11 +225,11 @@ void cmMakefile::Print() const
     }
 
   std::cout << " this->StartOutputDirectory; " <<
-    this->StartOutputDirectory << std::endl;
+    this->GetCurrentBinaryDirectory() << std::endl;
   std::cout << " this->HomeOutputDirectory; " <<
     this->HomeOutputDirectory << std::endl;
   std::cout << " this->cmStartDirectory; " <<
-    this->cmStartDirectory << std::endl;
+    this->GetCurrentSourceDirectory() << std::endl;
   std::cout << " this->cmHomeDirectory; " <<
     this->cmHomeDirectory << std::endl;
   std::cout << " this->ProjectName; "
@@ -526,8 +526,9 @@ 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,
-                            this->cmStartDirectory == this->cmHomeDirectory);
+                            curSrc == this->GetHomeDirectory());
 }
 
 bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
@@ -535,7 +536,7 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile());
   this->cmCurrentListFile =
     cmSystemTools::CollapseFullPath(listfile,
-                                    this->cmStartDirectory.c_str());
+                                    this->GetCurrentSourceDirectory());
   return this->ReadListFile(this->cmCurrentListFile.c_str(),
                             noPolicyScope);
 }
@@ -549,7 +550,7 @@ bool cmMakefile::ReadListFile(const char* listfile,
 {
   std::string filenametoread =
     cmSystemTools::CollapseFullPath(listfile,
-                                    this->cmStartDirectory.c_str());
+                                    this->GetCurrentSourceDirectory());
 
   std::string currentParentFile
       = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
@@ -1547,9 +1548,9 @@ void cmMakefile::InitializeFromParent()
   this->Internal->VarStack.top() = parent->Internal->VarStack.top().Closure();
 
   this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
-                      this->cmStartDirectory.c_str());
+                      this->GetCurrentSourceDirectory());
   this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
-                      this->StartOutputDirectory.c_str());
+                      this->GetCurrentBinaryDirectory());
 
   const std::vector<cmValueWithOrigin>& parentIncludes =
                                         parent->GetIncludeDirectoriesEntries();

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list