[CMake] CMake with Lua Experiment
Brandon Van Every
bvanevery at gmail.com
Tue Nov 27 15:16:04 EST 2007
On Nov 27, 2007 2:32 PM, Brandon Van Every <bvanevery at gmail.com> wrote:
> On Nov 26, 2007 3:55 PM, Brandon Van Every <bvanevery at gmail.com> wrote:
> >
> > I noticed the "unpack" command.
> >
> > sources = {
> > "simpleLib.cxx",
> > "simpleCLib.c",
> > "simpleWe.cpp"
> > }
> >
> > cm_add_library ("simpleLib", "STATIC", unpack(sources));
> >
> > Would this be necessary / paradigmatic in Lua? In CMake I just use lists.
>
> Reading the Lua docs, it seems one uses a table instead of a list.
> There's a shorthand for calling a function that has 1 table as its
> argument: f{whatever} instead of f({whatever}). So I think the above
> could have been:
>
> cm_add_library{"simpleLib", "STATIC", "simpleLib.cxx", "simpleCLib.c",
> "simpleWe.cpp"}
>
> and of course the function would have to handle the table
> appropriately.
Lua also has a varargs interface via ... so there's no reason this has
to be done with a table. But I guess you knew that already. So, the
real wart is that in CMake we only have to type ${sources} and in Lua
we'd have to type unpack(sources) all the time. That's gonna get old.
> Now I'll see if we can get rid of all those pointless quotes.
It doesn't look possible. That's annoying.
Cheers,
Brandon Van Every
More information about the CMake
mailing list