[cmake-developers] lua bindings?

Bill Hoffman bill.hoffman at kitware.com
Fri Aug 3 18:10:53 EDT 2012


On 8/3/2012 5:30 PM, Óscar Fuentes wrote:
> Brad King <brad.king at kitware.com> writes:
>
> [snip]
>
>> As for your first option, a "zero-impact wrapper", what do you
>> envision would be the benefits?
>
> [I'm not the OP]
>
> Something I sorely miss on CMake is a way to express algorithms in a
> clear way and to process large amounts of data efficiently.
>
> For an example that could benefit from a cleaner and more expressive
> language, see function explicit_map_components_to_libraries in
>
> http://www.llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVM-Config.cmake?revision=145355&view=markup
>
> On the same project, there was several perl scripts that I'll like to
> implement on CMake (and hence drop the Perl requirement.) Those scripts
> walked through all defined and referenced symbols on all libraries on
> the project for creating library dependencies. On another instance, a
> similar taks would be performed on Visual C++ for creating .def files
> and dll's. On both cases I stumbled on the language's lack of
> expresiveness, minimal support for data structures and on an apparent
> O(n^2) time complexity on some list operations (including the append
> operation, IIRC)
>
So, we have talked about this at Kitware some recently and came up with 
a gradual approach that should work.

1. Add lua to cmake as a command.  Something like cmake -E tar, but 
cmake -E lua.  This would mean that lua would always be something you 
could count on having with cmake.

2. Add a simple integration into the cmake language that lets you 
evaluate lua inside a cmake file.  Something like eval_lua("...").

3. If 1 and 2 go well, investigate binding the cmake commands into lua. 
(LuaCMake)

With this approach there would be benefit to the whole cmake community 
from Lua.  You would not have to convert your project to LuaCMake (3) to 
take advantage of more expressive language.  You could just eval some 
lua statements in an existing large cmake project.  I would not want to 
fork cmake into lua cmake and cmake cmake, but this path forward would 
avoid that.

All that said, we do not at the moment have funding for such a project 
at Kitware.

-Bill




More information about the cmake-developers mailing list