That is completely fair. Perhaps a bit of Friday brain from me. It still could 
reduce complexity if you are trying to do something more complicated.

In my opinion A is easier to read than B.

A: if ( $1 STRGREATER_EQ $2 AND $3 STRLESS $4 AND $5 STRLESS_EQ $6 )
B: if ( NOT $1 STRLESS $2 AND $3 STRLESS $4 AND NOT $5 STRGREATER $6)

H


Harry Mallon
CODEX | Software Engineer
60 Poland Street | London | England | W1F 7NT
E [email protected] | T +44 203 7000 989
> On 8 Apr 2016, at 15:42, Ben Boeckel <[email protected]> wrote:
>
> 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
>

-- 

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