Find: find_package prefers variable CMAKE_FIND_USE_REGISTRY

CMake's find control flags should all have a consistent name.
To make this happen we are introducing `CMAKE_FIND_USE_REGISTRY`
and deprecating `CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`.
This commit is contained in:
Robert Maynard
2018-11-13 08:39:27 -06:00
parent 704e3a2ca8
commit 1d00ba9ccf
13 changed files with 109 additions and 12 deletions

View File

@@ -1,12 +1,23 @@
CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
--------------------------------------
Skip :ref:`User Package Registry` in :command:`find_package` calls.
.. deprecated:: 3.16
Use the :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` variable instead.
By default this variable is not set. If neither
:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` nor
``CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`` is set, then
:command:`find_package()` will use the `User Package Registry` unless the
`NO_CMAKE_PACKAGE_REGISTRY` option is provided.
``CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`` is ignored if
:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` is set.
In some cases, for example to locate only system wide installations, it
is not desirable to use the :ref:`User Package Registry` when searching
for packages. If the :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`
variable is enabled, all the :command:`find_package` commands will skip
variable is ``TRUE``, all the :command:`find_package` commands will skip
the :ref:`User Package Registry` as if they were called with the
``NO_CMAKE_PACKAGE_REGISTRY`` argument.

View File

@@ -14,4 +14,5 @@ commands take precedence over this variable.
See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`,
and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.

View File

@@ -14,4 +14,5 @@ commands take precedence over this variable.
See also the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`,
and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.

View File

@@ -14,4 +14,5 @@ commands take precedence over this variable.
See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`,
and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.

View File

@@ -0,0 +1,29 @@
CMAKE_FIND_USE_PACKAGE_REGISTRY
-------------------------------
Controls the searching the :ref:`User Package Registry` by the :command:`find_package`
command.
By default this variable is not set and the behavior will fall back
to that determined by the deprecated :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`
variable. If that is also not set, then `find_package()` will use the
`User Package Registry` unless the `NO_CMAKE_PACKAGE_REGISTRY` option
is provided.
This variable takes precedence over :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`
when both are set.
In some cases, for example to locate only system wide installations, it
is not desirable to use the :ref:`User Package Registry` when searching
for packages. If the :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`
variable is ``FALSE``, all the :command:`find_package` commands will skip
the :ref:`User Package Registry` as if they were called with the
``NO_CMAKE_PACKAGE_REGISTRY`` argument.
See also :ref:`Disabling the Package Registry`.
See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.

View File

@@ -14,4 +14,5 @@ commands take precedence over this variable.
See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
and :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` variables.
:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
and :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` variables.

View File

@@ -14,4 +14,5 @@ commands take precedence over this variable.
See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`,
and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.