2 ms·
I've been using CMake off and on for years now, including recently. I feel no joy using it. The syntax is ridiculous, the semantics are worse, and the documen
by klodolph 11y ago
I've been using CMake off and on for years now, including recently. I feel no joy using it. The syntax is ridiculous, the semantics are worse, and the documentation is poor, even in 2016. It gets the job done, but it is a royal pain in the butt. Whenever feasible, I'll use something else. These days, that usually means writing a quick build script generator in Python. I've been around for a while, so I remember using a lot of different build tools, from monstrosities like autotools (which has good points), hand-written makefiles, to "modern" designs like Jam, SCons, NAnt. CMake is basically the least usable of all of these (except autotools), but at the same time it is the only one which solves the desired task.
I wouldn't say that it's just a matter of money and popularity. C and C++ are both quite popular these days. The problem is that the tooling is so different between platforms. You want to build a shared library? Hah, the process is quite different on Windows, and there are non-trivial differences between OS X and Linux too. You need to change your header files on Windows depending on whether the library is static or dynamic, and you even need to worry about things like "who calls free()" because as soon as you make a DLL you can't be sure that the person calling your code has the same malloc that you do.
With JS, Go, and Rust, the toolchain is identical on all platforms, there are no header files, et cetera.
We've had decades to try and make C tooling nice and easy, and it simply hasn't happened, despite the language's overwhelming popularity. The most usable solution we've really come up with is writing C on your favorite Linux distro, where you can just apt-get whatever you want and pkg-config it into your build system. But once you want to build on OS X, you get to choose between the insanity of Homebrew or the insanity of building your own packages. On Windows, things are even harder, because suddenly all the shell scripts that propped up your build system stop working.
Your experience on Arch just reflects the reality of cross-platform development: it's awesome if you can avoid it. I do most of my development on a Linux system as well and I can reasonably call it a "joy" right up to the point when I need to finish the Windows and OS X ports. I don't think that you can truly experience the horrors of CMake if you stick to Linux. Heck, on Linux, you can hand-write makefiles fairly reasonably, if you know what you're doing.
- spriggan3 11y agoOn Windows I was rather successful with developing C apps with msys2 which comes with a Posix envirronment and pacman package manager. Most source that use posix compliant apis compile on windows and mingw provides a few handy adapters. It's obviously not going to run docker containers but it's really handy, I was successful compiling quite a lot of c projects from scratch, including some Gtk3 apps.
- klodolph 11y agoUnfortunately, that won't work for me. Compiling with MSC is a requirement, for various reasons.