I was trying to set up an Azure DevOps build pipeline (Hosted VS2017) for a CMake-based project. Since Visual Studio 2017 uses the Ninja generator by default, I assumed that it were available in the Hosted VS2017 pool out of the box. When adding the following command:
CMake -GNinja ..
the build fails with this error diagnostic:
[command]C:\Program Files\CMake\bin\cmake.exe -GNinja .. CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred!
It seems that CMake cannot discover the Ninja generator. I'm not sure what's wrong, though. Do I need to install an extension (if so, which one)? Am I missing a configuration step?
The ultimate question is: How do I set up an Azure DevOps build pipeline for a CMake-based project using the Ninja generator?