cmMakefile: Port CurrentListFile clients to GetDefinition.

There is no need to store this as a member variable.
This commit is contained in:
Stephen Kelly 2015-05-14 23:47:40 +02:00
parent 594dd9b36a
commit 6b9e647239
3 changed files with 7 additions and 4 deletions

View File

@ -182,7 +182,9 @@ void cmExtraQbsGenerator::AppendSources(cmGeneratedFileStream &fout,
std::vector<cmSourceFile *> genSources; std::vector<cmSourceFile *> genSources;
std::vector<cmSourceFile *>::const_iterator itr = sources.begin(); std::vector<cmSourceFile *>::const_iterator itr = sources.begin();
fout << "\t\t\tfiles: [\n" fout << "\t\t\tfiles: [\n"
<< "\t\t\t\t\"" << t.GetMakefile()->GetCurrentListFile() << "\",\n"; << "\t\t\t\t\""
<< t.GetMakefile()->GetDefinition("CMAKE_CURRENT_LIST_FILE")
<< "\",\n";
for (; itr != sources.end(); ++itr) for (; itr != sources.end(); ++itr)
{ {
if (!(*itr)->GetPropertyAsBool("GENERATED")) if (!(*itr)->GetPropertyAsBool("GENERATED"))

View File

@ -305,8 +305,8 @@ void cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os)
cmGlobalNinjaGenerator::WriteDivider(os); cmGlobalNinjaGenerator::WriteDivider(os);
os os
<< "# Write statements declared in CMakeLists.txt:" << std::endl << "# Write statements declared in CMakeLists.txt:" << std::endl
<< "# " << this->Makefile->GetCurrentListFile() << std::endl << "# "
; << this->Makefile->GetDefinition("CMAKE_CURRENT_LIST_FILE") << std::endl;
if(this->IsRootMakefile()) if(this->IsRootMakefile())
os << "# Which is the root file." << std::endl; os << "# Which is the root file." << std::endl;
cmGlobalNinjaGenerator::WriteDivider(os); cmGlobalNinjaGenerator::WriteDivider(os);

View File

@ -609,7 +609,8 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope) bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
{ {
this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile()); this->AddDefinition("CMAKE_PARENT_LIST_FILE",
this->GetDefinition("CMAKE_CURRENT_LIST_FILE"));
this->cmCurrentListFile = this->cmCurrentListFile =
cmSystemTools::CollapseFullPath(listfile, cmSystemTools::CollapseFullPath(listfile,
this->GetCurrentSourceDirectory()); this->GetCurrentSourceDirectory());