summaryrefslogtreecommitdiff
path: root/Source/cmCommandArgumentParserHelper.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2010-09-02 11:30:28 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2010-09-02 11:33:34 -0400
commit300fc15779330a1b733c9e1a19d24d682a3b4a91 (patch)
tree3c33c826f0d0d02c0d1215804f66b4304db29420 /Source/cmCommandArgumentParserHelper.cxx
parentd784e6af4d292e5ffee4b43b7ee740d1fa8e2e29 (diff)
downloadcmake-300fc15779330a1b733c9e1a19d24d682a3b4a91.tar.gz
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.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index e9381d4c63..c0a8127f6c 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 << ":" <<