summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSilvio Traversaro <silvio.traversaro@iit.it>2016-08-20 10:06:55 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-24 13:40:25 (GMT)
commit828d6c137d703ea095008fc6da794904a15c4ebd (patch)
treeb4c0a6d0ef048e1d13de28637df1d74bd0784d08 /Source
parentff5c89de0c23c0568afcbabd63974388ca045aa3 (diff)
downloadCMake-828d6c137d703ea095008fc6da794904a15c4ebd.zip
CMake-828d6c137d703ea095008fc6da794904a15c4ebd.tar.gz
CMake-828d6c137d703ea095008fc6da794904a15c4ebd.tar.bz2
find_package: Extend search path for combined Windows/UNIX convention
Find packages that install their cmake package configuration files in `lib/cmake/<name>` when they are installed in the default Windows CMAKE_INSTALL_PREFIX, `C:/Program Files/<name>`. Closes: #16212
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFindPackageCommand.cxx38
1 files changed, 38 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 260079b..8338c2a 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1961,6 +1961,44 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
}
}
+ // PREFIX/(Foo|foo|FOO).*/(lib/ARCH|lib|share)/cmake/(Foo|foo|FOO).*/
+ {
+ cmFindPackageFileList lister(this);
+ lister / cmFileListGeneratorFixed(prefix) /
+ cmFileListGeneratorProject(this->Names) /
+ cmFileListGeneratorEnumerate(common) /
+ cmFileListGeneratorFixed("cmake") /
+ cmFileListGeneratorProject(this->Names);
+ if (lister.Search()) {
+ return true;
+ }
+ }
+
+ // PREFIX/(Foo|foo|FOO).*/(lib/ARCH|lib|share)/(Foo|foo|FOO).*/
+ {
+ cmFindPackageFileList lister(this);
+ lister / cmFileListGeneratorFixed(prefix) /
+ cmFileListGeneratorProject(this->Names) /
+ cmFileListGeneratorEnumerate(common) /
+ cmFileListGeneratorProject(this->Names);
+ if (lister.Search()) {
+ return true;
+ }
+ }
+
+ // PREFIX/(Foo|foo|FOO).*/(lib/ARCH|lib|share)/(Foo|foo|FOO).*/(cmake|CMake)/
+ {
+ cmFindPackageFileList lister(this);
+ lister / cmFileListGeneratorFixed(prefix) /
+ cmFileListGeneratorProject(this->Names) /
+ cmFileListGeneratorEnumerate(common) /
+ cmFileListGeneratorProject(this->Names) /
+ cmFileListGeneratorCaseInsensitive("cmake");
+ if (lister.Search()) {
+ return true;
+ }
+ }
+
return false;
}