diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst index 3ffabacecf..99763f59c3 100644 --- a/Help/command/find_package.rst +++ b/Help/command/find_package.rst @@ -313,11 +313,19 @@ Each entry is meant for installation trees following Windows (``W``), UNIX ==================================================================== ========== Entry Convention ==================================================================== ========== + ``//cps/`` [#p2]_ W + ``//*/cps/`` [#p2]_ W + ``/cps//`` [#p2]_ W + ``/cps//*/`` [#p2]_ W + ``/cps/`` [#p2]_ W ``/`` W ``/(cmake|CMake)/`` W ``/*/`` W ``/*/(cmake|CMake)/`` W - ``/*/(cmake|CMake)/*/`` [#]_ W + ``/*/(cmake|CMake)/*/`` [#p1]_ W + ``/(lib/|lib*|share)/cps//`` [#p2]_ U + ``/(lib/|lib*|share)/cps//*/`` [#p2]_ U + ``/(lib/|lib*|share)/cps/`` [#p2]_ U ``/(lib/|lib*|share)/cmake/*/`` U ``/(lib/|lib*|share)/*/`` U ``/(lib/|lib*|share)/*/(cmake|CMake)/`` U @@ -326,22 +334,34 @@ Each entry is meant for installation trees following Windows (``W``), UNIX ``/*/(lib/|lib*|share)/*/(cmake|CMake)/`` W/U ==================================================================== ========== -.. [#] .. versionadded:: 3.25 +.. [#p1] .. versionadded:: 3.25 + +.. [#p2] .. versionadded:: 3.32 On systems supporting macOS :prop_tgt:`FRAMEWORK` and :prop_tgt:`BUNDLE`, the following directories are searched for Frameworks or Application Bundles containing a configuration file: -=========================================================== ========== - Entry Convention -=========================================================== ========== - ``/.framework/Resources/`` A - ``/.framework/Resources/CMake/`` A - ``/.framework/Versions/*/Resources/`` A - ``/.framework/Versions/*/Resources/CMake/`` A - ``/.app/Contents/Resources/`` A - ``/.app/Contents/Resources/CMake/`` A -=========================================================== ========== +=============================================================== ========== + Entry Convention +=============================================================== ========== + ``/.framework/Versions/*/Resources/CPS/`` [#p3]_ A + ``/.framework/Resources/CPS/`` [#p3]_ A + ``/.framework/Resources/`` A + ``/.framework/Resources/CMake/`` A + ``/.framework/Versions/*/Resources/`` A + ``/.framework/Versions/*/Resources/CMake/`` A + ``/.app/Contents/Resources/CPS/`` [#p3]_ A + ``/.app/Contents/Resources/`` A + ``/.app/Contents/Resources/CMake/`` A +=============================================================== ========== + +.. [#p3] .. versionadded:: 3.32 + +When searching the above paths, ``find_package`` will only look for ``.cps`` +files in search paths which contain ``/cps/``, and will only look for +``.cmake`` files otherwise. (This only applies to the paths as specified and +does not consider the contents of ```` or ````.) In all cases the ```` is treated as case-insensitive and corresponds to any of the names specified (```` or names given by ``NAMES``). @@ -395,6 +415,12 @@ intended for installations on Apple platforms. The :variable:`CMAKE_FIND_FRAMEWORK` and :variable:`CMAKE_FIND_APPBUNDLE` variables determine the order of preference. +.. warning:: + + Setting :variable:`CMAKE_FIND_FRAMEWORK` or :variable:`CMAKE_FIND_APPBUNDLE` + to values other than ``FIRST`` (the default) will cause CMake searching for + CPS files in an order that is different from the order specified by CPS. + The set of installation prefixes is constructed using the following steps. If ``NO_DEFAULT_PATH`` is specified all ``NO_*`` options are enabled. diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index da29b9e97d..41974c7e59 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -57,6 +57,8 @@ class cmExecutionStatus; namespace { +using pdt = cmFindPackageCommand::PackageDescriptionType; + template