anchor.diff:  set CMAKE_FOUND=1
   call :execute cmake --version
   echo CMake is detected
  +where cmake
   
   :: Detect available MSVS version
   if NOT DEFINED VisualStudioVersion (
  
positive.code: 
  :: Detect compiler
  cl /? >NUL 2>NUL <NUL
  if %ERRORLEVEL% NEQ 0 (
    PUSHD %CD%
    if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvars64.bat" (
      CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvars64.bat"
      goto check_msvc
    )
    if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" (
      CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
      goto check_msvc
    )
    if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" (
      CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
      goto check_msvc
    )
    if exist "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
      CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
      goto check_msvc
    )
  :check_msvc
    POPD
    cl /? >NUL 2>NUL <NUL
    if %ERRORLEVEL% NEQ 0 (
      set "MSG=Can't detect Microsoft Visial Studio C++ compiler (cl.exe). MSVS 2015/2017 are supported only from standard locations"
      goto die
    )
  )
  
  :: Detect CMake
  cmake --version >NUL 2>NUL
  if %ERRORLEVEL% EQU 0 GOTO :CMAKE_FOUND
  
  
negative.code:   goto die
  )
  if "%VisualStudioVersion%" == "14.0" (
    set "CMAKE_GENERATOR=-G^"Visual Studio 14 Win64^""
    set "BUILD_DIR_SUFFIX=.vc14"
    set "PATH=%PATH%;%SCRIPTDIR%\..\..\build\x64\vc14\bin\"
  ) else (
    if "%VisualStudioVersion%" == "15.0" (
      set "CMAKE_GENERATOR=-G^"Visual Studio 15 Win64^""
      set "BUILD_DIR_SUFFIX=.vc15"
      set "PATH=%PATH%;%SCRIPTDIR%\..\..\build\x64\vc15\bin\"
    ) else (
      if "%VisualStudioVersion%" == "16.0" (
        echo.==========================================
        echo.*  Note: MSVS 2019 requires CMake 3.14+  *
        echo.==========================================
        set "CMAKE_GENERATOR=-G^"Visual Studio 16 2019^" -A x64"
        set "BUILD_DIR_SUFFIX=.vc16"
        set "PATH=%PATH%;%SCRIPTDIR%\..\..\build\x64\vc15\bin\"
      ) else (
        set "MSG=Unsupported MSVS version. VisualStudioVersion=%VisualStudioVersion%"
        goto die
      )
    )
  )
  
  set "BUILD_DIR=%SRC_DIR%\build_%SRC_NAME%%BUILD_DIR_SUFFIX%"
  call :set_title Create build directory
  if NOT exist "%BUILD_DIR%" ( call :execute md "%BUILD_DIR%" )
  PUSHD "%BUILD_DIR%"
  