summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2018-07-01 08:05:01 +1000
committerCraig Scott <craig.scott@crascit.com>2018-07-02 08:41:46 +1000
commit19f338109d8909feba37513285afe4a583811d54 (patch)
tree57ce561dc8bc15704a13fbf8db04ea4a431386fd
parent51e7d4150756a01d51da38acfd0a469b138e1fde (diff)
downloadcmake-19f338109d8909feba37513285afe4a583811d54.tar.gz
Help: Clarify ...<max> behavior for policy-related commands
Affects cmake_minimum_required() and cmake_policy(VERSION)
-rw-r--r--Help/command/cmake_minimum_required.rst4
-rw-r--r--Help/command/cmake_policy.rst5
-rw-r--r--Help/release/3.12.rst3
3 files changed, 10 insertions, 2 deletions
diff --git a/Help/command/cmake_minimum_required.rst b/Help/command/cmake_minimum_required.rst
index 7c021901f3..2f1ab6012a 100644
--- a/Help/command/cmake_minimum_required.rst
+++ b/Help/command/cmake_minimum_required.rst
@@ -13,6 +13,10 @@ If the running version of CMake is lower than the ``<min>`` required
version it will stop processing the project and report an error.
The optional ``<max>`` version, if specified, must be at least the
``<min>`` version and affects policy settings as described below.
+If the running version of CMake is older than 3.12, the extra ``...``
+dots will be seen as version component separators, resulting in the
+``...<max>`` part being ignored and preserving the pre-3.12 behavior
+of basing policies on ``<min>``.
The ``FATAL_ERROR`` option is accepted but ignored by CMake 2.6 and
higher. It should be specified so CMake versions 2.4 and lower fail
diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst
index 6a8dd620e7..c3f7cfb960 100644
--- a/Help/command/cmake_policy.rst
+++ b/Help/command/cmake_policy.rst
@@ -30,7 +30,10 @@ encourage projects to set policies based on CMake versions::
``major.minor[.patch[.tweak]]``, and the ``...`` is literal. The ``<min>``
version must be at least ``2.4`` and at most the running version of CMake.
The ``<max>`` version, if specified, must be at least the ``<min>`` version
-but may exceed the running version of CMake.
+but may exceed the running version of CMake. If the running version of
+CMake is older than 3.12, the extra ``...`` dots will be seen as version
+component separators, resulting in the ``...<max>`` part being ignored and
+preserving the pre-3.12 behavior of basing policies on ``<min>``.
This specifies that the current CMake code is written for the given
range of CMake versions. All policies known to the running version of CMake
diff --git a/Help/release/3.12.rst b/Help/release/3.12.rst
index 4d1135e9f7..79ebc8e9f4 100644
--- a/Help/release/3.12.rst
+++ b/Help/release/3.12.rst
@@ -34,7 +34,8 @@ Commands
* The :command:`cmake_minimum_required` and :command:`cmake_policy(VERSION)`
commands now accept a version range using the form ``<min>[...<max>]``.
The ``<min>`` version is required but policies are set based on the
- ``<max>`` version. This allows projects to specify a range of versions
+ older of the running CMake version and the version specified by
+ ``<max>``. This allows projects to specify a range of versions
for which they have been updated and avoid explicit policy settings.
* The :command:`file(GLOB)` and :command:`file(GLOB_RECURSE)` commands