There’s a problem with CMake and code generators that keeps coming up from time to time. I’m talking about the kind of code generators where you know their list of output files only after they are done executing. The generally agreed upon rumour at my place of work and on the web is that integrating such a generator into CMake is a huge pain.
It turns out, the rumour isn’t quite accurate. And here’s why.
Code generators and the CMake build process
From a CMake centric point of view there are two types of code generators …
Building Qt is a bit of a hobby of mine. Not that I have a choice. MinGW 64bit is clearly not a first-class platform for the Qt developers. No official binary exists and most of the time Qt will only build after applying a patch or two. That’s why I built Qt 5.6.2 only now, even though it was released about two months ago.
I always try to build as much of Qt as possible, even though I only really need a relatively small subset. Two components are missing:
Windows is a hard environment for a C++ developer to live in – at least if you don’t use Visual Studio. What I find most annoying is setting up and maintaining several compiler toolchains in parallel. Compiler distributions – above all MinGW-w64 – are pretty much one-click installations these days, but easily switching the environment between different toolchains and moving those toolchains between computers ist still a hassle.
Since I’m lazy, I started scripting. Now I have a multi-toolchain ecosystem that can be moved between computers simply by copying a directory tree. Setting up and switching between environments is a single …