[CMake] CMake with Lua Experiment

Brandon Van Every bvanevery at gmail.com
Tue Nov 27 14:32:11 EST 2007


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.  Now I'll see if we can get rid of all those pointless
quotes.


Cheers,
Brandon Van Every


More information about the CMake mailing list