New Cmake Build System
<i>This post was originally made by <b>Yagisan</b> on the dengDevs blog. It was posted under the categories: Engine, Games, jDoom, jHeretic, jHexen, Mac OS X, Unix/Linux, Windows.</i>
<p>Recently I've begun implementing a new cross platform build system for Doomsday. I've based this system on Cmake ( http://www.cmake.org/HTML/Index.html ). Cmake is a cross platform build system that uses the native tools of the system it builds on, eg VisualC++/BorlandC on Windows, Xcode on OSX and Makefiles on *NIX, as well as MinGW/Cygwin on Windows.</p>
<p>The goal of this system is to produce a single, unified build system that allows any changes to instantly propogate between builds.</p>
<p>Currently the new cmake system has been tested to build the doomsday engine, and the opengl plugin on Ubuntu Dapper, Linux systems. Win32 should work, but has not been tested - Dani it would help if you could test that. OSX might need more support before it builds, Skyjake, you'll need to give it a test. As of svn 3389 there is a known issue with the *NIX builds. Either we need to integrate libtool into cmake (which I've found no documentation for) and move engine/unix/src/sys_dylib.c and it's headers to an OSX specifc directory, or we can modify engine/unix/src/sys_dylib.c to do the right thing on *NIX and OSX depending on whether -DUNIX or -DMACOSX is passed to it. Second choice is probally easier. The error caused by this include looks like this. Obviously looking in the wrong spot.</p>
<p>./doomsday<br />
While opening dynamic library<br />
/tmp/5/Bundles/libdropengl/Contents/MacOS/libdropengl:<br />
/tmp/5/Bundles/libdropengl/Contents/MacOS/libdropengl: cannot open shared object file: No such file or directory<br />
DD_InitDGL: Loading of libdropengl failed.<br />
(null).</p>
<p>To invoke cmake, currently you go to the top level source directory and run "cmake ." In future I'll make it so you must do an out of tree build, but for now that is fine. IIRC you can get a gui with "ccmake ." On *NIX after running cmake, just type make to build. On Windows you may need to specify VisualC++ project files as output. Best to use the gui version then, same with OSX and Xcode projects.</p>
<p>I appreciate patches to make cmake work better on Win32 and on OSX. USers in #doomsday have already begun downloading the new buld system and testing it on their *NIX boxes.
</p>
<p>Recently I've begun implementing a new cross platform build system for Doomsday. I've based this system on Cmake ( http://www.cmake.org/HTML/Index.html ). Cmake is a cross platform build system that uses the native tools of the system it builds on, eg VisualC++/BorlandC on Windows, Xcode on OSX and Makefiles on *NIX, as well as MinGW/Cygwin on Windows.</p>
<p>The goal of this system is to produce a single, unified build system that allows any changes to instantly propogate between builds.</p>
<p>Currently the new cmake system has been tested to build the doomsday engine, and the opengl plugin on Ubuntu Dapper, Linux systems. Win32 should work, but has not been tested - Dani it would help if you could test that. OSX might need more support before it builds, Skyjake, you'll need to give it a test. As of svn 3389 there is a known issue with the *NIX builds. Either we need to integrate libtool into cmake (which I've found no documentation for) and move engine/unix/src/sys_dylib.c and it's headers to an OSX specifc directory, or we can modify engine/unix/src/sys_dylib.c to do the right thing on *NIX and OSX depending on whether -DUNIX or -DMACOSX is passed to it. Second choice is probally easier. The error caused by this include looks like this. Obviously looking in the wrong spot.</p>
<p>./doomsday<br />
While opening dynamic library<br />
/tmp/5/Bundles/libdropengl/Contents/MacOS/libdropengl:<br />
/tmp/5/Bundles/libdropengl/Contents/MacOS/libdropengl: cannot open shared object file: No such file or directory<br />
DD_InitDGL: Loading of libdropengl failed.<br />
(null).</p>
<p>To invoke cmake, currently you go to the top level source directory and run "cmake ." In future I'll make it so you must do an out of tree build, but for now that is fine. IIRC you can get a gui with "ccmake ." On *NIX after running cmake, just type make to build. On Windows you may need to specify VisualC++ project files as output. Best to use the gui version then, same with OSX and Xcode projects.</p>
<p>I appreciate patches to make cmake work better on Win32 and on OSX. USers in #doomsday have already begun downloading the new buld system and testing it on their *NIX boxes.
</p>
Comments
Yagisan, I found <a href="http://www.cmake.org/Wiki/CMakeMacroLibtoolFile" title="" rel="nofollow">this page</a> a custom macro for libtool. However, my impression is that Cmake doesn't really expect you to use libtool. It is expected that you will use Cmake's facilities to build libraries.
All that needs to be done is to set up install routines, test build on Win32 + fixes if needed, and test build on OSX + fixes. We should be able to make a universal binary for OSX with this in future.
When it comes to Universal binaries, I think the biggest hurdle is with the dependencies: the last time I checked SDL, SDL_net, and SDL_mixer were not all available directly as universal binaries. Compiling them from source should be possible, but needs a bit more effort naturally.
BTW - I haven't disappeared, I've just been very busy these past two weeks.
I've observed that the bspcache directory is not being created in the runtime directory. I don't know why this is at this stage.
* libmaploader is not being loaded at all, so no glnodes get built (how is it running the maps then?! I double checked with strace, it really isn't loading it)
* libjhexen, segfaults on startup with /opt/yagi-cmake/lib/libjhexen.so:
/opt/yagi-cmake/lib/libjhexen.so: undefined symbol: paused
InitGame: Loading of libjhexen failed ((null)).
libdsopenal also fails to load due to missing symbols.
DaniJ could you try building this with cmake, and letting me know what tools you used, and what the outcome was ?
A test run on OSX from you Skyjake would be nice too.