title: How to use the "Ninja" generator in Hosted VS2017 build pipeline?
body: <p>I was trying to set up an Azure DevOps build pipeline (Hosted VS2017) for a <a href="https://cmake.org/" rel="nofollow noreferrer">CMake</a>-based project. Since Visual Studio 2017 uses the <a href="https://ninja-build.org/" rel="nofollow noreferrer">Ninja</a> generator by default, I assumed that it were available in the Hosted VS2017 pool out of the box. When adding the following command:</p>
  
  <pre><code>CMake -GNinja ..
  </code></pre>
  
  <p>the build fails with this error diagnostic:</p>
  
  <blockquote>
  <pre><code>[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!
  </code></pre>
  </blockquote>
  
  <p>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?</p>
  
  <p>The ultimate question is: How do I set up an Azure DevOps build pipeline for a CMake-based project using the Ninja generator?</p>