CMAKE_VERSION.rst 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. CMAKE_VERSION
  2. -------------
  3. The CMake version string as three non-negative integer components
  4. separated by ``.`` and possibly followed by ``-`` and other information.
  5. The first two components represent the feature level and the third
  6. component represents either a bug-fix level or development date.
  7. Release versions and release candidate versions of CMake use the format::
  8. <major>.<minor>.<patch>[-rc<n>]
  9. where the ``<patch>`` component is less than ``20000000``. Development
  10. versions of CMake use the format::
  11. <major>.<minor>.<date>[-<id>]
  12. where the ``<date>`` component is of format ``CCYYMMDD`` and ``<id>``
  13. may contain arbitrary text. This represents development as of a
  14. particular date following the ``<major>.<minor>`` feature release.
  15. Individual component values are also available in variables:
  16. * :variable:`CMAKE_MAJOR_VERSION`
  17. * :variable:`CMAKE_MINOR_VERSION`
  18. * :variable:`CMAKE_PATCH_VERSION`
  19. * :variable:`CMAKE_TWEAK_VERSION`
  20. Use the :command:`if` command ``VERSION_LESS``, ``VERSION_GREATER``,
  21. ``VERSION_EQUAL``, ``VERSION_LESS_EQUAL``, or ``VERSION_GREATER_EQUAL``
  22. operators to compare version string values against ``CMAKE_VERSION`` using a
  23. component-wise test. Version component values may be 10 or larger so do not
  24. attempt to compare version strings as floating-point numbers.
  25. .. note::
  26. CMake versions 2.8.2 through 2.8.12 used three components for the
  27. feature level. Release versions represented the bug-fix level in a
  28. fourth component, i.e. ``<major>.<minor>.<patch>[.<tweak>][-rc<n>]``.
  29. Development versions represented the development date in the fourth
  30. component, i.e. ``<major>.<minor>.<patch>.<date>[-<id>]``.
  31. CMake versions prior to 2.8.2 used three components for the
  32. feature level and had no bug-fix component. Release versions
  33. used an even-valued second component, i.e.
  34. ``<major>.<even-minor>.<patch>[-rc<n>]``. Development versions
  35. used an odd-valued second component with the development date as
  36. the third component, i.e. ``<major>.<odd-minor>.<date>``.
  37. The ``CMAKE_VERSION`` variable is defined by CMake 2.6.3 and higher.
  38. Earlier versions defined only the individual component variables.