diff --git a/cmake/OpenCVFindLibsVideo.cmake b/cmake/OpenCVFindLibsVideo.cmake index f50b8ee1da..3865199b5c 100644 --- a/cmake/OpenCVFindLibsVideo.cmake +++ b/cmake/OpenCVFindLibsVideo.cmake @@ -127,13 +127,18 @@ endif(WITH_GIGEAPI) # --- Aravis SDK --- ocv_clear_vars(HAVE_ARAVIS_API) if(WITH_ARAVIS) - find_path(ARAVIS_INCLUDE_PATH "arv.h" - PATHS /usr/local /var /opt /usr ENV ProgramFiles ENV ProgramW6432 - PATH_SUFFIXES include "aravis-0.6" "aravis-0.4" - DOC "The path to Aravis SDK headers") - find_library(ARAVIS_LIBRARIES NAMES "aravis-0.6" "aravis-0.4" ) - if(ARAVIS_LIBRARIES AND ARAVIS_INCLUDE_PATH) - set(HAVE_ARAVIS_API TRUE) + check_module(glib-2.0 HAVE_ARAVIS_GLIB VIDEOIO) + if(HAVE_ARAVIS_GLIB) + find_path(ARAVIS_INCLUDE_PATH "arv.h" + PATHS /usr/local /var /opt /usr ENV ProgramFiles ENV ProgramW6432 + PATH_SUFFIXES include "aravis-0.6" "aravis-0.4" + DOC "The path to Aravis SDK headers") + find_library(ARAVIS_LIBRARIES NAMES "aravis-0.6" "aravis-0.4" ) + if(ARAVIS_LIBRARIES AND ARAVIS_INCLUDE_PATH) + set(HAVE_ARAVIS_API TRUE) + endif() + else() + message("Can not build Aravis support without glib2") endif() endif(WITH_ARAVIS)