CMake is a (not
the) correct answer according to the Ninja manual[1]. "Some explicit non-goals: convenient syntax for writing build files by hand. You should generate your ninja files using another program. This is how we can sidestep many policy decisions."
The other options are here: https://github.com/ninja-build/ninja/wiki/List-of-generators...
[1] https://ninja-build.org/manual.html#_design_goals