From 023102c80411eb1b8755ab561327c5c507e378fc Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Wed, 9 Jul 2014 16:55:40 +0400 Subject: [PATCH] cap_libv4l.cpp depends on both libv4l 1 and 2, so search for both How this worked before, I do not know. --- CMakeLists.txt | 5 +++-- cmake/OpenCVFindLibsVideo.cmake | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b610ecf..505b271 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -905,8 +905,9 @@ if(DEFINED WITH_V4L) else() set(HAVE_CAMV4L2_STR "NO") endif() - status(" V4L/V4L2:" HAVE_LIBV4L THEN "Using libv4l (ver ${ALIASOF_libv4l1_VERSION})" - ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}") + status(" V4L/V4L2:" HAVE_LIBV4L + THEN "Using libv4l1 (ver ${ALIASOF_libv4l1_VERSION}) / libv4l2 (ver ${ALIASOF_libv4l2_VERSION})" + ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}") endif(DEFINED WITH_V4L) if(DEFINED WITH_DSHOW) diff --git a/cmake/OpenCVFindLibsVideo.cmake b/cmake/OpenCVFindLibsVideo.cmake index a797f04..90b8c14 100644 --- a/cmake/OpenCVFindLibsVideo.cmake +++ b/cmake/OpenCVFindLibsVideo.cmake @@ -126,7 +126,13 @@ endif(WITH_XINE) ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2 HAVE_VIDEOIO) if(WITH_V4L) if(WITH_LIBV4L) - CHECK_MODULE(libv4l1 HAVE_LIBV4L) + CHECK_MODULE(libv4l1 HAVE_LIBV4L1) + CHECK_MODULE(libv4l2 HAVE_LIBV4L2) + if(HAVE_LIBV4L1 AND HAVE_LIBV4L2) + set(HAVE_LIBV4L YES) + else() + set(HAVE_LIBV4L NO) + endif() endif() CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L) CHECK_INCLUDE_FILE(linux/videodev2.h HAVE_CAMV4L2) -- 2.7.4