Search code examples
c++command-linebuild-processmakefile

What GNU make substitute do you recommend?


Imagine you're free to choose a tool like GNU make for a new C++ project. What would you choose? Are any usable substitutes out there?

It shall have/be

  • a command line interface
  • "easy" to understand
  • easy to set up for a default c++ project
  • may support src/bin seperation as common for Java
  • may not add too much dependencies to other software/libs
  • platform independent (new)
  • features:
    • build rules / templates like make but in an human readable way
    • recursively crawling directories and applying the rules if there is no other "Makefile"
    • configuration by exception

Note:

Nothing's wrong with GNU make. I just don't like its grammar, all the stuff that grows in the years and the silly recursive make problems. I'm using gmake for years now.


Solution

  • I use cmake, and I'm very glad I made the switch.

    EDIT

    Feature list as found in the wikipedia article:

    • Configuration files are CMake scripts, which use a programming language specialized to software builds
    • Automatic dependency analysis built-in for C, C++, Fortran and Java
    • Support of SWIG, Qt, via the CMake scripting language
    • Built-in support for many versions of Microsoft Visual Studio including versions 6, 7, 7.1, 8.0, and 9.0
    • Generates build files for Eclipse CDT (C/C++ Development Tools)
    • Detection of file content changes using traditional timestamps,
    • Support for parallel builds
    • Cross-compilation
    • Global view of all dependencies, using CMake to output a graphviz diagram
    • Support for cross-platform builds, and known to work on
      • Linux and other POSIX systems (including AIX, *BSD systems, HP-UX, IRIX/SGI, and Solaris)
      • Mac OS X
      • Windows 95/98/NT/2000/XP, Windows Vista and MinGW/MSYS
    • Integrated with DART (software), CDash, CTest and CPack, a collection of tools for software testing and release

    But to be honest: Just about anything is better than the gnu toolchain.