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/cmMakefile.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/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
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 << "\'"; |