[Cmake-commits] CMake branch, next, updated. v3.0.0-rc6-3450-g42b9f98
Brad King
brad.king at kitware.com
Fri May 30 15:18:46 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 42b9f987b232d9d5514adc51d8c1c63b8d214478 (commit)
via de60a38c17b1dbdd08d4c81d364b1409d07cb433 (commit)
via 51bdce128a48351a212521c6750f78c7ef4063cd (commit)
via 0815f518daab8074e8bc24099343ffeb1eaf067f (commit)
from b0a6d4ad6ded67e33614e6e5d57818c0efe24bbd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42b9f987b232d9d5514adc51d8c1c63b8d214478
commit 42b9f987b232d9d5514adc51d8c1c63b8d214478
Merge: b0a6d4a de60a38
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri May 30 15:18:45 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri May 30 15:18:45 2014 -0400
Merge topic 'policy-doc-updates' into next
de60a38c Help: Reference cmake_minimum_required from cmake_policy docs
51bdce12 Help: Format cmake_policy command documentation
0815f518 Revert "Calling cmake_minimum_required() resets the policy stack"
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de60a38c17b1dbdd08d4c81d364b1409d07cb433
commit de60a38c17b1dbdd08d4c81d364b1409d07cb433
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri May 30 15:17:38 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri May 30 15:18:43 2014 -0400
Help: Reference cmake_minimum_required from cmake_policy docs
Note in a few places of the cmake_policy() command documentation
that the cmake_minimum_required() command can set policies too.
Inspired-by: Peter Kümmel <syntheticpp at gmx.net>
diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst
index 3b0b046..b14a2aa 100644
--- a/Help/command/cmake_policy.rst
+++ b/Help/command/cmake_policy.rst
@@ -36,6 +36,9 @@ version and tells newer CMake versions to warn about their new policies.
The policy version specified must be at least 2.4 or the command will
report an error.
+Note that the :command:`cmake_minimum_required(VERSION)`
+command implicitly calls ``cmake_policy(VERSION)`` too.
+
Setting Policies Explicitly
'''''''''''''''''''''''''''
@@ -79,6 +82,9 @@ entries on the policy stack::
Each ``PUSH`` must have a matching ``POP`` to erase any changes.
This is useful to make temporary changes to policy settings.
+Calls to the :command:`cmake_minimum_required(VERSION)`,
+``cmake_policy(VERSION)``, or ``cmake_policy(SET)`` commands
+influence only the current top of the policy stack.
Commands created by the :command:`function` and :command:`macro`
commands record policy settings when they are created and
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51bdce128a48351a212521c6750f78c7ef4063cd
commit 51bdce128a48351a212521c6750f78c7ef4063cd
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri May 30 15:13:08 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri May 30 15:13:08 2014 -0400
Help: Format cmake_policy command documentation
Add reStructuredText markup manually to improve formatting of the
documentation. Organize the documentation into subsections.
diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst
index 46db8d3..3b0b046 100644
--- a/Help/command/cmake_policy.rst
+++ b/Help/command/cmake_policy.rst
@@ -1,77 +1,87 @@
cmake_policy
------------
-Manage CMake Policy settings.
+Manage CMake Policy settings. See the :manual:`cmake-policies(7)`
+manual for defined policies.
As CMake evolves it is sometimes necessary to change existing behavior
in order to fix bugs or improve implementations of existing features.
The CMake Policy mechanism is designed to help keep existing projects
building as new versions of CMake introduce changes in behavior. Each
new policy (behavioral change) is given an identifier of the form
-"CMP<NNNN>" where "<NNNN>" is an integer index. Documentation
-associated with each policy describes the OLD and NEW behavior and the
-reason the policy was introduced. Projects may set each policy to
-select the desired behavior. When CMake needs to know which behavior
+``CMP<NNNN>`` where ``<NNNN>`` is an integer index. Documentation
+associated with each policy describes the ``OLD`` and ``NEW`` behavior
+and the reason the policy was introduced. Projects may set each policy
+to select the desired behavior. When CMake needs to know which behavior
to use it checks for a setting specified by the project. If no
-setting is available the OLD behavior is assumed and a warning is
+setting is available the ``OLD`` behavior is assumed and a warning is
produced requesting that the policy be set.
-The cmake_policy command is used to set policies to OLD or NEW
-behavior. While setting policies individually is supported, we
-encourage projects to set policies based on CMake versions.
+Setting Policies by CMake Version
+'''''''''''''''''''''''''''''''''
-::
+The ``cmake_policy`` command is used to set policies to ``OLD`` or ``NEW``
+behavior. While setting policies individually is supported, we
+encourage projects to set policies based on CMake versions::
cmake_policy(VERSION major.minor[.patch[.tweak]])
-Specify that the current CMake list file is written for the given
+Specify that the current CMake code is written for the given
version of CMake. All policies introduced in the specified version or
-earlier will be set to use NEW behavior. All policies introduced
-after the specified version will be unset (unless variable
-CMAKE_POLICY_DEFAULT_CMP<NNNN> sets a default). This effectively
-requests behavior preferred as of a given CMake version and tells
-newer CMake versions to warn about their new policies. The policy
-version specified must be at least 2.4 or the command will report an
-error. In order to get compatibility features supporting versions
-earlier than 2.4 see documentation of policy CMP0001.
+earlier will be set to use ``NEW`` behavior. All policies introduced
+after the specified version will be unset (unless the
+:variable:`CMAKE_POLICY_DEFAULT_CMP<NNNN>` variable sets a default).
+This effectively requests behavior preferred as of a given CMake
+version and tells newer CMake versions to warn about their new policies.
+The policy version specified must be at least 2.4 or the command will
+report an error.
+
+Setting Policies Explicitly
+'''''''''''''''''''''''''''
::
cmake_policy(SET CMP<NNNN> NEW)
cmake_policy(SET CMP<NNNN> OLD)
-Tell CMake to use the OLD or NEW behavior for a given policy.
+Tell CMake to use the ``OLD`` or ``NEW`` behavior for a given policy.
Projects depending on the old behavior of a given policy may silence a
-policy warning by setting the policy state to OLD. Alternatively one
-may fix the project to work with the new behavior and set the policy
-state to NEW.
+policy warning by setting the policy state to ``OLD``. Alternatively
+one may fix the project to work with the new behavior and set the
+policy state to ``NEW``.
+
+Checking Policy Settings
+''''''''''''''''''''''''
::
cmake_policy(GET CMP<NNNN> <variable>)
-Check whether a given policy is set to OLD or NEW behavior. The
-output variable value will be "OLD" or "NEW" if the policy is set, and
-empty otherwise.
+Check whether a given policy is set to ``OLD`` or ``NEW`` behavior.
+The output ``<variable>`` value will be ``OLD`` or ``NEW`` if the
+policy is set, and empty otherwise.
+
+CMake Policy Stack
+''''''''''''''''''
CMake keeps policy settings on a stack, so changes made by the
cmake_policy command affect only the top of the stack. A new entry on
the policy stack is managed automatically for each subdirectory to
protect its parents and siblings. CMake also manages a new entry for
-scripts loaded by include() and find_package() commands except when
-invoked with the NO_POLICY_SCOPE option (see also policy CMP0011).
-The cmake_policy command provides an interface to manage custom
-entries on the policy stack:
-
-::
+scripts loaded by :command:`include` and :command:`find_package` commands
+except when invoked with the ``NO_POLICY_SCOPE`` option
+(see also policy :policy:`CMP0011`).
+The ``cmake_policy`` command provides an interface to manage custom
+entries on the policy stack::
cmake_policy(PUSH)
cmake_policy(POP)
-Each PUSH must have a matching POP to erase any changes. This is
-useful to make temporary changes to policy settings.
+Each ``PUSH`` must have a matching ``POP`` to erase any changes.
+This is useful to make temporary changes to policy settings.
-Functions and macros record policy settings when they are created and
+Commands created by the :command:`function` and :command:`macro`
+commands record policy settings when they are created and
use the pre-record policies when they are invoked. If the function or
macro implementation sets policies, the changes automatically
propagate up through callers until they reach the closest nested
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0815f518daab8074e8bc24099343ffeb1eaf067f
commit 0815f518daab8074e8bc24099343ffeb1eaf067f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri May 30 14:55:43 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri May 30 14:55:43 2014 -0400
Revert "Calling cmake_minimum_required() resets the policy stack"
This reverts commit 8828bfca1747ac73b14d3c576cdb595359ddc172.
diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst
index a17311c..46db8d3 100644
--- a/Help/command/cmake_policy.rst
+++ b/Help/command/cmake_policy.rst
@@ -76,6 +76,3 @@ use the pre-record policies when they are invoked. If the function or
macro implementation sets policies, the changes automatically
propagate up through callers until they reach the closest nested
policy stack entry.
-
-Calling cmake_minimum_required() resets the policy stack
-to the specified version.
-----------------------------------------------------------------------
Summary of changes:
Help/command/cmake_policy.rst | 89 +++++++++++++++++++++++------------------
1 file changed, 51 insertions(+), 38 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list