[CMake] Version Check

Rolf Eike Beer eike at sf-mail.de
Thu Sep 5 05:26:16 EDT 2013


Am 05.09.2013 11:21, schrieb Renato Golin:
> While searching for a version number comparison, I found a few custom
> solutions[1][2], but nothing official. Is there a canonical way of 
> saying:
> 
> IF (LIBXML2_VERSION GREATER_EQUAL 2.8.0)
>   do_something...
> END
> 
> If not, which is the custom solution I should use?

cmake --help-command if

if (NOT LIBXML2_VERSION VERSION_LESS 2.8.0)
   message(STATUS "libxml too old")
endif ()

Eike
-- 


More information about the CMake mailing list