[Cmake] Macro definition

David Svoboda xsvobod2 at informatics.muni.cz
Thu, 29 Jan 2004 17:50:14 +0100


On Thu, 29 Jan 2004, Andy Cedilnik wrote:

> Hello David,
>
> On Thu, 2004-01-29 at 02:45, David Svoboda wrote:
> > I tried to define my own MACRO - e.g. like this:
> >
> > MACRO(MY_MACRO MY_PATHS MY_FILES)
> >  ...
> > ENDMACRO(MY_MACRO)
> >
> > Then I typed
> > SET(PS /usr/yyy /usr/xxx)
> > SET(FS aaa bbb ccc)
> >
> > and called
> > MY_MACRO(${PS} ${FS})
> >
> > As you can imagine, the instantiation of "local variables" in macro is =
not
> > correct - files names and path are mixed. How to separate the macro
> > arguments? I'd like to write something like this:
> > =09MY_MACRO(PATHS ${PS} FILES ${FS})
> > similary to FIND_LIBRARY macro definition. Is there any possible way?
>
> Your macro takes two arguments but you specified five. You should call
> it with:
>
> MY_MACRO("${PS}" "${FS}")
>
> =09=09=09=09Andy

Well, in this case, I'd like to study the definition of FIND_LIBRARY
macro, because this macro is capable of maintaining variable number of
arguments and it does not require >>"<< sign when calling this macro with
any arguments.


David Svoboda

----------------------
Faculty of Informatics, Masaryk University
Botanick=E1 68a, 602 00 BRNO, Czech Republic
e-mail: svoboda at fi.muni.cz
tel: +420-549 494 383