1CMP0096
2-------
3
4.. versionadded:: 3.16
5
6The :command:`project` command preserves leading zeros in version components.
7
8When a ``VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]`` argument is given
9to the :command:`project` command, it stores the version string in the
10``PROJECT_VERSION`` variable and stores individual integer version components
11in ``PROJECT_VERSION_{MAJOR,MINOR,PATCH,TWEAK}`` variables (see policy
12:policy:`CMP0048`).  CMake 3.15 and below dropped leading zeros from each
13component.  CMake 3.16 and higher prefer to preserve leading zeros.  This
14policy provides compatibility for projects that have not been updated to
15expect the new behavior.
16
17The ``OLD`` behavior of this policy drops leading zeros in all components,
18e.g.  such that version ``1.07.06`` becomes ``1.7.6``.  The ``NEW`` behavior
19of this policy preserves the leading zeros in all components, such that
20version ``1.07.06`` remains unchanged.
21
22This policy was introduced in CMake version 3.16.  Unlike many policies, CMake
23version |release| does *not* warn when this policy is not set and simply uses
24the ``OLD`` behavior.  Use the :command:`cmake_policy` command to set it to
25``OLD`` or ``NEW`` explicitly.
26
27.. include:: DEPRECATED.txt
28