title: Environment variable used by CMake to detect Visual C++ compiler tools for Ninja
body: <p>I have Mingw64 GCC 6.3.0 (always in <code>PATH</code>) and Visual C++ compiler tools from Visual Studio 2017 RTM (not in <code>PATH</code>).</p>
  
  <p>If I run <code>cmake . -G "MinGW Makefiles"</code>, GCC 6.3.0 will be selected.</p>
  
  <p>If I run <code>cmake . -G "Ninja"</code>, GCC 6.3.0 will be selected.</p>
  
  <p>My Visual C++ compiler tools is none standard, I only keep the parts I need and delete the rest (like MSBuild, IDE etc.). I use my own batch script to set up <code>PATH</code>, <code>INCLUDE</code> and <code>LIB</code> (works just fine).</p>
  
  <p>If I run this batch script and run <code>cmake .</code>, MSVC will be selected and build with NMake.</p>
  
  <p>With the same environment, <code>cmake . -G "Ninja"</code>, GCC 6.3.0 is selected instead of MSVC.</p>
  
  <p>So my question is, how to tell CMake I want to use MSVC + Ninja rather than GCC + Ninja when both are in <code>PATH</code>? Any environment variable I should set?</p>