Explorar o código

cmMakefile: Use method abstraction to access directories.

Stephen Kelly %!s(int64=10) %!d(string=hai) anos
pai
achega
0f3c8cfa96
Modificáronse 1 ficheiros con 8 adicións e 7 borrados
  1. 8 7
      Source/cmMakefile.cxx

+ 8 - 7
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();