mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
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).*/`.
This commit is contained in:
@@ -291,6 +291,7 @@ Each entry is meant for installation trees following Windows (``W``), UNIX
|
||||
<prefix>/(cmake|CMake)/ (W)
|
||||
<prefix>/<name>*/ (W)
|
||||
<prefix>/<name>*/(cmake|CMake)/ (W)
|
||||
<prefix>/<name>*/(cmake|CMake)/<name>*/ (W)
|
||||
<prefix>/(lib/<arch>|lib*|share)/cmake/<name>*/ (U)
|
||||
<prefix>/(lib/<arch>|lib*|share)/<name>*/ (U)
|
||||
<prefix>/(lib/<arch>|lib*|share)/<name>*/(cmake|CMake)/ (U)
|
||||
|
||||
6
Help/release/dev/find_package-one-more-path.rst
Normal file
6
Help/release/dev/find_package-one-more-path.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
find_package-one-more-path
|
||||
--------------------------
|
||||
|
||||
* The :command:`find_package` command now considers paths of
|
||||
the form ``<prefix>/<name>*/(cmake|CMake)/<name>*/`` when
|
||||
searching for package configuration files.
|
||||
@@ -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)) {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
find_package considered the following locations for SearchPaths's Config
|
||||
module:
|
||||
|
||||
.*/Tests/RunCMake/find_package/SearchPaths_prefix_pkg_cmake_pkg-build/CMakeFiles/pkgRedirects/SearchPathsConfig\.cmake
|
||||
.*/Tests/RunCMake/find_package/SearchPaths_prefix_pkg_cmake_pkg-build/CMakeFiles/pkgRedirects/searchpaths-config\.cmake
|
||||
.*/Tests/RunCMake/find_package/SearchPaths/prefix_pkg_cmake_pkg/SearchPathsConfig\.cmake
|
||||
.*/Tests/RunCMake/find_package/SearchPaths/prefix_pkg_cmake_pkg/searchpaths-config\.cmake
|
||||
.*/Tests/RunCMake/find_package/SearchPaths/prefix_pkg_cmake_pkg/SearchPaths-1\.2\.3/SearchPathsConfig\.cmake
|
||||
.*/Tests/RunCMake/find_package/SearchPaths/prefix_pkg_cmake_pkg/SearchPaths-1\.2\.3/searchpaths-config\.cmake
|
||||
.*/Tests/RunCMake/find_package/SearchPaths/prefix_pkg_cmake_pkg/SearchPaths-1\.2\.3/cmake/SearchPaths-1\.2\.3/SearchPathsConfig\.cmake
|
||||
|
||||
The file was found at
|
||||
|
||||
.*/Tests/RunCMake/find_package/SearchPaths/prefix_pkg_cmake_pkg/SearchPaths-1\.2\.3/cmake/SearchPaths-1\.2\.3/SearchPathsConfig\.cmake
|
||||
@@ -0,0 +1 @@
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/SearchPaths.cmake")
|
||||
Reference in New Issue
Block a user