diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-18 12:50:33 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-18 13:29:18 (GMT) |
commit | 813cd719c41b05df7a22ad3ebd267cc9bfc2505e (patch) | |
tree | ea98ce130a3346a18f31539b11ae6f5fcfb46d32 | |
parent | 5c201f1ee6cc19e0f1871048a6a6af9056c5780f (diff) | |
download | CMake-813cd719c41b05df7a22ad3ebd267cc9bfc2505e.zip CMake-813cd719c41b05df7a22ad3ebd267cc9bfc2505e.tar.gz CMake-813cd719c41b05df7a22ad3ebd267cc9bfc2505e.tar.bz2 |
cmMakefile: Determine the file to read before calling Internal.
-rw-r--r-- | Source/cmMakefile.cxx | 69 | ||||
-rw-r--r-- | Source/cmMakefile.h | 4 |
2 files changed, 36 insertions, 37 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 38e94e2..dafbfef 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -542,41 +542,6 @@ bool cmMakefile::ReadListFile(const char* filename_in, bool noPolicyScope, bool requireProjectCommand) { - std::string currentParentFile - = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE"); - std::string currentFile - = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE"); - - this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in); - this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); - - bool res = this->ReadListFileInternal(filename_in, external_in, - noPolicyScope, requireProjectCommand); - - this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); - this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); - this->AddDefinition("CMAKE_CURRENT_LIST_DIR", - cmSystemTools::GetFilenamePath(currentFile).c_str()); - this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); - this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); - this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); - - this->ListFileStack.pop_back(); - - if (res) - { - // Check for unused variables - this->CheckForUnusedVariables(); - } - - return res; -} - -bool cmMakefile::ReadListFileInternal(const char* filename_in, - const char* external_in, - bool noPolicyScope, - bool requireProjectCommand) -{ const char* external = 0; std::string external_abs; @@ -612,6 +577,40 @@ bool cmMakefile::ReadListFileInternal(const char* filename_in, filenametoread= external; } + std::string currentParentFile + = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE"); + std::string currentFile + = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE"); + + this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in); + this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); + + bool res = this->ReadListFileInternal(filenametoread, + noPolicyScope, requireProjectCommand); + + this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_DIR", + cmSystemTools::GetFilenamePath(currentFile).c_str()); + this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); + this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); + this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); + + this->ListFileStack.pop_back(); + + if (res) + { + // Check for unused variables + this->CheckForUnusedVariables(); + } + + return res; +} + +bool cmMakefile::ReadListFileInternal(const char* filenametoread, + bool noPolicyScope, + bool requireProjectCommand) +{ this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread); this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); this->AddDefinition("CMAKE_CURRENT_LIST_DIR", diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 88faed9..2664d8e 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -992,8 +992,8 @@ private: void Initialize(); - bool ReadListFileInternal(const char* filename_in, - const char* external_in, + + bool ReadListFileInternal(const char* filenametoread, bool noPolicyScope, bool requireProjectCommand); |