From 19f338109d8909feba37513285afe4a583811d54 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Sun, 1 Jul 2018 08:05:01 +1000 Subject: Help: Clarify ... behavior for policy-related commands Affects cmake_minimum_required() and cmake_policy(VERSION) --- Help/command/cmake_minimum_required.rst | 4 ++++ Help/command/cmake_policy.rst | 5 ++++- Help/release/3.12.rst | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Help/command/cmake_minimum_required.rst b/Help/command/cmake_minimum_required.rst index 7c02190..2f1ab60 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 ```` required version it will stop processing the project and report an error. The optional ```` version, if specified, must be at least the ```` 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 +``...`` part being ignored and preserving the pre-3.12 behavior +of basing policies on ````. 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 6a8dd62..c3f7cfb 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 ```` version must be at least ``2.4`` and at most the running version of CMake. The ```` version, if specified, must be at least the ```` 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 ``...`` part being ignored and +preserving the pre-3.12 behavior of basing policies on ````. 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 4d1135e..79ebc8e 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 ``[...]``. The ```` version is required but policies are set based on the - ```` version. This allows projects to specify a range of versions + older of the running CMake version and the version specified by + ````. 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 -- cgit v0.12