[CMake] CMAKE_PARSE_ARGUMENTS - nice but ..

Alexander Neundorf a.neundorf-work at gmx.net
Mon Jan 14 15:02:44 EST 2013


Hi Tomasz,

On Monday 14 January 2013, Tomasz Majchrowski wrote:
> Dear CMake Community
> 
> Since couple of release cmake is distributed with macro:
> cmake_parse_arguments
> http://www.cmake.org/cmake/help/v2.8.9/cmake.html#module:CMakeParseArgument
> s It's very convenient macro, however the macro do not check if the
> argument is mandatory or optional.
> 
> Q1: Is there any generic macro which can do it for me or I should take
> care myself about this check ?

do it yourself.
After parsing, check whether it has been defined:

if(NOT DEFINED SOMEPREFIX_FOO)
   message(FATAL_ERROR "Argument FOO has not been set")
endif()

Alex


More information about the CMake mailing list