To build via Ninja you first need set set the generator: Here is why do before build:
cmake -G Ninja ..