[cmake-developers] Is GET_OPTION_VALUE() a good name ?
Alexander Neundorf
neundorf at kde.org
Mon Aug 9 15:57:42 EDT 2010
On Monday 09 August 2010, Brad King wrote:
> On 08/07/2010 03:41 PM, Alexander Neundorf wrote:
> > # Call the function, if the keyword is present the value(s) following it
> > will # be returned in _FAIL_MESSAFE/_VERSION_VAR/_REQUIRED_VARS:
> > FPHSA_GET_OPTION_VALUE("FAIL_MESSAGE" _FAIL_MESSAGE ALL_ARGS _KEYWORDS
> > FALSE) FPHSA_GET_OPTION_VALUE("VERSION_VAR" _VERSION_VAR ALL_ARGS
> > _KEYWORDS FALSE) FPHSA_GET_OPTION_VALUE("REQUIRED_VARS" _REQUIRED_VARS
> > ALL_ARGS _KEYWORDS TRUE)
>
> I think a better name would be something like "cmake_get_keyword_argument".
Ok.
> This interface requires the same argument lists to be traversed many times.
Not completely.
It stops when it has finished the arguments for one keyword and it also
removes the stuff it consumed from the list, so the list gets shorter each
call.
> I think we should be using a macro like PARSE_ARGUMENTS from Boost's CMake
> build system (see below). This is its interface documentation:
>
> # The PARSE_ARGUMENTS macro will take the arguments of another macro and
> # define several variables. The first argument to PARSE_ARGUMENTS is a
> # prefix to put on all variables it creates. The second argument is a
> # list of names, and the third argument is a list of options. Both of
> # these lists should be quoted. The rest of PARSE_ARGUMENTS are
> # arguments from another macro to be parsed.
> #
> # PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...)
The last time I looked at some similar function (was it also in boost ?) it
didn't seem powerful enough.
I'll have a look.
Alex
More information about the cmake-developers
mailing list