Browse Source

Help: Add cmake_minimum_required(VERSION) example to cmake-policies(7)

Brad King 9 months ago
parent
commit
3e0720a2ae
2 changed files with 21 additions and 3 deletions
  1. 7 0
      Help/dev/maint.rst
  2. 14 3
      Help/manual/cmake-policies.7.rst

+ 7 - 0
Help/dev/maint.rst

@@ -302,6 +302,13 @@ Update ``Source/CMakeVersion.cmake`` to set the version to
   set(CMake_VERSION_PATCH $date)
   #set(CMake_VERSION_RC 0)
 
+Update ``Help/manual/cmake-policies.7.rst`` to set the ``...<max>``
+example to ``...$major.$minor``:
+
+.. code-block:: cmake
+
+  cmake_minimum_required(VERSION 3.10...$major.$minor)
+
 Commit with a message such as::
 
   Begin post-$ver development

+ 14 - 3
Help/manual/cmake-policies.7.rst

@@ -27,9 +27,20 @@ as soon as possible.
 
 Use the :command:`cmake_minimum_required` command to record the latest
 version of CMake for which a project has been updated.
-The ``VERSION <min>...<policy_max>`` syntax enables the ``NEW`` behaviors
-of policies introduced in version ``<policy_max>`` and earlier without
-increasing the minimum version of CMake required by the project.
+For example:
+
+..
+  Sync this cmake_minimum_required example with ``Help/dev/maint.rst``.
+
+.. code-block:: cmake
+
+  cmake_minimum_required(VERSION 3.10...3.31)
+
+This uses the ``<min>...<max>`` syntax to enable the ``NEW`` behaviors
+of policies introduced in CMake 3.31 and earlier while only requiring a
+minimum version of CMake 3.10.  The project is expected to work with
+both the ``OLD`` and ``NEW`` behaviors of policies introduced between
+those versions.
 
 Transition Schedule
 -------------------