CMake: The worlds most obtuse build system

I used to think autoconf and automake were bad. I have seen the light. Forgive me, Gnu, for I have cmaked :(

Ok – so – it’s possible that CMake is actually quite dandy. But their documentation pretty much consists of “Buy our book, Mastering CMake”. Sadly, I have not yet earned the status of Padawan – I’m not ready to spend $$$ on mastering.

There’s the minor matter that CMake doesn’t provide support for pre-compiled headers or forced includes. The official line being “not every platform supports it” and “we’re not making much money from this”.

Right now I’m arm-wrestling with how to add specific compiler flags to specific executables and libraries only. set_target_properties(target PROPERTIES DEFINE_SYMBOL symbol) does not work.

4 Comments

Just thank the lord you aren’t using Jam. We used to use that to build our projects at work here, and then we got angry and two of us wrote a C# based build-system that actually works fast and who’s scripts are maintainable by the common man (scripts are written in C#). I really wish we could get approval to release it as an open-source app so others could use it… :(

I liked using ANT when I did Java. Other than that I prefer languages which need no build system :-)

It turns out it was

set_property(TARGET libteulserver PROPERTY COMPILE_DEFINITIONS AS_CLIENT KIT_SERVER)

with the right version of CMake.

Still no built-in support for precompiled headers :(

And to give it credit – I do actually now have a close approximation of the host project under Visual Studio 9 and 2010 now. If I told it to use Cygwin/MinGW, it would probably build too.

But this is close enough – I have Intellisense (and VS2010’s is absolutely awesome; it’s like an interactive precompiler! Finally!) and a GUI. I’m happy.

Leave a Reply

Name and email address are required. Your email address will not be published.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

You may use these HTML tags and attributes:

<a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <pre> <q cite=""> <s> <strike> <strong> 

%d bloggers like this: