diff options
author | Brad King <brad.king@kitware.com> | 2008-12-17 14:24:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-12-17 14:24:05 (GMT) |
commit | 3958b3e112b7c33d40129a16811a2eff69495a42 (patch) | |
tree | 4d525f2142dfba37efedd6eca78fdcb34453d67d /Source/cmFindPackageCommand.cxx | |
parent | d5c1191349778dd1c1d4646b28f8f532ea0bea9e (diff) | |
download | CMake-3958b3e112b7c33d40129a16811a2eff69495a42.zip CMake-3958b3e112b7c33d40129a16811a2eff69495a42.tar.gz CMake-3958b3e112b7c33d40129a16811a2eff69495a42.tar.bz2 |
ENH: Teach find_package about more install dirs
We now search in
<prefix>/<name>*/
<prefix>/<name>*/(cmake|CMake)
when looking for package configuration files. This is useful on Windows
since the Program Files folder is in CMAKE_SYSTEM_PREFIX_PATH. These
paths are the Windows equivalent to the Apple convention application and
framework paths we already search. See issue #8264.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 9e998aa..9577b42 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -222,6 +222,8 @@ cmFindPackageCommand::cmFindPackageCommand() "UNIX (U), or Apple (A) conventions.\n" " <prefix>/ (W)\n" " <prefix>/(cmake|CMake)/ (W)\n" + " <prefix>/<name>*/ (W)\n" + " <prefix>/<name>*/(cmake|CMake)/ (W)\n" " <prefix>/(share|lib)/cmake/<name>*/ (U)\n" " <prefix>/(share|lib)/<name>*/ (U)\n" " <prefix>/(share|lib)/<name>*/(cmake|CMake)/ (U)\n" @@ -1783,6 +1785,31 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in) } } + // PREFIX/(Foo|foo|FOO).*/ + { + cmFindPackageFileList lister(this); + lister + / cmFileListGeneratorFixed(prefix) + / cmFileListGeneratorProject(this->Names); + if(lister.Search()) + { + return true; + } + } + + // PREFIX/(Foo|foo|FOO).*/(cmake|CMake)/ + { + cmFindPackageFileList lister(this); + lister + / cmFileListGeneratorFixed(prefix) + / cmFileListGeneratorProject(this->Names) + / cmFileListGeneratorCaseInsensitive("cmake"); + if(lister.Search()) + { + return true; + } + } + // Construct list of common install locations (lib and share). std::vector<std::string> common; if(this->UseLib64Paths) |