Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matthew Woehlke
CMake
Commits
bbf3ed54
Verified
Commit
bbf3ed54
authored
1 year ago
by
Frank Dana
Committed by
Craig Scott
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Help: Explain block() policy-scope rules more clearly
parent
2f319c64
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Help/command/block.rst
+2
-1
2 additions, 1 deletion
Help/command/block.rst
Help/command/cmake_policy.rst
+3
-4
3 additions, 4 deletions
Help/command/cmake_policy.rst
with
5 additions
and
5 deletions
Help/command/block.rst
+
2
−
1
View file @
bbf3ed54
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Help/command/cmake_policy.rst
+
3
−
4
View file @
bbf3ed54
...
...
@@ -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
` command
s
offer a more flexible
The :command:`block
(SCOPE_FOR POLICIES)
` command offer
s
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment