title: VCPKG_ROOT not defined for CMake
body: <p>I am trying to set up vcpkg with a CMake project. Since I intend to have multiple people with different platforms working on this project, I wanted to use an Environment Variable to set CMAKE_TOOLCHAIN_FILE instead of a command line argument as recommended here for cmake: <a href="https://vcpkg.readthedocs.io/en/latest/users/integration/" rel="nofollow noreferrer">https://vcpkg.readthedocs.io/en/latest/users/integration/</a></p>
  <p>However, It appears that CMake is unable to find the VCPKG_ROOT environment variable. I made a small example separate from my project to see if the problem still exists and it does. Here is my CMakeLists.txt file:</p>
  <pre><code>cmake_minimum_required (VERSION 3.8)
  
  #vcpkg init
  if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
  
     MESSAGE(&quot;vcpkg root found&quot;)
  
    set(CMAKE_TOOLCHAIN_FILE &quot;$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake&quot;
        CACHE STRING &quot;&quot;)
  else() 
    MESSAGE(&quot;vcpkg not found&quot;)
  endif()
  
  project (&quot;CmakeVcpkgTestF&quot;)
  
  add_executable (CmakeVcpkgTestF &quot;CmakeVcpkgTestF.cpp&quot; &quot;CmakeVcpkgTestF.h&quot;)
  </code></pre>
  <p>And here is the associated output when buliding, note that &quot;vcpkg not found is output&quot; instead of &quot;vcpkg root found&quot;</p>
  <pre><code>1&gt; CMake generation started for default configuration: 'x64-Debug (default)'.
  1&gt; Command line: &quot;cmd.exe&quot; /c &quot;%SYSTEMROOT%\System32\chcp.com 65001 &gt;NUL &amp;&amp; &quot;C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe&quot;  -G &quot;Ninja&quot;  -DCMAKE_BUILD_TYPE:STRING=&quot;Debug&quot; -DCMAKE_INSTALL_PREFIX:PATH=&quot;F:\VisualStudio2019\CmakeVcpkgTestF\out\install\x64-Debug (default)&quot; -DCMAKE_C_COMPILER:FILEPATH=&quot;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe&quot; -DCMAKE_CXX_COMPILER:FILEPATH=&quot;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe&quot;  -DCMAKE_MAKE_PROGRAM=&quot;C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe&quot; &quot;F:\VisualStudio2019\CmakeVcpkgTestF&quot; 2&gt;&amp;1&quot;
  1&gt; Working directory: F:\VisualStudio2019\CmakeVcpkgTestF\out\build\x64-Debug (default)
  1&gt; [CMake] vcpkg not found
  1&gt; [CMake] -- Configuring done
  1&gt; [CMake] -- Generating done
  1&gt; [CMake] -- Build files have been written to: F:/VisualStudio2019/CmakeVcpkgTestF/out/build/x64-Debug (default)
  1&gt; Extracted CMake variables.
  1&gt; Extracted source files and headers.
  1&gt; Extracted code model.
  1&gt; Extracted includes paths.
  1&gt; CMake generation finished.
  </code></pre>
  <p>So far all I have done install vcpkg (running the required bootstrap as well), is there something else I need to do to get this to work? Also it is worth noting that vcpkg is installed at the root of my drive(specifically F:/vcpkg/vcpkg), not at root of the code, but I don't imagine that is causing the problem.</p>
  <p>Thanks in advance for any assistance.</p>