summaryrefslogtreecommitdiff
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-06-27 07:10:27 +0400
committerBrad King <brad.king@kitware.com>2022-08-04 09:41:59 -0400
commite55c154c5b1cbecd826ac216d69ce88845a56cdc (patch)
treee04494b7a5bec3fccfd085425ba1cf674540514f /Source/cmFindPackageCommand.cxx
parent57fb264085f7ed9349350cafb45b91bc924a7022 (diff)
downloadcmake-e55c154c5b1cbecd826ac216d69ce88845a56cdc.tar.gz
cmFindPackageCommand: Add one more search path
The `PREFIX/(Foo|foo|FOO).*/(cmake|CMake)/(Foo|foo|FOO).*/` search path is the similar to the one already exists `PREFIX/(Foo|foo|FOO).*/(lib/ARCH|lib*|share)/cmake/(Foo|foo|FOO).*/`.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index f260ec7431..92e98c54e5 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -2524,6 +2524,16 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
return true;
}
+ auto secondPkgDirGen =
+ cmProjectDirectoryListGenerator{ this->Names, this->SortOrder,
+ this->SortDirection };
+
+ // PREFIX/(Foo|foo|FOO).*/(cmake|CMake)/(Foo|foo|FOO).*/
+ if (TryGeneratedPaths(searchFn, prefix, firstPkgDirGen, iCMakeGen,
+ secondPkgDirGen)) {
+ return true;
+ }
+
// Construct list of common install locations (lib and share).
std::vector<cm::string_view> common;
std::string libArch;
@@ -2561,10 +2571,6 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
return true;
}
- auto secondPkgDirGen =
- cmProjectDirectoryListGenerator{ this->Names, this->SortOrder,
- this->SortDirection };
-
// PREFIX/(Foo|foo|FOO).*/(lib/ARCH|lib*|share)/cmake/(Foo|foo|FOO).*/
if (TryGeneratedPaths(searchFn, prefix, firstPkgDirGen, cmnGen, cmakeGen,
secondPkgDirGen)) {