2008/10/16

CMake

Last spring I evaluated waf as an alternative to SCons (and its 3rd party Qt4.py plugin) for Qt4 projects. I've finally settled on CMake.

waf's wscript files could be beautifully concise. Alas, support for Qt4 applications was unstable, and the support for building OS X application bundles was both rudimentary and unstable. (By "unstable" I mean that the qt4 and osx tools would break periodically, and/or that the internal APIs would change so much between releases that my own customizations would break.)

The final straw was that I could not control the library order when linking static Qt4 libraries. That made it impossible for me to build Qt4 apps which used QtSvg.

I wish I had time to document these problems properly -- no doubt waf's maintainer(s) would prefer bug reports to detail-free claims that "it doesn't work."

In any case, CMake seems to be doing the job. It can perform out-of-line builds, supports defining and running unit tests, and doesn't get in the way of writing integration tests in Python, to drive e.g. C++ programs. It knows how to build Qt4 applications and lets me control the link order for static libraries. And it works well on OS X and Linux.

No comments: