diff options
author | Brad King <brad.king@kitware.com> | 2014-03-04 14:28:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-04 14:35:00 (GMT) |
commit | 7e187eeacd609c18940aa7cd700b048f72fd5568 (patch) | |
tree | 4d69b0d0052792039f057489cfef2d4bb8c851b3 /Source | |
parent | 8982a4b30161e90ac6b3f7db11c3c6772835e9f6 (diff) | |
download | CMake-7e187eeacd609c18940aa7cd700b048f72fd5568.zip CMake-7e187eeacd609c18940aa7cd700b048f72fd5568.tar.gz CMake-7e187eeacd609c18940aa7cd700b048f72fd5568.tar.bz2 |
CMP0017: Fix check when including from CMake source tree
When running CMake from the build tree the CMAKE_ROOT is the
entire source tree. Fix the CMP0017 check to be specific to
the Modules/ directory under CMAKE_ROOT so that Tests/ does
not count. Fix the FindPackageTest modules to include FPHSA
by full path from CMAKE_ROOT so that they do not include the
local FPHSA which reports an error meant to test that CMP0017
works.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefile.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index f248c57..556e7a4 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3337,7 +3337,8 @@ std::string cmMakefile::GetModulesFile(const char* filename) const if ((moduleInCMakeModulePath.size()>0) && (moduleInCMakeRoot.size()>0)) { const char* currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE"); - if (currentFile && (strstr(currentFile, cmakeRoot) == currentFile)) + std::string mods = cmakeRoot + std::string("/Modules/"); + if (currentFile && strncmp(currentFile, mods.c_str(), mods.size()) == 0) { switch (this->GetPolicyStatus(cmPolicies::CMP0017)) { |