I've replaced some CMake stuff with Nim as well. It's surprising how much simpler life is with sane os / arch checks vs the CMake pains. I just wish `pkg-config` was better supported as some C/C++ packages don't set it up.
@didlybom it's a compile time pragma and so requires compile time constants. Most any string manipulation that works at compile time should be fine.