Browse Source

Factor cmLocalGenerator::Configure input file read

This method tells the cmMakefile to read the input CMakeLists.txt file.
We factor out the call into a ReadInputFile method so it can be extended
without polluting the Configure method.
Brad King 16 years ago
parent
commit
3fda5c6463
2 changed files with 12 additions and 3 deletions
  1. 9 3
      Source/cmLocalGenerator.cxx
  2. 3 0
      Source/cmLocalGenerator.h

+ 9 - 3
Source/cmLocalGenerator.cxx

@@ -99,9 +99,7 @@ void cmLocalGenerator::Configure()
   cmSystemTools::MakeDirectory(filesDir.c_str());
   
   // find & read the list file
-  std::string currentStart = this->Makefile->GetStartDirectory();
-  currentStart += "/CMakeLists.txt";
-  this->Makefile->ReadListFile(currentStart.c_str());
+  this->ReadInputFile();
 
   // at the end of the ReadListFile handle any old style subdirs
   // first get all the subdirectories
@@ -166,6 +164,14 @@ void cmLocalGenerator::ComputeObjectMaxPath()
   this->ObjectMaxPathViolations.clear();
 }
 
+//----------------------------------------------------------------------------
+void cmLocalGenerator::ReadInputFile()
+{
+  std::string currentStart = this->Makefile->GetStartDirectory();
+  currentStart += "/CMakeLists.txt";
+  this->Makefile->ReadListFile(currentStart.c_str());
+}
+
 void cmLocalGenerator::SetupPathConversions()
 {  
   // Setup the current output directory components for use by

+ 3 - 0
Source/cmLocalGenerator.h

@@ -365,6 +365,9 @@ protected:
       definition.  Issues a warning.  */
   virtual bool CheckDefinition(std::string const& define) const;
 
+  /** Read the input CMakeLists.txt file.  */
+  void ReadInputFile();
+
   cmMakefile *Makefile;
   cmGlobalGenerator *GlobalGenerator;
   // members used for relative path function ConvertToMakefilePath