cmMakefile: Remove fullPath parameter from ReadListFile.

There is no reason for this to be a responsibility of
ReadListFile.  Additionally, the only user of it already computes
it itself.
This commit is contained in:
Stephen Kelly 2015-04-18 14:50:31 +02:00
parent fc7ab8874b
commit 5bb4248a80
4 changed files with 3 additions and 15 deletions

View File

@ -999,7 +999,7 @@ bool cmFindPackageCommand::FindAppBundleConfig()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr) 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)) !this->PolicyScope || psr == NoPolicyScope))
{ {
return true; return true;

View File

@ -130,17 +130,15 @@ bool cmIncludeCommand
gg->GenerateImportFile(fname_abs); gg->GenerateImportFile(fname_abs);
} }
std::string fullFilePath;
bool readit = bool readit =
this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(), this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(),
fname.c_str(), &fullFilePath, fname.c_str(), noPolicyScope);
noPolicyScope);
// add the location of the included file if a result variable was given // add the location of the included file if a result variable was given
if (!resultVarName.empty()) if (!resultVarName.empty())
{ {
this->Makefile->AddDefinition(resultVarName, this->Makefile->AddDefinition(resultVarName,
readit?fullFilePath.c_str():"NOTFOUND"); readit?fname_abs.c_str():"NOTFOUND");
} }
if(!optional && !readit && !cmSystemTools::GetFatalErrorOccured()) if(!optional && !readit && !cmSystemTools::GetFatalErrorOccured())

View File

@ -527,7 +527,6 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
// //
bool cmMakefile::ReadListFile(const char* filename_in, bool cmMakefile::ReadListFile(const char* filename_in,
const char *external_in, const char *external_in,
std::string* fullPath,
bool noPolicyScope) bool noPolicyScope)
{ {
std::string currentParentFile std::string currentParentFile
@ -598,19 +597,11 @@ bool cmMakefile::ReadListFile(const char* filename_in,
// push the listfile onto the stack // push the listfile onto the stack
this->ListFileStack.push_back(filenametoread); this->ListFileStack.push_back(filenametoread);
if(fullPath!=0)
{
*fullPath=filenametoread;
}
cmListFile cacheFile; cmListFile cacheFile;
if( !cacheFile.ParseFile(filenametoread, requireProjectCommand, this) ) if( !cacheFile.ParseFile(filenametoread, requireProjectCommand, this) )
{ {
// pop the listfile off the stack // pop the listfile off the stack
this->ListFileStack.pop_back(); this->ListFileStack.pop_back();
if(fullPath!=0)
{
*fullPath = "";
}
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());

View File

@ -87,7 +87,6 @@ public:
*/ */
bool ReadListFile(const char* listfile, bool ReadListFile(const char* listfile,
const char* external= 0, const char* external= 0,
std::string* fullPath= 0,
bool noPolicyScope = true); bool noPolicyScope = true);
/** /**