summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-12-17 14:24:05 (GMT)
committerBrad King <brad.king@kitware.com>2008-12-17 14:24:05 (GMT)
commit3958b3e112b7c33d40129a16811a2eff69495a42 (patch)
tree4d525f2142dfba37efedd6eca78fdcb34453d67d /Source/cmFindPackageCommand.cxx
parentd5c1191349778dd1c1d4646b28f8f532ea0bea9e (diff)
downloadCMake-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.cxx27
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)