cmake/debian/patches/find_package_support_prefix_lib_cmake.diff
Modestas Vainius 58ae442c9e Add support for <prefix>/lib/cmake/ search paths to find_package()
Merge patch from upstream to support <prefix>/lib/cmake search path in
find_package() config mode. This enables reduction of /usr/lib cluttering
find_package_support_prefix_lib_cmake.diff - stolen from 2.6 branch.

Signed-off-by: Modestas Vainius <modestas@vainius.eu>
2008-12-10 00:34:45 +02:00

32 lines
1.0 KiB
Diff

--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -218,6 +218,7 @@
"UNIX (U), or Apple (A) conventions.\n"
" <prefix>/ (W)\n"
" <prefix>/(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"
"On systems supporting OS X Frameworks and Application Bundles "
@@ -1710,6 +1711,20 @@
common.push_back("lib");
common.push_back("share");
+ // PREFIX/(share|lib)/cmake/(Foo|foo|FOO).*/
+ {
+ cmFindPackageFileList lister(this);
+ lister
+ / cmFileListGeneratorFixed(prefix)
+ / cmFileListGeneratorEnumerate(common)
+ / cmFileListGeneratorFixed("cmake")
+ / cmFileListGeneratorProject(this->Names);
+ if(lister.Search())
+ {
+ return true;
+ }
+ }
+
// PREFIX/(share|lib)/(Foo|foo|FOO).*/
{
cmFindPackageFileList lister(this);