diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cd7157905..43922ee940 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -366,7 +366,13 @@ set(WITH_EIGEN ON CACHE BOOL "Include Eigen2/Eigen3 support") set(WITH_CUDA ON CACHE BOOL "Include NVidia Cuda Runtime support") if(WIN32) - if (MINGW AND ${CMAKE_OPENCV_GCC_INFO_FULL} MATCHES "--with-dwarf2") + set(MINGW_DWARF2 0) + if (MINGW) + if(${CMAKE_OPENCV_GCC_INFO_FULL} MATCHES "--with-dwarf2") + set(MINGW_DWARF2 1) + endif() + endif() + if (MINGW_DWARF2) set(WITH_VIDEOINPUT OFF CACHE BOOL "Enable VideoInput support") else() set(WITH_VIDEOINPUT ON CACHE BOOL "Enable VideoInput support")