[CMake] list of lists -possible?
Hendrik Sattler
post at hendrik-sattler.de
Wed Jun 2 13:02:18 EDT 2010
Am Mittwoch 02 Juni 2010, 18:34:56 schrieb Clinton Stimpson:
> On Wednesday, June 02, 2010 10:24:44 am Doug Reiland wrote:
> > Is it possible to implement a list of lists. The following example
> > shows cmake ending up with a list with 6 elements instead of
> > a list with 2 elements with each element being a list with 3 elements
> >
> > set(fooa 1 2 3)
> > set(foob a b c)
> > message(${fooa})
> > message("${fooa}")
> > message("${foob}")
> > list(APPEND foos "${fooa}")
> > list(APPEND foos "${foob}")
> > message("${foos}")
> > foreach (a ${foos})
> > message(${a})
> > endforeach()
>
> You can put the name of the list in another list, instead of its contents.
> And use a nested foreach to extract all of the contents.
I couldn't find a non-hackish way to include a variable into a cmake list,
e.g. a java classpath argument into a cmake list of command line options.
IMHO, escaping the ';' would allow this but I couldn't find out how :-(
HS
More information about the CMake
mailing list