From de8024ce4ab3ac7b88ac18478444a7d29878224c Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 11 Oct 2018 19:15:52 +0300 Subject: [PATCH] samples: prefer CMake from MSVS MSVS is shipped with CMake compoment. --- samples/_winpack_build_sample.cmd | 41 ++++++++++++++++--------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/samples/_winpack_build_sample.cmd b/samples/_winpack_build_sample.cmd index 97f3c39ce4..84a3b56428 100644 --- a/samples/_winpack_build_sample.cmd +++ b/samples/_winpack_build_sample.cmd @@ -38,26 +38,6 @@ echo =========================================================================== :: Path to FFMPEG binary files set "PATH=!PATH!;!SCRIPTDIR!\..\..\build\bin\" -:: Detect CMake -cmake --version >NUL 2>NUL -if !ERRORLEVEL! EQU 0 ( - set CMAKE_FOUND=1 -) else ( - if exist "C:\Program Files\CMake\bin" ( - set "PATH=!PATH!;C:\Program Files\CMake\bin" - cmake --version >NUL 2>NUL - if !ERRORLEVEL! EQU 0 ( - set CMAKE_FOUND=1 - ) - ) -) -if NOT DEFINED CMAKE_FOUND ( - set "MSG=CMake is required to build OpenCV samples. Download it from here: https://cmake.org/download/ and install into 'C:\Program Files\CMake'" - goto die -) else ( - echo CMake is detected -) - :: Detect compiler cl /? >NUL 2>NUL NUL 2>NUL +if !ERRORLEVEL! EQU 0 ( + set CMAKE_FOUND=1 +) else ( + if exist "C:\Program Files\CMake\bin" ( + set "PATH=!PATH!;C:\Program Files\CMake\bin" + cmake --version >NUL 2>NUL + if !ERRORLEVEL! EQU 0 ( + set CMAKE_FOUND=1 + ) + ) +) +if NOT DEFINED CMAKE_FOUND ( + set "MSG=CMake is required to build OpenCV samples. Download it from here: https://cmake.org/download/ and install into 'C:\Program Files\CMake'" + goto die +) else ( + call :execute cmake --version + echo CMake is detected +) + :: Detect available MSVS version if NOT DEFINED VisualStudioVersion ( set "MSG=Can't determine MSVS version. 'VisualStudioVersion' is not defined"