CMP0096.rst 1.1 KB

1234567891011121314151617181920212223242526
  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. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.16
  18. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  19. .. include:: include/STANDARD_ADVICE.rst
  20. .. include:: include/DEPRECATED.rst