CMP0096.rst 1.2 KB

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