summaryrefslogtreecommitdiffstats
path: root/Help/variable/CMAKE_VERSION.rst
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-02-04 20:51:11 (GMT)
committerBrad King <brad.king@kitware.com>2014-02-05 14:24:41 (GMT)
commit52e7beb6ab6465a1f7ab185f2020d85efc9049b8 (patch)
tree19eac4bf4c8e679566aaf2575a3fe69836338bb4 /Help/variable/CMAKE_VERSION.rst
parentf748b59e2057d73a25448378442d70b420ed7698 (diff)
downloadCMake-52e7beb6ab6465a1f7ab185f2020d85efc9049b8.zip
CMake-52e7beb6ab6465a1f7ab185f2020d85efc9049b8.tar.gz
CMake-52e7beb6ab6465a1f7ab185f2020d85efc9049b8.tar.bz2
Help: Expand documentation of CMAKE_VERSION and related variables
Describe the meaning of each version component in more detail in the documentation of CMAKE_VERSION. Simplify the per-component version variable documentation by referencing the main variable. Include information about how to compare version strings. Also add an historical note about the version scheme used prior to commit v2.8.2~105^2~4 (New version scheme to support branchy workflow, 2010-04-23).
Diffstat (limited to 'Help/variable/CMAKE_VERSION.rst')
-rw-r--r--Help/variable/CMAKE_VERSION.rst48
1 files changed, 42 insertions, 6 deletions
diff --git a/Help/variable/CMAKE_VERSION.rst b/Help/variable/CMAKE_VERSION.rst
index 4ccc491..6184f08 100644
--- a/Help/variable/CMAKE_VERSION.rst
+++ b/Help/variable/CMAKE_VERSION.rst
@@ -1,10 +1,46 @@
CMAKE_VERSION
-------------
-The full version of cmake in major.minor.patch[.tweak[-id]] format.
+The CMake version string as up to four non-negative integer components
+separated by ``.`` and possibly followed by ``-`` and other information.
+The first three components represent the feature level and the fourth
+component represents either a bug-fix level or development date.
-This specifies the full version of the CMake executable being run.
-This variable is defined by versions 2.6.3 and higher. See variables
-CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION, CMAKE_PATCH_VERSION, and
-CMAKE_TWEAK_VERSION for individual version components. The [-id]
-component appears in non-release versions and may be arbitrary text.
+Release versions and release candidate versions of CMake use the format::
+
+ <major>.<minor>.<patch>[.<tweak>][-rc<n>]
+
+where the ``<tweak>`` component is less than ``20000000``. Development
+versions of CMake use the format::
+
+ <major>.<minor>.<patch>.<date>[-<id>]
+
+where the ``<date>`` component is of format ``CCYYMMDD`` and ``<id>``
+may contain arbitrary text. This represents development as of a
+particular date following the ``<major>.<minor>.<patch>`` feature
+release.
+
+Individual component values are also available in variables:
+
+* :variable:`CMAKE_MAJOR_VERSION`
+* :variable:`CMAKE_MINOR_VERSION`
+* :variable:`CMAKE_PATCH_VERSION`
+* :variable:`CMAKE_TWEAK_VERSION`
+
+Use the :command:`if` command ``VERSION_LESS``, ``VERSION_EQUAL``, or
+``VERSION_GREATER`` operators to compare version string values against
+``CMAKE_VERSION`` using a component-wise test. Version component
+values may be 10 or larger so do not attempt to compare version
+strings as floating-point numbers.
+
+.. note::
+
+ CMake versions prior to 2.8.2 used three components for the
+ feature level and had no bug-fix component. Release versions
+ used an even-valued second component, i.e.
+ ``<major>.<even-minor>.<patch>[-rc<n>]``. Development versions
+ used an odd-valued second component with the development date as
+ the third component, i.e. ``<major>.<odd-minor>.<date>``.
+
+ The ``CMAKE_VERSION`` variable is defined by CMake 2.6.3 and higher.
+ Earlier versions defined only the individual component variables.