find_package: Clarify CPS search priority

When using `find_package()` in config mode, as of CMake 4.3, first the
CPS files are searched and then config files.
This commit is contained in:
Peter Kokot
2026-03-18 13:07:14 +01:00
committed by Brad King
parent 84aeddb4ea
commit 697486583f

View File

@@ -77,17 +77,17 @@ The command has a few modes by which it searches for packages:
**Config mode** **Config mode**
In this mode, CMake searches for a file matching any of: In this mode, CMake searches for a file matching any of:
* ``<lowercasePackageName>-config.cmake``
* ``<PackageName>Config.cmake``
* ``<PackageName>.cps`` * ``<PackageName>.cps``
* ``<lowercasePackageName>.cps`` * ``<lowercasePackageName>.cps``
* ``<lowercasePackageName>-config.cmake``
* ``<PackageName>Config.cmake``
If one of the first two is found, CMake will also look respectively, for If one of the latter two is found, CMake will also look respectively, for
``<lowercasePackageName>-config-version.cmake`` or ``<lowercasePackageName>-config-version.cmake`` or
``<PackageName>ConfigVersion.cmake`` if version details were specified ``<PackageName>ConfigVersion.cmake`` if version details were specified
(see :ref:`version selection` for an explanation of how these separate (see :ref:`version selection` for an explanation of how these separate
version files are used). The first two options are CMake-script package version files are used). The latter two options are CMake-script package
descriptions. The latter two are |CPS|_ (CPS) package descriptions, which descriptions. The first two are |CPS|_ (CPS) package descriptions, which
are more portable and include version information in the 'base' file. Aside are more portable and include version information in the 'base' file. Aside
from any explicitly noted exceptions, any references to "config files", from any explicitly noted exceptions, any references to "config files",
"config mode", "package configuration files", and so forth refer equally to "config mode", "package configuration files", and so forth refer equally to