On 03/27/2017 05:03 PM, Roger Leigh wrote:
> I'd like to bring this issue to your attention to canvas some feedback 
> regarding the use of version suffixes:
> 
>    https://gitlab.kitware.com/cmake/cmake/issues/16716
> 
> The proposal linked above contains a much more detailed rationale and 
> suggested implementation strategy.  I'd be very happy to hear any 
> thoughts anyone has regarding this either on the above issue, or here.

Thanks for starting this thread.  I agree it would be nice to do more
general version comparisons.  However, I think more design work is
needed first.

Currently we have:

* cmSystemTools::VersionCompare compares leading unsigned integer
  components separated by `.` and ignores suffixes.  This is used
  by VERSION_LESS and such.

* cmSystemTools::strverscmp implements the strverscmp(3) function.
  This will happen to include suffixes in the version comparison due
  to a very clever definition of the comparison function, but it does
  not specifically treat suffixes as special.  It is also compatible
  with cmSystemTools::VersionCompare unless an integer component has
  leading zeros.  It is used by `CMAKE_FIND_PACKAGE_SORT_ORDER`, but
  otherwise we have no way to access it from the CMake language.

There are several version comparison conventions out there that interpret
suffixes in some way.  For example, PEP 440 [1].  I'd like to see a
summary of such schemes that are widely used.

Since CMake code often ends up comparing versions of other projects,
we may even need to implement several comparison functions and provide
a more general interface to specify which one to use for a given check.

Thanks,
-Brad


[1] https://www.python.org/dev/peps/pep-0440/#version-scheme

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to