Hacker News new | ask | show | jobs
by starseeker 4105 days ago
Everybody hates some aspects of some of them, in my experience. People also tend to have strongly held preferences in the build system department - it's a bit like text editors. I tend to view it as problem-dependent as to which system is better. If you're all java, you probably want a build tool designed for that language (for example.) Lisp has asdf and friends. My focus (cross platform C/C++ building) has led me to deal with autotools and CMake. I prefer CMake for 3 major reasons: 1) self contained - you just install CMake itself and you can handle all sorts of things (tar.bz2 decompression, file copying, directory creation, etc.) automatically and portably. No need to first install Python or Perl or... whatever for Windows. From a Linux/*BSD perspective, developing on Windows is like crossing the Sahara - you need to carry your own supplies. CMake packs a lot into a small, self contained package. 2) Learn one language and you're done. Would it have been better to go with something like lua? Probably, in hindsight (my opinion). However, compared to the mind bending complexity that is sh + m4 + automake + autoconf + ... CMake is (in my experience) quite a lot easier to get a handle on. 3) Wide support for many platforms/tools (Visual Studio, Xcode, ninja, make, Eclipse, etc.) from one common set of build definitions. The maintenance savings really add up if you need to support all those tools - Hunt and Thomas's DRY principle in action.
2 comments

I'm a fan of CMake for C++ as well, but have also worked on projects that included C++, C++/CLI, and C# and unfortunately CMake support for .NET projects is close to non-existent (there is some, but it's woefully inadequate). I managed to get it to work, but in a very non CMake way (basically generating the .csproj files by replacing variables within the XML with the appropriate value).

As for MSBuild and VS - I thought that Visual Studio actually compiles things with devenv.exe, rather than MSBuild. I remember working on a project where I was trying to set up Jenkins CI to build our projects and MSBuild wouldn't work (because the environment wasn't set up correctly), but using devenv.exe instead worked perfectly.

The CMake language is just an atrocious mess, but that gets easier with time. The main problem with CMake on Windows is that it is really really slow for large projects (because it has to call back out to CMake to do all sorts of basic stuff) and that debugging CMake errors is horrifically hard (this has improved in recent MSVS generator integration, but I'm stuck w/ VS2008 still).