[cmake-developers] Documentation of version comparisons needs updating

Alan W. Irwin Alan.W.Irwin1234 at gmail.com
Sat Sep 15 18:55:48 EDT 2018


The current (3.12.2) "if" documentation says, e.g.,

if(<variable|string> VERSION_LESS_EQUAL <variable|string>)
Component-wise integer version number comparison (version format is major[.minor[.patch[.tweak]]]).

But what happens if any component of the version string is not an
integer, e.g.,

cmake version 3.12.20180915-g6f04e

for the latest git version used for the cmake dashboard.  It
appears from the

CMAKE_CACHE_PATCH_VERSION:INTERNAL=20180915

CMakeCache.txt entry that the string "20180915-g6f04e" is reliably
converted in that case to the integer 20180915, but does that reliable
conversion also occur for the "if" VERSION comparisons?  And if so,
shouldn't the "if" documentation say something about truncation of
trailing non-integer parts of the version components?

What has lead me to these two questions is I am trying to distinguish
between the above version and 3.12.2, and since the documentation did
not acknowledge what would be done when non-integer strings were appended
to any of the integer components of the version string, I am concerned
the component integers might be determined in an unreliable way for
trailing non-integer string cases.

Alan
__________________________
Alan W. Irwin

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the cmake-developers mailing list