mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
export: Disable PACKAGE mode user package registry by default
The user package registry populated by the `export()` command causes side effects outside the build and source directories. Such effects should be opt-in rather than op-out. Introduce a policy to change default behavior of `export(PACKAGE)` to do nothing.
This commit is contained in:
committed by
Brad King
parent
0df31d99ae
commit
9bede5c4ce
@@ -1,11 +1,16 @@
|
||||
CMAKE_EXPORT_NO_PACKAGE_REGISTRY
|
||||
--------------------------------
|
||||
|
||||
Disable the :command:`export(PACKAGE)` command.
|
||||
Disable the :command:`export(PACKAGE)` command when :policy:`CMP0090`
|
||||
is not set to ``NEW``.
|
||||
|
||||
In some cases, for example for packaging and for system wide
|
||||
installations, it is not desirable to write the user package registry.
|
||||
If the :variable:`CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable is enabled,
|
||||
If the ``CMAKE_EXPORT_NO_PACKAGE_REGISTRY`` variable is enabled,
|
||||
the :command:`export(PACKAGE)` command will do nothing.
|
||||
|
||||
If :policy:`CMP0090` is set to ``NEW`` this variable does nothing, and the
|
||||
:variable:`CMAKE_EXPORT_PACKAGE_REGISTRY` variable controls the behavior
|
||||
instead.
|
||||
|
||||
See also :ref:`Disabling the Package Registry`.
|
||||
|
||||
15
Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst
Normal file
15
Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst
Normal file
@@ -0,0 +1,15 @@
|
||||
CMAKE_EXPORT_PACKAGE_REGISTRY
|
||||
-----------------------------
|
||||
|
||||
Enables the :command:`export(PACKAGE)` command when :policy:`CMP0090`
|
||||
is set to ``NEW``.
|
||||
|
||||
The :command:`export(PACKAGE)` command does nothing by default. In some cases
|
||||
it is desirable to write to the user package registry, so the
|
||||
``CMAKE_EXPORT_PACKAGE_REGISTRY`` variable may be set to enable it.
|
||||
|
||||
If :policy:`CMP0090` is *not* set to ``NEW`` this variable does nothing, and
|
||||
the :variable:`CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable controls the behavior
|
||||
instead.
|
||||
|
||||
See also :ref:`Disabling the Package Registry`.
|
||||
Reference in New Issue
Block a user