Hi Leo,
Sorry about that. I had assumed you were on OSX as if you have everything setup correctly and didn't realize there's two paths, you'd have this confusing bug.
The way cmake works is it will look for your system's path. You could easily point cmake to where you have ninja installed. You could also use a different generator (the link you helpfully provided tells you how to use a different generator). Or you could ensure that the system path has a ninja executable in it so cmake can find it itself.
I personally would recommend pointing cmake at your specific ninja executable. If you're trying to use a system cmake, then you should ensure that cmake is all setup to work for building with ninja independently of Android Studio. If you can do that then you should be golden.
Also please note, I don't work for Google, am just a community member that has gotten this to work in Windows, OSX and Linux. OSX was the tricky one; windows and linux are able to find the path correctly.