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