[Cmake-commits] CMake branch, next, updated. v3.2.2-1918-gcae2b4e

Stephen Kelly steveire at gmail.com
Sat Apr 18 09:31:52 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  cae2b4e846a2dbabfe930d157c736883cb54313f (commit)
       via  05245b42294a38c5f7be9b40a918e42575b7dbd7 (commit)
       via  6e23a4bdddd2bfee668c682a9ab4081b5e6fcfa2 (commit)
       via  d21ebcb2444a4b6001c5997f7004bd5cf917d71b (commit)
       via  95a27267daee021514df8c93ffd6d9b9e55dea51 (commit)
       via  7d248547361bbacb4f5b532ef2ce4f4935c97dc8 (commit)
       via  9db15954104455fef54d59c7aa029d798075bf0e (commit)
       via  5d4480a8c711a3d5971e100cc1a8984b6305c509 (commit)
       via  3a8ac2423ef658e87e366a143428835be48bf88f (commit)
       via  5947d9b031444b48a7d7a9c70ef02d2333aeabee (commit)
       via  e2d0e0fbeb1bf7b43dc55ce55c6000819d108aee (commit)
       via  3a1ad1713f87ed7219c934dcb32c4d41573807c4 (commit)
       via  f0dae032ee44283d08869c2a948f001dc211bfd5 (commit)
       via  08da8742709d6da74d1a17de46990ec5aaf3ad0f (commit)
       via  3dc4fe02e63422532486320739e0cf4abddaa270 (commit)
       via  e4f8f1f1b706d7efc9964826ff4572d27a3062d3 (commit)
       via  2d6121a9a709e319cca733787bcc21bac593a232 (commit)
       via  bdd4c5f5ba6d3bf60b4e3bc620b146784e1559f1 (commit)
       via  524ce895427557312eef52d837f0afdb39a0dab6 (commit)
       via  813cd719c41b05df7a22ad3ebd267cc9bfc2505e (commit)
       via  5c201f1ee6cc19e0f1871048a6a6af9056c5780f (commit)
       via  0d9555779d7bd2a8d068f5b9af431bcf9673453a (commit)
       via  846608f2678b4bced696857b5ca45e11bc86aa2c (commit)
       via  a2f2aeee2f4d4af1f25f4a5b86bacb8a81a7dec4 (commit)
       via  68f791cd06983e8fd375edfba74a9d821231e269 (commit)
       via  5bb4248a807029053156dbf4a3cdba4427766306 (commit)
       via  fc7ab8874b0e5c2c010fb73718ae8702b8853ca0 (commit)
      from  00b8efc2713bfd3e7ef56223bd6b0e9afcc9eaa0 (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=cae2b4e846a2dbabfe930d157c736883cb54313f
commit cae2b4e846a2dbabfe930d157c736883cb54313f
Merge: 00b8efc 05245b4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 09:31:50 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Apr 18 09:31:50 2015 -0400

    Merge topic 'clean-up-ReadListFile' into next
    
    05245b42 cmMakefile: Move some preamble out of the Internal method.
    6e23a4bd cmMakefile: Remove always-null first parameter to ReadListFile.
    d21ebcb2 cmMakefile: Swap parameters of calls to ReadListFile.
    95a27267 cmMakefile: Extract conditional code to caller.
    7d248547 cmMakefile: Remove intermediate variable.
    9db15954 cmMakefile: Move condition to the only calling context where it is true.
    5d4480a8 cmMakefile: Populate CMAKE_PARENT_LIST_FILE in callers.
    3a8ac242 cmMakefile: Collapse nested conditional.
    5947d9b0 cmMakefile: Convert filenametoread into a std::string.
    e2d0e0fb cmMakefile: Remove intermediate variable.
    3a1ad171 cmMakefile: Combine duplicate condition.
    f0dae032 cmMakefile: Re-order independent statements.
    08da8742 cmMakefile: Split a conditional.
    3dc4fe02 cmMakefile: Re-order independent variable setting.
    e4f8f1f1 cmMakefile: Remove intermediate variable.
    2d6121a9 cmMakefile: Remove use of intermediate variable.
    ...


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05245b42294a38c5f7be9b40a918e42575b7dbd7
commit 05245b42294a38c5f7be9b40a918e42575b7dbd7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:38 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:31:18 2015 +0200

    cmMakefile: Move some preamble out of the Internal method.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7790b8a..7be920d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -556,7 +556,15 @@ bool cmMakefile::ReadListFile(const char* listfile,
   std::string currentFile
     = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE");
 
+  this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread.c_str());
+  this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
+                       cmSystemTools::GetFilenamePath(filenametoread).c_str());
+
   this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
+  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
+  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
+
+  this->ListFileStack.push_back(filenametoread);
 
   bool res = this->ReadListFileInternal(filenametoread.c_str(),
                                         noPolicyScope, requireProjectCommand);
@@ -584,14 +592,6 @@ bool cmMakefile::ReadListFileInternal(const char* filenametoread,
                                       bool noPolicyScope,
                                       bool requireProjectCommand)
 {
-  this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread);
-  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
-  this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
-                       cmSystemTools::GetFilenamePath(filenametoread).c_str());
-  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
-
-  // push the listfile onto the stack
-  this->ListFileStack.push_back(filenametoread);
   cmListFile cacheFile;
   if( !cacheFile.ParseFile(filenametoread, requireProjectCommand, this) )
     {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e23a4bdddd2bfee668c682a9ab4081b5e6fcfa2
commit 6e23a4bdddd2bfee668c682a9ab4081b5e6fcfa2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:37 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:31:18 2015 +0200

    cmMakefile: Remove always-null first parameter to ReadListFile.

diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index a2edab5..2b18c41 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -525,7 +525,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
         tempInstallDirectory.c_str());
       this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR",
         tempInstallDirectory.c_str());
-      int res = this->MakefileMap->ReadListFile(0, installScript.c_str());
+      int res = this->MakefileMap->ReadListFile(installScript.c_str());
       if ( cmSystemTools::GetErrorOccuredFlag() || !res )
         {
         return 0;
@@ -888,7 +888,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
                               "1");
           }
         // do installation
-        int res = mf->ReadListFile(0, installFile.c_str());
+        int res = mf->ReadListFile(installFile.c_str());
         // forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES
         // to CPack (may be used by generators like CPack RPM or DEB)
         // in order to transparently handle ABSOLUTE PATH
