if we define three types of attributes (toggles/flags, options, and lists) we can map cmake_parse_arguments to an object's attributes in a relatively automated way.
Basically:
MyObject(CTOR the_obj A_FLAG)
would set the toggle attribute a_flag to TRUE (if A_FLAG doesn't appear it would default to FALSE),
MyObject(CTOR the_obj AN_OPTION foo)
would set the option attribute an_option to foo, and:
MyObject(CTOR the_obj A_LIST foo bar baz)
would set the list attribute a_list to foo;bar;baz. This in turn provides an easy way for to initialize an object given the kwargs a user provided.
if we define three types of attributes (toggles/flags, options, and lists) we can map
cmake_parse_arguments
to an object's attributes in a relatively automated way.Basically:
would set the toggle attribute
a_flag
toTRUE
(if A_FLAG doesn't appear it would default toFALSE
),would set the option attribute
an_option
tofoo
, and:would set the list attribute
a_list
tofoo;bar;baz
. This in turn provides an easy way for to initialize an object given the kwargs a user provided.