diff options
-rw-r--r-- | Source/cmCommandArgumentParserHelper.cxx | 6 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index e9381d4..c0a8127 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -130,8 +130,10 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) // not been "cleared"/initialized with a set(foo ) call if(this->WarnUninitialized && !this->Makefile->VariableInitialized(var)) { - const char* root = this->Makefile->GetDefinition("CMAKE_ROOT"); - if (this->CheckSystemVars || strstr(this->FileName, root) != this->FileName) + const char* srcRoot = this->Makefile->GetDefinition("CMAKE_SOURCE_DIR"); + const char* binRoot = this->Makefile->GetDefinition("CMAKE_BINARY_DIR"); + if (this->CheckSystemVars || strstr(this->FileName, srcRoot) == this->FileName || + strstr(this->FileName, binRoot) == this->FileName) { cmOStringStream msg; msg << this->FileName << ":" << this->FileLine << ":" << diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 288bc53..26b9a58 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3392,8 +3392,9 @@ void cmMakefile::PopScope() if (this->WarnUnused && usage.find(*it) == usage.end()) { const char* cdir = this->ListFileStack.back().c_str(); - const char* root = this->GetDefinition("CMAKE_ROOT"); - if (this->CheckSystemVars || strstr(cdir, root) != cdir) + const char* srcRoot = this->GetDefinition("CMAKE_SOURCE_DIR"); + const char* binRoot = this->GetDefinition("CMAKE_BINARY_DIR"); + if (this->CheckSystemVars || strstr(cdir, srcRoot) == cdir || strstr(cdir, binRoot) == cdir) { cmOStringStream m; m << "unused variable \'" << *it << "\'"; |