[CMake] Default parameters in macros

Hugo Heden hugoheden at gmail.com
Wed Nov 26 04:14:03 EST 2008


>>> Are all macro parameters optional by default? If not, how can I make them
>>> optional? I have a couple of required parameters and a few optional ones.
>>> Thanks.
>>
>> You can use the ${ARGV} special variable in macros to iterate over all
>> provided arguments.

> Would that be all arguments or only unnamed ones?

${ARGV} get you all args, ${ARGN} gives you the unnamed ones only. I
think. Better double check:

http://cmake.org/cmake/help/cmake2.6docs.html#command:macro

Hugo Heden



2008/11/25 Sean Soria <sean.soria at gmail.com>:
> Would that be all arguments or only unnamed ones?
>
> On Tue, Nov 25, 2008 at 12:46 PM, Alexander Neundorf
> <a.neundorf-work at gmx.net> wrote:
>> On Tuesday 25 November 2008, Robert Dailey wrote:
>>> Hi,
>>>
>>> Are all macro parameters optional by default? If not, how can I make them
>>> optional? I have a couple of required parameters and a few optional ones.
>>> Thanks.
>>
>> You can use the ${ARGV} special variable in macros to iterate over all
>> provided arguments.
>>
>> Alex
>> _______________________________________________
>> CMake mailing list
>> CMake at cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake
>>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list