CMake Lua modules

152 views
Skip to first unread message

Wesley Smith

unread,
Feb 3, 2008, 6:03:51 AM2/3/08
to cmak...@googlegroups.com
Does there exist a CMake script for Lua modules that woks on Windows and OSX?
thanks,
wes

E. Wing

unread,
Feb 3, 2008, 6:24:41 AM2/3/08
to cmak...@googlegroups.com
I'm not sure what you mean by that. CMakeLua should work on Windows
and OS X already iff you use the Makefile generator. The Visual Studio
generator is not supported yet, and I don't remember if the Xcode
generator works. It looks like there is some hardcoded stuff that
makes the Visual Studio generator bail out if there isn't a
CMakeLists.txt.

Thanks,
Eric

Wesley Smith

unread,
Feb 3, 2008, 6:28:07 AM2/3/08
to cmak...@googlegroups.com
I mean I have module X and I want to build X.so on OSX and X.dll on
windows. Are there CMake scripts out there that I can use as a
template for my project?

thanks,
wes

E. Wing

unread,
Feb 3, 2008, 6:44:06 AM2/3/08
to cmak...@googlegroups.com
> I mean I have module X and I want to build X.so on OSX and X.dll on
> windows. Are there CMake scripts out there that I can use as a
> template for my project?
>

Oh, so to do that, try something like:

PROJECT(MyProject)
ADD_LIBRARY(foo MODULE foo.c)


Be aware that on OS X, there is a difference between a 'module'
(loadable bundle) and dynamic library (.dylib). If you want a dynamic
library, you should instead do:

ADD_LIBRARY(foo SHARED foo.c)

This should make a library called foo.dll on Windows, libfoo.so on
ELF, and libfoo.dylib on Mach-O. Also, there is some beta/pre-release
stuff for OS X style .frameworks if you know all the super-secret
incantations.


As for other projects to look at...I'm drawing blanks on easy stuff.
(I've been using CMake too long when there was nothing good to look
at.) I'm involved with the OpenSceneGraph project and you can look at
that one, but it's not the most trivial build system (but not horribly
complex either), but it probably does hit most of the bullet points
(executables, dynamic libraries, modules, etc). Maybe you can try
plPlot? I don't know much about the source, but it's got to be a lot
smaller than OSG.


Thanks,
Eric

Peter Drahoš

unread,
Feb 3, 2008, 10:59:30 AM2/3/08
to cmak...@googlegroups.com

Try checking LuaDist (luadist.sf.net) it uses Cmake to build Lua/
LuaJIT and modules (which are fetched from online repo) .. still a
work in progress but it works most of the time ;P.

pd.

Wesley Smith

unread,
Feb 3, 2008, 4:33:25 PM2/3/08
to cmak...@googlegroups.com
Thanks for the link Peter. Very nice. What is the relationship
between LuaDist and LuaRocks?
best,
wes

Peter Drahoš

unread,
Feb 4, 2008, 2:49:17 AM2/4/08
to cmak...@googlegroups.com
LuaDist will be a complete package distributing Lua while still using
LuaRocks for package management. We provide LuaRocks with feedback and
CMake support. While the project its still immature we are waiting for
the LuaRocks things to settle down a bit and then release a first
version. Think of LuaDist as self contained, automatically configured
Lua/LuaRocks/LuaJIT with CMake.

pd.

Wesley Smith

unread,
Feb 4, 2008, 2:50:09 AM2/4/08
to cmak...@googlegroups.com
> LuaDist will be a complete package distributing Lua while still using
> LuaRocks for package management. We provide LuaRocks with feedback and
> CMake support. While the project its still immature we are waiting for
> the LuaRocks things to settle down a bit and then release a first
> version. Think of LuaDist as self contained, automatically configured
> Lua/LuaRocks/LuaJIT with CMake.
>

Sexy!
wes

Reply all
Reply to author
Forward
0 new messages