diff options
author | Silvio Traversaro <silvio.traversaro@iit.it> | 2016-08-20 10:06:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-24 13:40:25 (GMT) |
commit | 828d6c137d703ea095008fc6da794904a15c4ebd (patch) | |
tree | b4c0a6d0ef048e1d13de28637df1d74bd0784d08 /Source | |
parent | ff5c89de0c23c0568afcbabd63974388ca045aa3 (diff) | |
download | CMake-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.cxx | 38 |
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; } |