[CMake] [PATCH] BeOS support.

Ryan C. Gordon icculus at icculus.org
Tue Nov 7 12:53:41 EST 2006


Having nothing but heartburn every time I touch autoconf, I've been 
hoping for something to come and replace it for some time now...so I was 
thrilled to hear that something as big as KDE was moving to CMake wholesale.

I've started playing with it for my own projects now, too, and was 
pleasantly surprised to see two of them already have Find modules 
shipped with CMake's source (FindSDL_sound.cmake and 
FindPhysFS.cmake)...so I figured I should see about getting SDL_sound 
and physfs themselves moved over to CMake, too.

The problem is that these libraries support a lot of obscure and absurd 
platforms, so I started staring at the ones I would immediately lose by 
moving from autoconf/automake to CMake.

Lots of these I could do without ("Atheos"? Did anyone ever really run 
that?!), but there ARE some mainstream dying also-runs.

Like BeOS.

So I took some time to get CMake running on BeOS 5. Here's the patch:

    http://icculus.org/~icculus/tmp/cmake-2.4.3-beos-RYAN1.diff

(Sorry for the URL, I didn't want to send a 30k attachment to everyone 
on the mailing list.)

Apply that patch to a clean copy of CMake 2.4.3:

    tar -xzvvf cmake-2.4.3.tar.gz
    patch -p0 < cmake-2.4.3-beos-RYAN1.diff


Some notes:
1) cmake, cpack, ctest all compile, and "make test" passes 100%.
2) ccmake will compile and work if you install ncurses on your system.
3) This will probably work on the YellowTab Zeta OS (and Haiku?), too.
4) This adds a new variable to match UNIX and WIN32..."BEOS". "UNIX" is 
also set, since by and large, it's a quirky sort of Unixy, POSIXy system.

There were a small pile of little changes (like the lack of usleep() and 
realpath(), and mkdir("path/") failing with ENOENT instead of just 
making "path" like you'd expect), but the biggest changes were in 
Source/kwsys/ProcessUNIX.c, where select() doesn't work. BeOS treats 
select() like WinSock does...it doesn't work with regular file 
descriptors. That code got rewritten to use non-blocking reads. It's an 
#ifdef right now, but I tested it on Linux, and it works, so it might be 
better to just ditch the select() codepath altogether rather than keep 
them both. Other than that, I filled in the DynamicLoader code and then 
just kept cleaning things up until it compiled and passed all the tests.

I'm not really a BeOS expert, but this appears to work well enough. It 
may need more tweaking, but it seemed to me that every project I tried 
was able to build Unix Makefiles properly with CMake. I'd like to see 
this patch integrated with the official CMake distribution.

Let me know if there are any questions or comments.

--ryan.



More information about the CMake mailing list