CMP0096.rst 1.2 KB

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