[Cmake] Macro definition

Andy Cedilnik andy.cedilnik at kitware.com
Thu, 29 Jan 2004 08:45:19 -0500


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:
> 	MY_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}")

				Andy