summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2019-07-06 00:01:38 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-16 11:48:40 (GMT)
commit0ba5891eadbfd533f0ab30c90966bce07e5fbef8 (patch)
tree392a4016cdd19fe04ce83a7f701c3421450f35f0 /Help
parent5f8466980696cc13653766d6c6255c40a896acb7 (diff)
downloadCMake-0ba5891eadbfd533f0ab30c90966bce07e5fbef8.zip
CMake-0ba5891eadbfd533f0ab30c90966bce07e5fbef8.tar.gz
CMake-0ba5891eadbfd533f0ab30c90966bce07e5fbef8.tar.bz2
project: Keep leading `0` in PROJECT_VERSION components
Introduce CMake policy `CMP0096` to make `project()` keep leading zeros in version components. As a side effect, it now allows really long version numbers. Fixes: #19421 Co-Author: Brad King <brad.king@kitware.com>
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/policy/CMP0096.rst25
-rw-r--r--Help/release/dev/project-version-0.rst5
3 files changed, 31 insertions, 0 deletions
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index d7207e1..6bdabaf 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.16
.. toctree::
:maxdepth: 1
+ CMP0096: project() preserves leading zeros in version components. </policy/CMP0096>
CMP0095: RPATH entries are properly escaped in the intermediary CMake install script. </policy/CMP0095>
Policies Introduced by CMake 3.15
diff --git a/Help/policy/CMP0096.rst b/Help/policy/CMP0096.rst
new file mode 100644
index 0000000..8eaf0f9
--- /dev/null
+++ b/Help/policy/CMP0096.rst
@@ -0,0 +1,25 @@
+CMP0096
+-------
+
+The :command:`project` command preserves leading zeros in version components.
+
+When a ``VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]`` argument is given
+to the :command:`project` command, it stores the version string in the
+``PROJECT_VERSION`` variable and stores individual integer version components
+in ``PROJECT_VERSION_{MAJOR,MINOR,PATCH,TWEAK}`` variables (see policy
+:policy:`CMP0048`). CMake 3.15 and below dropped leading zeros from each
+component. CMake 3.16 and higher prefer to preserve leading zeros. This
+policy provides compatibility for projects that have not been updated to
+expect the new behavior.
+
+The ``OLD`` behavior of this policy drops leading zeros in all components,
+e.g. such that version ``1.07.06`` becomes ``1.7.6``. The ``NEW`` behavior
+of this policy preserves the leading zeros in all components, such that
+version ``1.07.06`` remains unchanged.
+
+This policy was introduced in CMake version 3.16. Unlike many policies, CMake
+version |release| does *not* warn when this policy is not set and simply uses
+the ``OLD`` behavior. Use the :command:`cmake_policy` command to set it to
+``OLD`` or ``NEW`` explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/release/dev/project-version-0.rst b/Help/release/dev/project-version-0.rst
new file mode 100644
index 0000000..6525522
--- /dev/null
+++ b/Help/release/dev/project-version-0.rst
@@ -0,0 +1,5 @@
+project-version-0
+-----------------
+
+* The :command:`project` no longer strips leading zeros in version components.
+ See policy :policy:`CMP0096`.