Exempt CMAKE(CURRENT|PARENT)_LIST_FILE from usage

This commit is contained in:
Ben Boeckel 2010-09-16 17:50:07 -04:00
parent 6d7d449cb1
commit 2c82f2b759
1 changed files with 6 additions and 0 deletions

View File

@ -590,6 +590,7 @@ bool cmMakefile::ReadListFile(const char* filename_in,
std::string currentFile std::string currentFile
= this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE"); = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE");
this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in); this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in);
this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
const char* external = 0; const char* external = 0;
std::string external_abs; std::string external_abs;
@ -630,6 +631,7 @@ bool cmMakefile::ReadListFile(const char* filename_in,
} }
this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread); this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread);
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
// try to see if the list file is the top most // try to see if the list file is the top most
// list file for a project, and if it is, then it // list file for a project, and if it is, then it
@ -662,7 +664,9 @@ bool cmMakefile::ReadListFile(const char* filename_in,
*fullPath = ""; *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->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
return false; return false;
} }
// add this list file to the list of dependencies // add this list file to the list of dependencies
@ -702,7 +706,9 @@ bool cmMakefile::ReadListFile(const char* filename_in,
} }
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->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
// pop the listfile off the stack // pop the listfile off the stack
this->ListFileStack.pop_back(); this->ListFileStack.pop_back();