It’s been over 4 years since my last post on cursed CMake operations, and
quite a lot has changed in that time making some or most of the workarounds and
hacks I showed off completely obsolete! This is a good thing. It means users
don’t have to write cursed CMake to get their build to operate in a specific
way. Unfortunately, the previous hacks haven’t been removed or blocked in any
way, so my post showing off various pitfalls is still as relevant as ever.
However, it also means that I, of course, have learned even newer tricks
during this time, some of which I will be showing today. On the bright side, I
see fewer instances of people overriding the CMAKE_CXX_FLAGS cache variable
with each passing day. Nature is healing.