@@ -980,7 +980,7 @@ bool cmCPackGenerator::ReadListFile(const char* moduleName)
 {
   bool retval;
   std::string fullPath = this->MakefileMap->GetModulesFile(moduleName);
-  retval = this->MakefileMap->ReadListFile(0, fullPath.c_str());
+  retval = this->MakefileMap->ReadListFile(fullPath.c_str());
   // include FATAL_ERROR and ERROR in the return status
   retval = retval && (! cmSystemTools::GetErrorOccuredFlag());
   return retval;
@@ -1163,7 +1163,7 @@ int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf)
     this->GetOption("CPACK_PROJECT_CONFIG_FILE");
   if(config)
     {
-    mf->ReadListFile(0, config);
+    mf->ReadListFile(config);
     }
   int result = this->InitializeInternal();
   if (cmSystemTools::GetErrorOccuredFlag())
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index a9cabf1..2752270 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -244,7 +244,7 @@ int main (int argc, char const* const* argv)
     // paths, so FIND_XXX() commands can be used in scripts
     std::string systemFile =
       globalMF->GetModulesFile("CMakeDetermineSystem.cmake");
-    if (!globalMF->ReadListFile(0, systemFile.c_str()))
+    if (!globalMF->ReadListFile(systemFile.c_str()))
       {
       cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
         "Error reading CMakeDetermineSystem.cmake" << std::endl);
@@ -253,7 +253,7 @@ int main (int argc, char const* const* argv)
 
     systemFile =
       globalMF->GetModulesFile("CMakeSystemSpecificInformation.cmake");
-    if (!globalMF->ReadListFile(0, systemFile.c_str()))
+    if (!globalMF->ReadListFile(systemFile.c_str()))
       {
       cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
         "Error reading CMakeSystemSpecificInformation.cmake" << std::endl);
@@ -272,7 +272,7 @@ int main (int argc, char const* const* argv)
       cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
         "Read CPack configuration file: " << cpackConfigFile
         << std::endl);
