mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 06:09:14 -05:00
Help: Explain block() policy-scope rules more clearly
This commit is contained in:
committed by
Craig Scott
parent
2f319c6484
commit
bbf3ed5422
@@ -21,7 +21,8 @@ scopes created by the ``block()`` command are removed.
|
||||
|
||||
``POLICIES``
|
||||
Create a new policy scope. This is equivalent to
|
||||
:command:`cmake_policy(PUSH)`.
|
||||
:command:`cmake_policy(PUSH)` with an automatic
|
||||
:command:`cmake_policy(POP)` when leaving the block scope.
|
||||
|
||||
``VARIABLES``
|
||||
Create a new variable scope.
|
||||
|
||||
@@ -107,11 +107,10 @@ Calls to the :command:`cmake_minimum_required(VERSION)`,
|
||||
influence only the current top of the policy stack.
|
||||
|
||||
.. versionadded:: 3.25
|
||||
The :command:`block` and :command:`endblock` commands offer a more flexible
|
||||
The :command:`block(SCOPE_FOR POLICIES)` command offers a more flexible
|
||||
and more secure way to manage the policy stack. The pop action is done
|
||||
automatically when the :command:`endblock` command is executed, so it avoid
|
||||
to call the :command:`cmake_policy(POP)` command before each
|
||||
:command:`return` command.
|
||||
automatically when leaving the block scope, so there is no need to
|
||||
precede each :command:`return` with a call to :command:`cmake_policy(POP)`.
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
|
||||
Reference in New Issue
Block a user