Ähhhhh...
You want to call a build process by calling a "Build System generator" (CMake) to generate another "Build System" (ninja) unknown for CB . All of them inside an IDE with it's own, but Cmake supported build system?
For havens sake. Why?
If you really want to do this, write a simple make file with the commands inside. Done. No headache. No frustration.
Do you know, that you can create CB-projects from CMake? Build in support from CMake. And if you know a litte bit about CMake, than you can update the CB-projects automatically.