anchor.diff:  set ROOT=%~dp0
   set MARIAN_ROOT=%ROOT%..
   
  +
  +set NEED_VCPKG=
  +if "%BOOST_INCLUDE_PATH%" == "" set NEED_VCPKG=1
  +if "%ZLIB_PATH%" == "" set NEED_VCPKG=1
  +if "%OPENSSL_PATH%" == "" set NEED_VCPKG=1
  +
  +if "%NEED_VCPKG%"=="" goto :checkDeps
  +
   :: If you already have vcpkg (a C++ library manager for Windows), and it is not in your PATH
  -:: set the following variable to the directory that contains the vcpkg.exe
  -set VCPKG_ROOT=
  +:: Please set the VCPKG_ROOT variable to the directory that contains the vcpkg.exe
   
   
   :: Clone or update vcpkg (used to manage the dependencies)
  
positive.code: set VCPKG_INSTALL=%VCPKG_ROOT%\installed\%VCPKG_DEFAULT_TRIPLET%
  set VCPKG=%VCPKG_ROOT%\vcpkg
  
  echo.
  
  
  :: Check dependencies and configure CMake
  :: -------------------------------------------------------
  
  echo --- Checking dependencies...
  
  set CMAKE_OPT=
  
  
  :: Use vcpkg toolchain
  set CMAKE_OPT=%CMAKE_OPT% -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake
  set CMAKE_OPT=%CMAKE_OPT% -DVCPKG_TARGET_TRIPLET=%VCPKG_DEFAULT_TRIPLET%
  
  
  ::
  :: Check prerequisites
  ::
  
  :: -------------------------
  echo ... CUDA
  if not exist "%CUDA_PATH%" (
      echo The CUDA_PATH environment variable is not defined: please make sure CUDA 8.0+ is installed.
      goto :eof
  )
  echo Found Cuda SDK in %CUDA_PATH%
  
  
  :: -------------------------
  echo ... CUDNN
  if not exist "%CUDA_PATH%\lib\x64" (
      echo CuDNN not found in your CUDA installation
      goto :eof
  )
  echo Found CuDNN in "%CUDA_PATH%\lib\x64"
  
  set CMAKE_OPT=%CMAKE_OPT% -D CUDNN_LIBRARY:PATH="%CUDA_PATH%\lib\x64\cudnn.lib"
  set CMAKE_OPT=%CMAKE_OPT% -D CUDNN_INCLUDE:PATH="%CUDA_PATH%\include"
  
  
  :: -------------------------
  echo ... Intel MKL
  set MKLROOT="C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl"
  if not exist %MKLROOT% (
      echo Please modify the script file to set MKLROOT to the installation path of the Intel MKL library.
      goto :eof
  )
  echo Found Intel MKL in %MKLROOT%
  
  set CMAKE_OPT=%CMAKE_OPT% -DMKL_ROOT:PATH=%MKLROOT%
  set CMAKE_OPT=%CMAKE_OPT% -DMKL_INCLUDE_DIRS:PATH=%MKLROOT%\include
  set CMAKE_OPT=%CMAKE_OPT% -DMKL_CORE_LIBRARY:FILEPATH=%MKLROOT%\lib\intel64\mkl_core.lib
  set CMAKE_OPT=%CMAKE_OPT% -DMKL_INTERFACE_LIBRARY:FILEPATH=%MKLROOT%\lib\intel64\mkl_intel_ilp64.lib
  set CMAKE_OPT=%CMAKE_OPT% -DMKL_SEQUENTIAL_LAYER_LIBRARY:FILEPATH=%MKLROOT%\lib\intel64\mkl_sequential.lib
  
  
  :: -------------------------
  echo ... Boost (1.58+)
  %VCPKG% install boost-chrono boost-filesystem boost-iostreams boost-program-options boost-regex boost-system boost-thread boost-timer boost-asio
  
  :: -------------------------
  echo ... zlib
  %VCPKG% install zlib
  
  :: -------------------------
  echo ... OpenSSL
  %VCPKG% install openssl
  set CMAKE_OPT=%CMAKE_OPT% -DOPENSSL_USE_STATIC_LIBS:BOOL=TRUE
  set CMAKE_OPT=%CMAKE_OPT% -DOPENSSL_MSVC_STATIC_RT:BOOL=TRUE
  
  echo.
  
  echo --- Configuring CMake...
  
  set CMAKE_OPT=%CMAKE_OPT% -DBUILD_STATIC:BOOL=TRUE 
  
  :: -----  Target Visual Studio 2017 64bits -----
  set CMAKE_OPT=%CMAKE_OPT% -G"Visual Studio 15 2017 Win64" 
  
negative.code: ::cmake --build .
  
  popd
  
  goto :eof
  
  
  