Or you can use Nim files as a build system:
"Small" example with one-pass static compilation of all C files:
Original cmake was 800+ lines (to handle all combination of Windows, Linux, Mac, Android, iOS, x86, x86-64, ARM32, ARM64)
Complex example in 2 passes which builds the C++ DLL via Nim:
and then wrap it:
Original CMake was 250+ lines