-      if ( !globalMF->ReadListFile(0, cpackConfigFile.c_str()) )
+      if ( !globalMF->ReadListFile(cpackConfigFile.c_str()) )
         {
         cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
           "Problem reading CPack config file: \""
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 62fa2be..de6ecde 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -757,7 +757,7 @@ void cmCTestLaunch::LoadConfig()
   std::string fname = this->LogDir;
   fname += "CTestLaunchConfig.cmake";
   if(cmSystemTools::FileExists(fname.c_str()) &&
-     mf->ReadListFile(0, fname.c_str()))
+     mf->ReadListFile(fname.c_str()))
     {
     this->SourceDir = mf->GetSafeDefinition("CTEST_SOURCE_DIRECTORY");
     cmSystemTools::ConvertToUnixSlashes(this->SourceDir);
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 783941b..7f9825c 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -433,7 +433,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
   ctest scripting easier. */
   std::string systemFile =
       this->Makefile->GetModulesFile("CTestScriptMode.cmake");
-  if (!this->Makefile->ReadListFile(0, systemFile.c_str()) ||
+  if (!this->Makefile->ReadListFile(systemFile.c_str()) ||
       cmSystemTools::GetErrorOccuredFlag())
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read:"
@@ -451,7 +451,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
     }
 
   // finally read in the script
-  if (!this->Makefile->ReadListFile(0, script.c_str()) ||
+  if (!this->Makefile->ReadListFile(script.c_str()) ||
     cmSystemTools::GetErrorOccuredFlag())
     {
     // Reset the error flag so that it can run more than
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 59c5e92..d778253 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1617,7 +1617,7 @@ void cmCTestTestHandler::GetListOfTests()
     return;
     }
 
-  if ( !mf->ReadListFile(0, testFilename) )
+  if ( !mf->ReadListFile(testFilename) )
     {
     return;
     }
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 91ae889..3697aa4 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2576,7 +2576,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
     bool erroroc = cmSystemTools::GetErrorOccuredFlag();
     cmSystemTools::ResetErrorOccuredFlag();
 
-    if ( !mf->ReadListFile(0, fname.c_str()) ||
+    if ( !mf->ReadListFile(fname.c_str()) ||
       cmSystemTools::GetErrorOccuredFlag() )
       {
       cmCTestLog(this, ERROR_MESSAGE,
@@ -2606,7 +2606,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
       {
       cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
         << *fileIt << std::endl);
-      if ( !mf->ReadListFile(0, fileIt->c_str()) ||
+      if ( !mf->ReadListFile(fileIt->c_str()) ||
         cmSystemTools::GetErrorOccuredFlag() )
         {
         cmCTestLog(this, ERROR_MESSAGE,
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ab044c1..4a9f628 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -278,7 +278,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
       mf->GetModulesFile(this->FindMakeProgramFile.c_str());
     if(!setMakeProgram.empty())
       {
-      mf->ReadListFile(0, setMakeProgram.c_str());
+      mf->ReadListFile(setMakeProgram.c_str());
       }
     }
   if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
@@ -428,7 +428,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
     fpath += "/CMakeSystem.cmake";
     if(cmSystemTools::FileExists(fpath.c_str()))
       {
-      mf->ReadListFile(0,fpath.c_str());
+      mf->ReadListFile(fpath.c_str());
       }
     }
   //  Load the CMakeDetermineSystem.cmake file and find out
@@ -456,12 +456,12 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
 #endif
     // Read the DetermineSystem file
     std::string systemFile = mf->GetModulesFile("CMakeDetermineSystem.cmake");
-    mf->ReadListFile(0, systemFile.c_str());
+    mf->ReadListFile(systemFile.c_str());
     // load the CMakeSystem.cmake from the binary directory
     // this file is configured by the CMakeDetermineSystem.cmake file
     fpath = rootBin;
     fpath += "/CMakeSystem.cmake";
-    mf->ReadListFile(0,fpath.c_str());
+    mf->ReadListFile(fpath.c_str());
     }
 
   if(readCMakeSystem)
@@ -495,7 +495,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
   if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INITIALIZE_LOADED"))
     {
     fpath = mf->GetModulesFile("CMakeSystemSpecificInitialize.cmake");
-    if(!mf->ReadListFile(0,fpath.c_str()))
+    if(!mf->ReadListFile(fpath.c_str()))
       {
       cmSystemTools::Error("Could not find cmake module file: "
                            "CMakeSystemSpecificInitialize.cmake");
@@ -533,7 +533,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
       // to avoid duplicate compiler tests.
       if(cmSystemTools::FileExists(fpath.c_str()))
         {
-        if(!mf->ReadListFile(0,fpath.c_str()))
+        if(!mf->ReadListFile(fpath.c_str()))
           {
           cmSystemTools::Error("Could not find cmake module file: ",
                                fpath.c_str());
@@ -563,7 +563,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
       determineCompiler += "Compiler.cmake";
       std::string determineFile =
         mf->GetModulesFile(determineCompiler.c_str());
-      if(!mf->ReadListFile(0,determineFile.c_str()))
+      if(!mf->ReadListFile(determineFile.c_str()))
         {
         cmSystemTools::Error("Could not find cmake module file: ",
                              determineCompiler.c_str());
@@ -597,7 +597,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
       fpath += "/CMake";
       fpath += lang;
       fpath += "Compiler.cmake";
-      if(!mf->ReadListFile(0,fpath.c_str()))
+      if(!mf->ReadListFile(fpath.c_str()))
         {
         cmSystemTools::Error("Could not find cmake module file: ",
                              fpath.c_str());
@@ -616,7 +616,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
   if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED"))
     {
     fpath = mf->GetModulesFile("CMakeSystemSpecificInformation.cmake");
-    if(!mf->ReadListFile(0,fpath.c_str()))
+    if(!mf->ReadListFile(fpath.c_str()))
       {
       cmSystemTools::Error("Could not find cmake module file: "
                            "CMakeSystemSpecificInformation.cmake");
@@ -707,7 +707,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
         cmSystemTools::Error("Could not find cmake module file: ",
                              fpath.c_str());
         }
-      else if(!mf->ReadListFile(0, informationFile.c_str()))
+      else if(!mf->ReadListFile(informationFile.c_str()))
         {
         cmSystemTools::Error("Could not process cmake module file: ",
                              informationFile.c_str());
@@ -732,7 +732,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
         testLang += lang;
         testLang += "Compiler.cmake";
         std::string ifpath = mf->GetModulesFile(testLang.c_str());
-        if(!mf->ReadListFile(0,ifpath.c_str()))
+        if(!mf->ReadListFile(ifpath.c_str()))
           {
           cmSystemTools::Error("Could not find cmake module file: ",
                                testLang.c_str());
@@ -777,7 +777,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
   projectCompatibility += "Compatibility.cmake";
   if(cmSystemTools::FileExists(projectCompatibility.c_str()))
     {
-    mf->ReadListFile(0,projectCompatibility.c_str());
+    mf->ReadListFile(projectCompatibility.c_str());
     }
   // Inform any extra generator of the new language.
   if (this->ExtraGenerator)
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index af88d1c..99542a9 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -81,7 +81,7 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
       }
     }
 
-  if ( !mf->ReadListFile(0, inFileName) )
+  if ( !mf->ReadListFile(inFileName) )
     {
     cmSystemTools::Error("Problem opening GraphViz options file: ",
                          inFileName);
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 8938e67..153ed09 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1475,7 +1475,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
                                                        bool color)
 {
   // read in the target info file
-  if(!this->Makefile->ReadListFile(0, tgtInfo) ||
+  if(!this->Makefile->ReadListFile(tgtInfo) ||
      cmSystemTools::GetErrorOccuredFlag())
     {
     cmSystemTools::Error("Target DependInfo.cmake file not found");
@@ -1592,7 +1592,7 @@ cmLocalUnixMakefileGenerator3
   std::string dirInfoFile = this->Makefile->GetStartOutputDirectory();
   dirInfoFile += cmake::GetCMakeFilesDirectory();
   dirInfoFile += "/CMakeDirectoryInformation.cmake";
-  if(mf->ReadListFile(0, dirInfoFile.c_str()) &&
+  if(mf->ReadListFile(dirInfoFile.c_str()) &&
      !cmSystemTools::GetErrorOccuredFlag())
     {
     haveDirectoryInfo = true;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 51f9a57..7790b8a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -526,7 +526,7 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile);
   this->cmCurrentListFile = listfile;
-  return this->ReadListFile(0, listfile, true,
+  return this->ReadListFile(listfile, true,
                             this->cmStartDirectory == this->cmHomeDirectory);
 }
 
@@ -536,30 +536,20 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
   this->cmCurrentListFile =
     cmSystemTools::CollapseFullPath(listfile,
                                     this->cmStartDirectory.c_str());
-  return this->ReadListFile(0, this->cmCurrentListFile.c_str(),
+  return this->ReadListFile(this->cmCurrentListFile.c_str(),
                             noPolicyScope);
 }
 
 //----------------------------------------------------------------------------
 // Parse the given CMakeLists.txt file executing all commands
 //
-bool cmMakefile::ReadListFile(const char* filename_in,
-                              const char *external_in,
+bool cmMakefile::ReadListFile(const char* listfile,
                               bool noPolicyScope,
                               bool requireProjectCommand)
 {
-  std::string filenametoread;
-  if (filename_in)
-    {
-    filenametoread = filename_in;
-    }
-
-  if (external_in)
-    {
-    filenametoread =
-      cmSystemTools::CollapseFullPath(external_in,
-                                      this->cmStartDirectory.c_str());
-    }
+  std::string filenametoread =
+    cmSystemTools::CollapseFullPath(listfile,
+                                    this->cmStartDirectory.c_str());
 
   std::string currentParentFile
       = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 2664d8e..73d6910 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -86,7 +86,6 @@ public:
    * Read and parse a CMakeLists.txt file.
    */
   bool ReadListFile(const char* listfile,
-                    const char* external= 0,
                     bool noPolicyScope = true,
                     bool requireProjectCommand = false);
 
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index d49e997..3d5103f 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1243,7 +1243,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
   cmSystemTools::ConvertToUnixSlashes(filename);
   filename += "/AutogenInfo.cmake";
 
-  if (!makefile->ReadListFile(0, filename.c_str()))
+  if (!makefile->ReadListFile(filename.c_str()))
     {
     cmSystemTools::Error("Error processing file: ", filename.c_str());
     return false;
@@ -1413,7 +1413,7 @@ bool cmQtAutoGenerators::ReadOldMocDefinitionsFile(cmMakefile* makefile,
   cmSystemTools::ConvertToUnixSlashes(filename);
   filename += "/AutomocOldMocDefinitions.cmake";
 
-  if (makefile->ReadListFile(0, filename.c_str()))
+  if (makefile->ReadListFile(filename.c_str()))
     {
     this->OldCompileSettingsStr =
                         makefile->GetSafeDefinition("AM_OLD_COMPILE_SETTINGS");
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index a542a24..c4f7c4e 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -388,7 +388,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
 
       lg->GetMakefile()->SetArgcArgv(args);
       }
-    if (!lg->GetMakefile()->ReadListFile(0, path))
+    if (!lg->GetMakefile()->ReadListFile(path))
       {
       cmSystemTools::Error("Error processing file: ", path);
       }
@@ -424,7 +424,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
   mf->SetArgcArgv(args);
 
   std::string systemFile = mf->GetModulesFile("CMakeFindPackageMode.cmake");
-  mf->ReadListFile(0, systemFile.c_str());
+  mf->ReadListFile(systemFile.c_str());
 
   std::string language = mf->GetSafeDefinition("LANGUAGE");
   std::string mode = mf->GetSafeDefinition("MODE");
@@ -1965,7 +1965,7 @@ int cmake::CheckBuildSystem()
   gg.SetCMakeInstance(&cm);
   cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
   cmMakefile* mf = lg->GetMakefile();
-  if(!mf->ReadListFile(0, this->CheckBuildSystemArgument.c_str()) ||
+  if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) ||
      cmSystemTools::GetErrorOccuredFlag())
     {
     if(verbose)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d21ebcb2444a4b6001c5997f7004bd5cf917d71b
commit d21ebcb2444a4b6001c5997f7004bd5cf917d71b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:37 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:31:18 2015 +0200

    cmMakefile: Swap parameters of calls to ReadListFile.
    
    The version with a null first parameter is now equivalent.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index bc225ff..51f9a57 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -526,7 +526,7 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile);
   this->cmCurrentListFile = listfile;
-  return this->ReadListFile(listfile, 0, true,
+  return this->ReadListFile(0, listfile, true,
                             this->cmStartDirectory == this->cmHomeDirectory);
 }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95a27267daee021514df8c93ffd6d9b9e55dea51
commit 95a27267daee021514df8c93ffd6d9b9e55dea51
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:37 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:31:17 2015 +0200

    cmMakefile: Extract conditional code to caller.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d3ea55a..bc225ff 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -525,6 +525,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
 bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile);
+  this->cmCurrentListFile = listfile;
   return this->ReadListFile(listfile, 0, true,
                             this->cmStartDirectory == this->cmHomeDirectory);
 }
@@ -553,11 +554,6 @@ bool cmMakefile::ReadListFile(const char* filename_in,
     filenametoread = filename_in;
     }
 
-  if (!filenametoread.empty())
-    {
-    this->cmCurrentListFile = filenametoread;
-    }
-
   if (external_in)
     {
     filenametoread =

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d248547361bbacb4f5b532ef2ce4f4935c97dc8
commit 7d248547361bbacb4f5b532ef2ce4f4935c97dc8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:37 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:31:17 2015 +0200

    cmMakefile: Remove intermediate variable.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9b2ee35..d3ea55a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -532,11 +532,10 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
 bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile());
-  std::string filenametoread =
+  this->cmCurrentListFile =
     cmSystemTools::CollapseFullPath(listfile,
                                     this->cmStartDirectory.c_str());
-  this->cmCurrentListFile = filenametoread;
-  return this->ReadListFile(0, filenametoread.c_str(),
+  return this->ReadListFile(0, this->cmCurrentListFile.c_str(),
                             noPolicyScope);
 }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9db15954104455fef54d59c7aa029d798075bf0e
commit 9db15954104455fef54d59c7aa029d798075bf0e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:31:11 2015 +0200

    cmMakefile: Move condition to the only calling context where it is true.
    
    Call the Internal method with equivalent parameters, passing a null first
    argument.
    
    A duplicate path computation exists inside the external_in condition now,
    but that is harmless at this point.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7f4fbc1..9b2ee35 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -532,7 +532,11 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
 bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile());
-  return this->ReadListFile(this->GetCurrentListFile(), listfile,
+  std::string filenametoread =
+    cmSystemTools::CollapseFullPath(listfile,
+                                    this->cmStartDirectory.c_str());
+  this->cmCurrentListFile = filenametoread;
+  return this->ReadListFile(0, filenametoread.c_str(),
                             noPolicyScope);
 }
 
@@ -550,13 +554,6 @@ bool cmMakefile::ReadListFile(const char* filename_in,
     filenametoread = filename_in;
     }
 
-  if (external_in && filename_in)
-    {
-    filenametoread =
-      cmSystemTools::CollapseFullPath(filename_in,
-                                      this->cmStartDirectory.c_str());
-    }
-
   if (!filenametoread.empty())
     {
     this->cmCurrentListFile = filenametoread;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d4480a8c711a3d5971e100cc1a8984b6305c509
commit 5d4480a8c711a3d5971e100cc1a8984b6305c509
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:20 2015 +0200

    cmMakefile: Populate CMAKE_PARENT_LIST_FILE in callers.
    
    Because all external callers of this method pass a null first
    parameter, this change has no effect for them.
    
    This also makes it obvious that the CMAKE_PARENT_LIST_FILE is set to
    the name of the file being read itself for CMakeLists.txt files,
    which may not make any sense.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9a57223..7f4fbc1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -524,12 +524,14 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
 
 bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
 {
+  this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile);
   return this->ReadListFile(listfile, 0, true,
                             this->cmStartDirectory == this->cmHomeDirectory);
 }
 
 bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
 {
+  this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile());
   return this->ReadListFile(this->GetCurrentListFile(), listfile,
                             noPolicyScope);
 }
@@ -572,7 +574,6 @@ bool cmMakefile::ReadListFile(const char* filename_in,
   std::string currentFile
     = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE");
 
-  this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in);
   this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
 
   bool res = this->ReadListFileInternal(filenametoread.c_str(),

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a8ac2423ef658e87e366a143428835be48bf88f
commit 3a8ac2423ef658e87e366a143428835be48bf88f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:19 2015 +0200

    cmMakefile: Collapse nested conditional.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 851e407..9a57223 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -548,14 +548,11 @@ bool cmMakefile::ReadListFile(const char* filename_in,
     filenametoread = filename_in;
     }
 
-  if (external_in)
+  if (external_in && filename_in)
     {
-    if (filename_in)
-      {
-      filenametoread =
-        cmSystemTools::CollapseFullPath(filename_in,
-                                        this->cmStartDirectory.c_str());
-      }
+    filenametoread =
+      cmSystemTools::CollapseFullPath(filename_in,
+                                      this->cmStartDirectory.c_str());
     }
 
   if (!filenametoread.empty())

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5947d9b031444b48a7d7a9c70ef02d2333aeabee
commit 5947d9b031444b48a7d7a9c70ef02d2333aeabee
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:36 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:19 2015 +0200

    cmMakefile: Convert filenametoread into a std::string.
    
    Remove other intermediate variables.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index eeba6aa..851e407 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -542,34 +542,32 @@ bool cmMakefile::ReadListFile(const char* filename_in,
                               bool noPolicyScope,
                               bool requireProjectCommand)
 {
-  std::string external_abs;
-
-  const char* filenametoread = filename_in;
-  std::string filename_abs;
+  std::string filenametoread;
+  if (filename_in)
+    {
+    filenametoread = filename_in;
+    }
 
   if (external_in)
     {
     if (filename_in)
       {
-      filename_abs =
+      filenametoread =
         cmSystemTools::CollapseFullPath(filename_in,
                                         this->cmStartDirectory.c_str());
-      filenametoread = filename_abs.c_str();
       }
     }
 
-  if (filenametoread)
+  if (!filenametoread.empty())
     {
     this->cmCurrentListFile = filenametoread;
     }
 
   if (external_in)
     {
-    external_abs =
+    filenametoread =
       cmSystemTools::CollapseFullPath(external_in,
                                       this->cmStartDirectory.c_str());
-
-    filenametoread = external_abs.c_str();
     }
 
   std::string currentParentFile
@@ -580,7 +578,7 @@ bool cmMakefile::ReadListFile(const char* filename_in,
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in);
   this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
 
-  bool res = this->ReadListFileInternal(filenametoread,
+  bool res = this->ReadListFileInternal(filenametoread.c_str(),
                                         noPolicyScope, requireProjectCommand);
 
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2d0e0fbeb1bf7b43dc55ce55c6000819d108aee
commit e2d0e0fbeb1bf7b43dc55ce55c6000819d108aee
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:35 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:19 2015 +0200

    cmMakefile: Remove intermediate variable.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 037d697..eeba6aa 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -542,7 +542,6 @@ bool cmMakefile::ReadListFile(const char* filename_in,
                               bool noPolicyScope,
                               bool requireProjectCommand)
 {
-  const char* external = 0;
   std::string external_abs;
 
   const char* filenametoread = filename_in;
@@ -569,9 +568,8 @@ bool cmMakefile::ReadListFile(const char* filename_in,
     external_abs =
       cmSystemTools::CollapseFullPath(external_in,
                                       this->cmStartDirectory.c_str());
-    external = external_abs.c_str();
 
-    filenametoread= external;
+    filenametoread = external_abs.c_str();
     }
 
   std::string currentParentFile

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a1ad1713f87ed7219c934dcb32c4d41573807c4
commit 3a1ad1713f87ed7219c934dcb32c4d41573807c4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:35 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:19 2015 +0200

    cmMakefile: Combine duplicate condition.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 042ffc0..037d697 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -570,10 +570,7 @@ bool cmMakefile::ReadListFile(const char* filename_in,
       cmSystemTools::CollapseFullPath(external_in,
                                       this->cmStartDirectory.c_str());
     external = external_abs.c_str();
-    }
 
-  if(external_in)
-    {
     filenametoread= external;
     }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0dae032ee44283d08869c2a948f001dc211bfd5
commit f0dae032ee44283d08869c2a948f001dc211bfd5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:35 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:19 2015 +0200

    cmMakefile: Re-order independent statements.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5ab1928..042ffc0 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -559,6 +559,11 @@ bool cmMakefile::ReadListFile(const char* filename_in,
       }
     }
 
+  if (filenametoread)
+    {
+    this->cmCurrentListFile = filenametoread;
+    }
+
   if (external_in)
     {
     external_abs =
@@ -567,12 +572,6 @@ bool cmMakefile::ReadListFile(const char* filename_in,
     external = external_abs.c_str();
     }
 
-  // keep track of the current file being read
-  if (filenametoread)
-    {
-    this->cmCurrentListFile = filenametoread;
-    }
-
   if(external_in)
     {
     filenametoread= external;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08da8742709d6da74d1a17de46990ec5aaf3ad0f
commit 08da8742709d6da74d1a17de46990ec5aaf3ad0f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:34 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:19 2015 +0200

    cmMakefile: Split a conditional.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 029fd3d..5ab1928 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -557,6 +557,10 @@ bool cmMakefile::ReadListFile(const char* filename_in,
                                         this->cmStartDirectory.c_str());
       filenametoread = filename_abs.c_str();
       }
+    }
+
+  if (external_in)
+    {
     external_abs =
       cmSystemTools::CollapseFullPath(external_in,
                                       this->cmStartDirectory.c_str());

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3dc4fe02e63422532486320739e0cf4abddaa270
commit 3dc4fe02e63422532486320739e0cf4abddaa270
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:34 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:19 2015 +0200

    cmMakefile: Re-order independent variable setting.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ac71ea5..029fd3d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -550,10 +550,6 @@ bool cmMakefile::ReadListFile(const char* filename_in,
 
   if (external_in)
     {
-    external_abs =
-      cmSystemTools::CollapseFullPath(external_in,
-                                      this->cmStartDirectory.c_str());
-    external = external_abs.c_str();
     if (filename_in)
       {
       filename_abs =
@@ -561,6 +557,10 @@ bool cmMakefile::ReadListFile(const char* filename_in,
                                         this->cmStartDirectory.c_str());
       filenametoread = filename_abs.c_str();
       }
+    external_abs =
+      cmSystemTools::CollapseFullPath(external_in,
+                                      this->cmStartDirectory.c_str());
+    external = external_abs.c_str();
     }
 
   // keep track of the current file being read

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4f8f1f1b706d7efc9964826ff4572d27a3062d3
commit e4f8f1f1b706d7efc9964826ff4572d27a3062d3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:34 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:18 2015 +0200

    cmMakefile: Remove intermediate variable.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 46a10a9..ac71ea5 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -545,7 +545,7 @@ bool cmMakefile::ReadListFile(const char* filename_in,
   const char* external = 0;
   std::string external_abs;
 
-  const char* filename = filename_in;
+  const char* filenametoread = filename_in;
   std::string filename_abs;
 
   if (external_in)
@@ -559,12 +559,10 @@ bool cmMakefile::ReadListFile(const char* filename_in,
       filename_abs =
         cmSystemTools::CollapseFullPath(filename_in,
                                         this->cmStartDirectory.c_str());
-      filename = filename_abs.c_str();
+      filenametoread = filename_abs.c_str();
       }
     }
 
-  const char *filenametoread = filename;
-
   // keep track of the current file being read
   if (filenametoread)
     {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d6121a9a709e319cca733787bcc21bac593a232
commit 2d6121a9a709e319cca733787bcc21bac593a232
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:34 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:18 2015 +0200

    cmMakefile: Remove use of intermediate variable.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 67138ba..46a10a9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -566,9 +566,9 @@ bool cmMakefile::ReadListFile(const char* filename_in,
   const char *filenametoread = filename;
 
   // keep track of the current file being read
-  if (filename)
+  if (filenametoread)
     {
-    this->cmCurrentListFile = filename;
+    this->cmCurrentListFile = filenametoread;
     }
 
   if(external_in)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bdd4c5f5ba6d3bf60b4e3bc620b146784e1559f1
commit bdd4c5f5ba6d3bf60b4e3bc620b146784e1559f1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:33 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:18 2015 +0200

    cmMakefile: Move variable definition above a condition.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index bb0b8cb..67138ba 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -563,15 +563,14 @@ bool cmMakefile::ReadListFile(const char* filename_in,
       }
     }
 
+  const char *filenametoread = filename;
+
   // keep track of the current file being read
   if (filename)
     {
     this->cmCurrentListFile = filename;
     }
 
-  // Now read the input file
-  const char *filenametoread= filename;
-
   if(external_in)
     {
     filenametoread= external;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=524ce895427557312eef52d837f0afdb39a0dab6
commit 524ce895427557312eef52d837f0afdb39a0dab6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:33 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:18 2015 +0200

    cmMakefile: Change condition to its equivalent.
    
    This makes it easier to reason about follow-up commits.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index dafbfef..bb0b8cb 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -572,7 +572,7 @@ bool cmMakefile::ReadListFile(const char* filename_in,
   // Now read the input file
   const char *filenametoread= filename;
 
-  if( external)
+  if(external_in)
     {
     filenametoread= external;
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=813cd719c41b05df7a22ad3ebd267cc9bfc2505e
commit 813cd719c41b05df7a22ad3ebd267cc9bfc2505e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:33 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:18 2015 +0200

    cmMakefile: Determine the file to read before calling Internal.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 38e94e2..dafbfef 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -542,41 +542,6 @@ bool cmMakefile::ReadListFile(const char* filename_in,
                               bool noPolicyScope,
                               bool requireProjectCommand)
 {
-  std::string currentParentFile
-      = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
-  std::string currentFile
-    = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE");
-
-  this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in);
-  this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
-
-  bool res = this->ReadListFileInternal(filename_in, external_in,
-                                        noPolicyScope, requireProjectCommand);
-
-  this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
-  this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
-  this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
-                      cmSystemTools::GetFilenamePath(currentFile).c_str());
-  this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
-  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
-  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
-
-  this->ListFileStack.pop_back();
-
-  if (res)
-    {
-    // Check for unused variables
-    this->CheckForUnusedVariables();
-    }
-
-  return res;
-}
-
-bool cmMakefile::ReadListFileInternal(const char* filename_in,
-                                      const char* external_in,
-                                      bool noPolicyScope,
-                                      bool requireProjectCommand)
-{
   const char* external = 0;
   std::string external_abs;
 
@@ -612,6 +577,40 @@ bool cmMakefile::ReadListFileInternal(const char* filename_in,
     filenametoread= external;
     }
 
+  std::string currentParentFile
+      = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
+  std::string currentFile
+    = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE");
+
+  this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in);
+  this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
+
+  bool res = this->ReadListFileInternal(filenametoread,
+                                        noPolicyScope, requireProjectCommand);
+
+  this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
+  this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
+  this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
+                      cmSystemTools::GetFilenamePath(currentFile).c_str());
+  this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
+  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
+  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
+
+  this->ListFileStack.pop_back();
+
+  if (res)
+    {
+    // Check for unused variables
+    this->CheckForUnusedVariables();
+    }
+
+  return res;
+}
+
+bool cmMakefile::ReadListFileInternal(const char* filenametoread,
+                                      bool noPolicyScope,
+                                      bool requireProjectCommand)
+{
   this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread);
   this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
   this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 88faed9..2664d8e 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -992,8 +992,8 @@ private:
   void Initialize();
 
 
-  bool ReadListFileInternal(const char* filename_in,
-                            const char* external_in,
+
+  bool ReadListFileInternal(const char* filenametoread,
                             bool noPolicyScope,
                             bool requireProjectCommand);
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c201f1ee6cc19e0f1871048a6a6af9056c5780f
commit 5c201f1ee6cc19e0f1871048a6a6af9056c5780f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:33 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:18 2015 +0200

    cmMakefile: Remove duplication in ReadListFile.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0211591..38e94e2 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -542,8 +542,34 @@ bool cmMakefile::ReadListFile(const char* filename_in,
                               bool noPolicyScope,
                               bool requireProjectCommand)
 {
-  return this->ReadListFileInternal(filename_in, external_in,
-                                    noPolicyScope, requireProjectCommand);
+  std::string currentParentFile
+      = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
+  std::string currentFile
+    = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE");
+
+  this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in);
+  this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
+
+  bool res = this->ReadListFileInternal(filename_in, external_in,
+                                        noPolicyScope, requireProjectCommand);
+
+  this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
+  this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
+  this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
+                      cmSystemTools::GetFilenamePath(currentFile).c_str());
+  this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
+  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
+  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
+
+  this->ListFileStack.pop_back();
+
+  if (res)
+    {
+    // Check for unused variables
+    this->CheckForUnusedVariables();
+    }
+
+  return res;
 }
 
 bool cmMakefile::ReadListFileInternal(const char* filename_in,
@@ -551,13 +577,6 @@ bool cmMakefile::ReadListFileInternal(const char* filename_in,
                                       bool noPolicyScope,
                                       bool requireProjectCommand)
 {
-  std::string currentParentFile
-    = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
-  std::string currentFile
-    = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE");
-  this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in);
-  this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
-
   const char* external = 0;
   std::string external_abs;
 
@@ -604,15 +623,6 @@ bool cmMakefile::ReadListFileInternal(const char* filename_in,
   cmListFile cacheFile;
   if( !cacheFile.ParseFile(filenametoread, requireProjectCommand, this) )
     {
-    // pop the listfile off the stack
-    this->ListFileStack.pop_back();
-    this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
-    this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
-    this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
-    this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
-    this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
-                        cmSystemTools::GetFilenamePath(currentFile).c_str());
-    this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
     return false;
     }
   // add this list file to the list of dependencies
@@ -651,20 +661,6 @@ bool cmMakefile::ReadListFileInternal(const char* filename_in,
     this->EnforceDirectoryLevelRules();
     }
 
-  this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
-  this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
-  this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
-  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
-  this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
-                      cmSystemTools::GetFilenamePath(currentFile).c_str());
-  this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
-
-  // pop the listfile off the stack
-  this->ListFileStack.pop_back();
-
-  // Check for unused variables
-  this->CheckForUnusedVariables();
-
   return true;
 }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d9555779d7bd2a8d068f5b9af431bcf9673453a
commit 0d9555779d7bd2a8d068f5b9af431bcf9673453a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:32 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:17 2015 +0200

    cmMakefile: Delegate ListFile reading to internal method.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2b4b896..0211591 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -542,6 +542,15 @@ bool cmMakefile::ReadListFile(const char* filename_in,
                               bool noPolicyScope,
                               bool requireProjectCommand)
 {
+  return this->ReadListFileInternal(filename_in, external_in,
+                                    noPolicyScope, requireProjectCommand);
+}
+
+bool cmMakefile::ReadListFileInternal(const char* filename_in,
+                                      const char* external_in,
+                                      bool noPolicyScope,
+                                      bool requireProjectCommand)
+{
   std::string currentParentFile
     = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
   std::string currentFile
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 3d925fa..88faed9 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -991,6 +991,12 @@ protected:
 private:
   void Initialize();
 
+
+  bool ReadListFileInternal(const char* filename_in,
+                            const char* external_in,
+                            bool noPolicyScope,
+                            bool requireProjectCommand);
+
   bool ParseDefineFlag(std::string const& definition, bool remove);
 
   bool EnforceUniqueDir(const std::string& srcPath,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=846608f2678b4bced696857b5ca45e11bc86aa2c
commit 846608f2678b4bced696857b5ca45e11bc86aa2c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:32 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:17 2015 +0200

    cmMakefile: Remove useless condition.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 29e564f..2b4b896 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -573,10 +573,7 @@ bool cmMakefile::ReadListFile(const char* filename_in,
   // keep track of the current file being read
   if (filename)
     {
-    if(this->cmCurrentListFile != filename)
-      {
-      this->cmCurrentListFile = filename;
-      }
+    this->cmCurrentListFile = filename;
     }
 
   // Now read the input file

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2f2aeee2f4d4af1f25f4a5b86bacb8a81a7dec4
commit a2f2aeee2f4d4af1f25f4a5b86bacb8a81a7dec4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:32 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:17 2015 +0200

    cmMakefile: Add wrapper for reading listfiles which have an origin.
    
    Such files are delegates from other files, and so they set the
    CMAKE_PARENT_LIST_FILE to the originator.  They also may set a
    policy scope.

diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index c50ea88..59c5e92 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -117,9 +117,7 @@ bool cmCTestSubdirCommand
       }
     fname += "/";
     fname += testFilename;
-    bool readit =
-      this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(),
-                                   fname.c_str());
+    bool readit = this->Makefile->ReadDependentFile(fname.c_str());
     cmSystemTools::ChangeDirectory(cwd);
     if(!readit)
       {
@@ -205,9 +203,7 @@ bool cmCTestAddSubdirectoryCommand
     }
   fname += "/";
   fname += testFilename;
-  bool readit =
-    this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(),
-                                 fname.c_str());
+  bool readit = this->Makefile->ReadDependentFile(fname.c_str());
   cmSystemTools::ChangeDirectory(cwd);
   if(!readit)
     {
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index cd2cd7c..91ae889 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -687,8 +687,7 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
     {
     cmCTestOptionalLog(this, OUTPUT, "   Reading ctest configuration file: "
       << fname << std::endl, command->ShouldBeQuiet());
-    bool readit = mf->ReadListFile(mf->GetCurrentListFile(),
-      fname.c_str() );
+    bool readit = mf->ReadDependentFile(fname.c_str());
     if(!readit)
       {
       std::string m = "Could not find include file: ";
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index af99b1c..aecd230 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -999,8 +999,8 @@ bool cmFindPackageCommand::FindAppBundleConfig()
 //----------------------------------------------------------------------------
 bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr)
 {
-  if(this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), f,
-                                  !this->PolicyScope || psr == NoPolicyScope))
+  const bool noPolicyScope = !this->PolicyScope || psr == NoPolicyScope;
+  if(this->Makefile->ReadDependentFile(f, noPolicyScope))
     {
     return true;
     }
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index e2b2bbd..e268852 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -60,7 +60,7 @@ void cmGlobalVisualStudio6Generator::GenerateConfigurations(cmMakefile* mf)
     fname += "/Templates";
     }
   fname += "/CMakeVisualStudio6Configurations.cmake";
-  if(!mf->ReadListFile(mf->GetCurrentListFile(), fname.c_str()))
+  if(!mf->ReadDependentFile(fname.c_str()))
     {
     cmSystemTools::Error("Cannot open ", fname.c_str(),
                          ".  Please copy this file from the main "
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index 0c2e73a..18e3585 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -131,8 +131,7 @@ bool cmIncludeCommand
     }
 
   bool readit =
-    this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(),
-                                  fname.c_str(), noPolicyScope);
+    this->Makefile->ReadDependentFile(fname.c_str(), noPolicyScope);
 
   // add the location of the included file if a result variable was given
   if (!resultVarName.empty())
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b08725e..29e564f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -528,6 +528,12 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
                             this->cmStartDirectory == this->cmHomeDirectory);
 }
 
+bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
+{
+  return this->ReadListFile(this->GetCurrentListFile(), listfile,
+                            noPolicyScope);
+}
+
 //----------------------------------------------------------------------------
 // Parse the given CMakeLists.txt file executing all commands
 //
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 33c4b20..3d925fa 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -90,6 +90,8 @@ public:
                     bool noPolicyScope = true,
                     bool requireProjectCommand = false);
 
+  bool ReadDependentFile(const char* listfile, bool noPolicyScope = true);
+
   bool ProcessBuildsystemFile(const char* listfile);
 
   /**
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 601dc54..43b02bc 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -236,8 +236,7 @@ bool cmProjectCommand
     {
     std::string fullFilePath;
     bool readit =
-      this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(),
-                                    include);
+      this->Makefile->ReadDependentFile(include);
     if(!readit && !cmSystemTools::GetFatalErrorOccured())
       {
       std::string m =

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68f791cd06983e8fd375edfba74a9d821231e269
commit 68f791cd06983e8fd375edfba74a9d821231e269
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:31 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:17 2015 +0200

    cmMakefile: Add a method for processing buildsystem files.
    
    These are different from other ListFiles in that a project() command is
    required if it is top-level.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index c143bce..56e17ec 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -181,7 +181,7 @@ void cmLocalGenerator::ReadInputFile()
   currentStart += "/CMakeLists.txt";
   if(cmSystemTools::FileExists(currentStart.c_str(), true))
     {
-    this->Makefile->ReadListFile(currentStart.c_str());
+    this->Makefile->ProcessBuildsystemFile(currentStart.c_str());
     return;
     }
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8bc4ac8..b08725e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -522,12 +522,19 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
     }
 }
 
+bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
+{
+  return this->ReadListFile(listfile, 0, true,
+                            this->cmStartDirectory == this->cmHomeDirectory);
+}
+
 //----------------------------------------------------------------------------
 // Parse the given CMakeLists.txt file executing all commands
 //
 bool cmMakefile::ReadListFile(const char* filename_in,
                               const char *external_in,
-                              bool noPolicyScope)
+                              bool noPolicyScope,
+                              bool requireProjectCommand)
 {
   std::string currentParentFile
     = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
@@ -580,21 +587,6 @@ bool cmMakefile::ReadListFile(const char* filename_in,
                        cmSystemTools::GetFilenamePath(filenametoread).c_str());
   this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
 
-  // try to see if the list file is the top most
-  // list file for a project, and if it is, then it
-  // must have a project command.   If there is not
-  // one, then cmake will provide one via the
-  // cmListFileCache class.
-  bool requireProjectCommand = false;
-  if(!external && this->cmStartDirectory == this->cmHomeDirectory)
-    {
-    if(cmSystemTools::LowerCase(
-      cmSystemTools::GetFilenameName(filename)) == "cmakelists.txt")
-      {
-      requireProjectCommand = true;
-      }
-    }
-
   // push the listfile onto the stack
   this->ListFileStack.push_back(filenametoread);
   cmListFile cacheFile;
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index ce21c60..33c4b20 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -87,7 +87,10 @@ public:
    */
   bool ReadListFile(const char* listfile,
                     const char* external= 0,
-                    bool noPolicyScope = true);
+                    bool noPolicyScope = true,
+                    bool requireProjectCommand = false);
+
+  bool ProcessBuildsystemFile(const char* listfile);
 
   /**
    * Add a function blocker to this makefile

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5bb4248a807029053156dbf4a3cdba4427766306
commit 5bb4248a807029053156dbf4a3cdba4427766306
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:31 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:29:17 2015 +0200

    cmMakefile: Remove fullPath parameter from ReadListFile.
    
    There is no reason for this to be a responsibility of
    ReadListFile.  Additionally, the only user of it already computes
    it itself.

diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index e1074b0..af99b1c 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -999,7 +999,7 @@ bool cmFindPackageCommand::FindAppBundleConfig()
 //----------------------------------------------------------------------------
 bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr)
 {
-  if(this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), f, 0,
+  if(this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), f,
                                   !this->PolicyScope || psr == NoPolicyScope))
     {
     return true;
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index c15d46e..0c2e73a 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -130,17 +130,15 @@ bool cmIncludeCommand
     gg->GenerateImportFile(fname_abs);
     }
 
-  std::string fullFilePath;
   bool readit =
     this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(),
-                                  fname.c_str(), &fullFilePath,
-                                  noPolicyScope);
+                                  fname.c_str(), noPolicyScope);
 
   // add the location of the included file if a result variable was given
   if (!resultVarName.empty())
     {
       this->Makefile->AddDefinition(resultVarName,
-                                    readit?fullFilePath.c_str():"NOTFOUND");
+                                    readit?fname_abs.c_str():"NOTFOUND");
     }
 
   if(!optional && !readit && !cmSystemTools::GetFatalErrorOccured())
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 205508b..8bc4ac8 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -527,7 +527,6 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
 //
 bool cmMakefile::ReadListFile(const char* filename_in,
                               const char *external_in,
-                              std::string* fullPath,
                               bool noPolicyScope)
 {
   std::string currentParentFile
@@ -598,19 +597,11 @@ bool cmMakefile::ReadListFile(const char* filename_in,
 
   // push the listfile onto the stack
   this->ListFileStack.push_back(filenametoread);
-  if(fullPath!=0)
-    {
-    *fullPath=filenametoread;
-    }
   cmListFile cacheFile;
   if( !cacheFile.ParseFile(filenametoread, requireProjectCommand, this) )
     {
     // pop the listfile off the stack
     this->ListFileStack.pop_back();
-    if(fullPath!=0)
-      {
-      *fullPath = "";
-      }
     this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
     this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
     this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 299d550..ce21c60 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -87,7 +87,6 @@ public:
    */
   bool ReadListFile(const char* listfile,
                     const char* external= 0,
-                    std::string* fullPath= 0,
                     bool noPolicyScope = true);
 
   /**

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc7ab8874b0e5c2c010fb73718ae8702b8853ca0
commit fc7ab8874b0e5c2c010fb73718ae8702b8853ca0
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 18 14:50:31 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Apr 18 15:26:12 2015 +0200

    CPack: Read the config listfile in the normal way.
    
    This is a unique function call in CMake, and it was likely a
    programming error when introduced.  All other similar calls to
    ReadListFile use a null first paramter.
    
    The effect of this patch is to no-longer define CMAKE_PARENT_LIST_FILE
    to the config file itself while evaluating it.
    
    The ReadListFile method also no longer hits a condition that it uses
    CollapseFullPath on the input file.  However, as cpack does not
    set the StartDirectory anyway, this has no effect. See bug 15522.

diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 4f37041..a2edab5 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1163,7 +1163,7 @@ int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf)
     this->GetOption("CPACK_PROJECT_CONFIG_FILE");
   if(config)
     {
-    mf->ReadListFile(config);
+    mf->ReadListFile(0, config);
     }
   int result = this->InitializeInternal();
   if (cmSystemTools::GetErrorOccuredFlag())

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

Summary of changes:
 Source/CPack/cmCPackGenerator.cxx         |    6 +-
 Source/CPack/cpack.cxx                    |    6 +-
 Source/CTest/cmCTestLaunch.cxx            |    2 +-
 Source/CTest/cmCTestScriptHandler.cxx     |    4 +-
 Source/CTest/cmCTestTestHandler.cxx       |   10 +-
 Source/cmCTest.cxx                        |    7 +-
 Source/cmFindPackageCommand.cxx           |    4 +-
 Source/cmGlobalGenerator.cxx              |   24 ++---
 Source/cmGlobalVisualStudio6Generator.cxx |    2 +-
 Source/cmGraphVizWriter.cxx               |    2 +-
 Source/cmIncludeCommand.cxx               |    7 +-
 Source/cmLocalGenerator.cxx               |    2 +-
 Source/cmLocalUnixMakefileGenerator3.cxx  |    4 +-
 Source/cmMakefile.cxx                     |  141 +++++++++++------------------
 Source/cmMakefile.h                       |   15 ++-
 Source/cmProjectCommand.cxx               |    3 +-
 Source/cmQtAutoGenerators.cxx             |    4 +-
 Source/cmake.cxx                          |    6 +-
 18 files changed, 106 insertions(+), 143 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list