diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2010-09-02 15:30:28 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2010-09-02 15:33:34 (GMT) |
commit | 300fc15779330a1b733c9e1a19d24d682a3b4a91 (patch) | |
tree | 3c33c826f0d0d02c0d1215804f66b4304db29420 /Source/cmCommandArgumentParserHelper.cxx | |
parent | d784e6af4d292e5ffee4b43b7ee740d1fa8e2e29 (diff) | |
download | CMake-300fc15779330a1b733c9e1a19d24d682a3b4a91.zip CMake-300fc15779330a1b733c9e1a19d24d682a3b4a91.tar.gz CMake-300fc15779330a1b733c9e1a19d24d682a3b4a91.tar.bz2 |
Fix detection of system files
Instead of looking to see if the file is under CMAKE_ROOT, check to see
if it is instead under the source or binary directories in use.
Diffstat (limited to 'Source/cmCommandArgumentParserHelper.cxx')
-rw-r--r-- | Source/cmCommandArgumentParserHelper.cxx | 6 |
1 files changed, 4 insertions, 2 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 << ":" << |