[CMake] Using Macro function like
Andreas Pakulat
apaku at gmx.de
Mon Dec 3 06:49:35 EST 2007
On 03.12.07 11:57:42, Alexander.Camek at elektrobit.com wrote:
> > -----Original Message-----
> > From: cmake-bounces+alexander.camek=elektrobit.com at cmake.org
> > [mailto:cmake-bounces+alexander.camek=elektrobit.com at cmake.org
> > ] On Behalf Of Andreas Pakulat
> > Sent: Monday, December 03, 2007 11:52 AM
> > To: cmake at cmake.org
> > Subject: Re: [CMake] Using Macro function like
> >
> > On 03.12.07 05:47:29, Brandon Van Every wrote:
> > > On Dec 3, 2007 5:41 AM, <Alexander.Camek at elektrobit.com> wrote:
> > > >
> > > > I invoke the macro by calling it with C2ADA(${LIST_OF_FILES} ADS).
> > > >
> > > > Is there a possibilty to do what I want by using another command?
> > >
> > > You want variable arguments. Look in the MACRO docs for
> > ARGC, ARGV, and ARGN.
>
> Nope I want to have only two arguments. One for my list and one for the option.
>
> > And it might be easier if you switch positions for option and
> > file-list.
>
> So there is no other possiblity instead using ARGV?
>
> Thought it could be easier.
> Then I will parse the ARGV given list on my own.
There's no "parsing" needed if you have the option first and the list of
files as second part:
MACRO(Foo Option)
set(_myList ${ARGV})
LIST(REMOVE_AT _myFiles 0)
# Now ${Option} is the option value and ${_myFiles} is a list of files,
# do something with it
ENDMACRO(Foo)
Andreas
--
You have an ability to sense and know higher truth.
More information about the CMake
mailing list