diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index e1074b0ef..af99b1c32 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 c15d46efe..0c2e73ac5 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 205508bca..8bc4ac8a1 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 299d550a2..ce21c60d4 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); /**