[cmake-developers] Suggest if function has lte gte operators

Ben Boeckel ben.boeckel at kitware.com
Fri Apr 8 10:42:33 EDT 2016


On Fri, Apr 08, 2016 at 14:24:08 +0000, Harry Mallon wrote:
> CMake's "if" functionality is missing greater than or equal to and
> less than or equal to. This change could be tweaked and added to
> provide this functionality to avoid things like "if(VERSION_STRING
> VERSION_GREATER "4.8.0" OR VERSION_STRING VERSION_EQUAL "4.8.0")".

This can also be done as:

    if (NOT VERSION_STRING VERSION_LESS "4.8.0")

I'm ambivalent on the idea of new operators. Documentation for this
pattern would likely help.

--Ben


More information about the cmake-developers mailing list