anchor.diff:    endlocal & set %2=%_dir%
     EXIT /B 0
   
  +:try_call
  +IF EXIST %1 (
  +  CALL %*
  +  EXIT /B
  +) ELSE (
  +  EXIT /B 1
  +)
  +
   :: 'goto die' instead of 'call'
   :die
     TITLE OpenCV sample: ERROR: %MSG%
  
positive.code: set CMAKE_FOUND=1
  call :execute cmake --version
  echo CMake is detected
  
  :: Detect available MSVS version
  if NOT DEFINED VisualStudioVersion (
  
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%"
  