<div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 16, 2018 at 6:57 AM Alan W. Irwin <<a href="mailto:Alan.W.Irwin1234@gmail.com">Alan.W.Irwin1234@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">The current (3.12.2) "if" documentation says, e.g.,<br>
<br>
if(<variable|string> VERSION_LESS_EQUAL <variable|string>)<br>
Component-wise integer version number comparison (version format is major[.minor[.patch[.tweak]]]).<br>
<br>
But what happens if any component of the version string is not an<br>
integer, e.g.,<br>
<br>
cmake version 3.12.20180915-g6f04e<br>
<br>
for the latest git version used for the cmake dashboard. It<br>
appears from the<br>
<br>
CMAKE_CACHE_PATCH_VERSION:INTERNAL=20180915<br>
<br>
CMakeCache.txt entry that the string "20180915-g6f04e" is reliably<br>
converted in that case to the integer 20180915, but does that reliable<br>
conversion also occur for the "if" VERSION comparisons? And if so,<br>
shouldn't the "if" documentation say something about truncation of<br>
trailing non-integer parts of the version components?<br>
<br>
What has lead me to these two questions is I am trying to distinguish<br>
between the above version and 3.12.2, and since the documentation did<br>
not acknowledge what would be done when non-integer strings were appended<br>
to any of the integer components of the version string, I am concerned<br>
the component integers might be determined in an unreliable way for<br>
trailing non-integer string cases.<br><br></blockquote><div><br></div><div><br></div><div>After checking the code to confirm the behavior, I've put up a merge request with clarification of the docs. You can find it here:</div><div><br></div><div><a href="https://gitlab.kitware.com/cmake/cmake/merge_requests/2393">https://gitlab.kitware.com/cmake/cmake/merge_requests/2393</a><br></div><div> </div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div><div><br></div><div>New book released: <a href="https://crascit.com/professional-cmake/" target="_blank">Professional CMake: A Practical Guide</a><br></div></div></div></div></div></div></div></div></div>