(Note: The stackoverlfow I paste there actually does have a second person giving a pure-CMake way of solving this problem. It's just… it's just that the pure CMake way is way, way worse.)