cmake vs waf for C++ project

Wojciech Danilo picture Wojciech Danilo · Jan 9, 2013 · Viewed 8.3k times · Source

I found similar topic: What are the differences between Autotools, Cmake and Scons? , but my question is a little bit other and I think the answers could be other too.

I found a lot of articles telling that waf is unstalbe (API changes), is not yet ready for production etc (but all of these articles are 2 or 3 years old).

Which of these build tools should be used if I want to:

  • create big C++ (11) project - lets say a complex compiler
  • use with LLVM
  • be sure it will be flexible and simple to use
  • be sure it will be fast enought
  • compile under all standard platforms (the base platform is Linux, but I want to compile under Windows and MacOSX also)

Reading a lot of articles I found out Cmake and waf the "best" tools available, but I have no expirence with them and it is really hard to find out any comparison, which is not very biased (like comparison of the scons author) and not very old.really

Answer

alain picture alain · Mar 12, 2013

waf covers nearly all your requirements ...

  • API change: not a problem as waf shall be included in the source tarball (<100Ko)

  • big project: you can split your configuration in subdirectories (the contexts could be inherited). I've worked on projects with more than 10k files in C/C++/fortran77/fortran90/python/Cython including documentation in doxygen/sphinx.

  • flexibility and easyness: you can add extra modules en python (http://code.google.com/p/waf/wiki/AddingNewToolsToWaf)

  • fast: the tasks could be run in parallel: http://www.retropaganda.info/~bohan/work/psycle/branches/bohan/wonderbuild/benchmarks/time.xml

  • multi plat-form: you can run Waf everywhere python is available, that includes Windows and MacOs. Waf is compatible with mscvc, gcc, icc, and other compilers. You can produce visual/eclipse projects.

... but waf seems to have an issue with llvm: http://code.google.com/p/waf/issues/detail?id=1252

EDIT: as said by Wojciech Danilo, LLVM issue has been fixed