A Diumenge 30 Març 2008, Adiel Mittmann va escriure:
> Hi!
>
> On Sun, Mar 30, 2008 at 08:13:27PM +0200, Leopold Palomo Avellaneda wrote:
> > but if I do:
> >
> > file(GLOB plugin_STR *.c *.cpp *.cxx *.h *.hpp)
> > PRINT_VALUES(${plugin_STR})
> >
> > where:
> >
> > macro(PRINT_VALUES list)
> > message (STATUS "Files to process in the macro PRINT_VALUES ${list}")
> > endmacro(CREATE_FILE_LIST)
>
> A minor correction here: it should be endmacro(PRINT_VALUES).
:-)
> > then I get _only_ the first value of the list.
>
> This is because each item of the list stored in your variable plugin_STR
> gets assigned to a different argument in your macro. This should fix it:
>
> macro(PRINT_VALUES list)
> FOREACH(arg ${ARGV})
> message("File: ${arg}")
> ENDFOREACH(arg ${ARGV})
> endmacro(PRINT_VALUES)
>
> > Or, what do I have to do to pass a list of values in a macro?
>
> You could do that by specifying the variable NAME instead of its VALUE:
>
> macro(PRINT_VALUES list)
> message (STATUS "Files to process in the macro PRINT_VALUES ${${list}}")
> endmacro(PRINT_VALUES)
>
> file(GLOB plugin_STR *.c *.cpp *.cxx *.h *.hpp)
> PRINT_VALUES(plugin_STR)
really,
thanks a lot.
Best regards,
Leo
--
--
Linux User 152692
PGP: 0xF944807E
Catalonia
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ CMake mailing list [email protected] http://www.cmake.org/mailman/listinfo/cmake
