summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmMakefile.cxx3
-rw-r--r--Tests/FindPackageTest/FindLotsOfComponents.cmake2
-rw-r--r--Tests/FindPackageTest/FindSomePackage.cmake2
-rw-r--r--Tests/FindPackageTest/FindUpperCasePackage.cmake2
4 files changed, 5 insertions, 4 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))
{
diff --git a/Tests/FindPackageTest/FindLotsOfComponents.cmake b/Tests/FindPackageTest/FindLotsOfComponents.cmake
index 9076d86..5d959c5 100644
--- a/Tests/FindPackageTest/FindLotsOfComponents.cmake
+++ b/Tests/FindPackageTest/FindLotsOfComponents.cmake
@@ -4,7 +4,7 @@ set(LotsOfComponents_AComp_FOUND TRUE)
set(LotsOfComponents_BComp_FOUND FALSE)
set(LotsOfComponents_CComp_FOUND TRUE)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(LotsOfComponents REQUIRED_VARS LOC_FOO
HANDLE_COMPONENTS)
diff --git a/Tests/FindPackageTest/FindSomePackage.cmake b/Tests/FindPackageTest/FindSomePackage.cmake
index 83d1d0e..7283d24 100644
--- a/Tests/FindPackageTest/FindSomePackage.cmake
+++ b/Tests/FindPackageTest/FindSomePackage.cmake
@@ -1,6 +1,6 @@
set(SOP_FOO TRUE)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(SomePackage REQUIRED_VARS SOP_FOO
FOUND_VAR SomePackage_FOUND )
diff --git a/Tests/FindPackageTest/FindUpperCasePackage.cmake b/Tests/FindPackageTest/FindUpperCasePackage.cmake
index 66c2fea..425d417 100644
--- a/Tests/FindPackageTest/FindUpperCasePackage.cmake
+++ b/Tests/FindPackageTest/FindUpperCasePackage.cmake
@@ -1,6 +1,6 @@
set(UCP_FOO TRUE)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(UpperCasePackage REQUIRED_VARS UCP_FOO
FOUND_VAR UPPERCASEPACKAGE_FOUND )