cmMakefile: Use method abstraction to access directories.

This commit is contained in:
Stephen Kelly 2015-04-16 22:37:08 +02:00 committed by Brad King
parent b288a997e9
commit 0f3c8cfa96

View File

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