mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
Removed extra dependencies from videoio library
This commit is contained in:
parent
a84a5e8f1a
commit
6320ede98e
@ -42,24 +42,24 @@ endif()
|
||||
ocv_clear_vars(HAVE_GTK HAVE_GTK3 HAVE_GTHREAD HAVE_GTKGLEXT)
|
||||
if(WITH_GTK AND NOT HAVE_QT)
|
||||
if(NOT WITH_GTK_2_X)
|
||||
CHECK_MODULE(gtk+-3.0 HAVE_GTK3)
|
||||
CHECK_MODULE(gtk+-3.0 HAVE_GTK3 HIGHGUI)
|
||||
if(HAVE_GTK3)
|
||||
set(HAVE_GTK TRUE)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT HAVE_GTK)
|
||||
CHECK_MODULE(gtk+-2.0 HAVE_GTK)
|
||||
CHECK_MODULE(gtk+-2.0 HAVE_GTK HIGHGUI)
|
||||
if(HAVE_GTK AND (ALIASOF_gtk+-2.0_VERSION VERSION_LESS MIN_VER_GTK))
|
||||
message (FATAL_ERROR "GTK support requires a minimum version of ${MIN_VER_GTK} (${ALIASOF_gtk+-2.0_VERSION} found)")
|
||||
set(HAVE_GTK FALSE)
|
||||
endif()
|
||||
endif()
|
||||
CHECK_MODULE(gthread-2.0 HAVE_GTHREAD)
|
||||
CHECK_MODULE(gthread-2.0 HAVE_GTHREAD HIGHGUI)
|
||||
if(HAVE_GTK AND NOT HAVE_GTHREAD)
|
||||
message(FATAL_ERROR "gthread not found. This library is required when building with GTK support")
|
||||
endif()
|
||||
if(WITH_OPENGL AND NOT HAVE_GTK3)
|
||||
CHECK_MODULE(gtkglext-1.0 HAVE_GTKGLEXT)
|
||||
CHECK_MODULE(gtkglext-1.0 HAVE_GTKGLEXT HIGHGUI)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -27,11 +27,11 @@ if(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10)
|
||||
ENDIF(GSTREAMER_gstbase_LIBRARY AND GSTREAMER_gstvideo_LIBRARY AND GSTREAMER_gstapp_LIBRARY AND GSTREAMER_gstpbutils_LIBRARY AND GSTREAMER_gstriff_LIBRARY)
|
||||
|
||||
else(WIN32)
|
||||
CHECK_MODULE(gstreamer-base-1.0 HAVE_GSTREAMER_BASE)
|
||||
CHECK_MODULE(gstreamer-video-1.0 HAVE_GSTREAMER_VIDEO)
|
||||
CHECK_MODULE(gstreamer-app-1.0 HAVE_GSTREAMER_APP)
|
||||
CHECK_MODULE(gstreamer-riff-1.0 HAVE_GSTREAMER_RIFF)
|
||||
CHECK_MODULE(gstreamer-pbutils-1.0 HAVE_GSTREAMER_PBUTILS)
|
||||
CHECK_MODULE(gstreamer-base-1.0 HAVE_GSTREAMER_BASE VIDEOIO)
|
||||
CHECK_MODULE(gstreamer-video-1.0 HAVE_GSTREAMER_VIDEO VIDEOIO)
|
||||
CHECK_MODULE(gstreamer-app-1.0 HAVE_GSTREAMER_APP VIDEOIO)
|
||||
CHECK_MODULE(gstreamer-riff-1.0 HAVE_GSTREAMER_RIFF VIDEOIO)
|
||||
CHECK_MODULE(gstreamer-pbutils-1.0 HAVE_GSTREAMER_PBUTILS VIDEOIO)
|
||||
|
||||
if(HAVE_GSTREAMER_BASE AND HAVE_GSTREAMER_VIDEO AND HAVE_GSTREAMER_APP AND HAVE_GSTREAMER_RIFF AND HAVE_GSTREAMER_PBUTILS)
|
||||
set(HAVE_GSTREAMER TRUE)
|
||||
@ -46,11 +46,11 @@ endif(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10)
|
||||
|
||||
# if gstreamer 1.x was not found, or we specified we wanted 0.10, try to find it
|
||||
if(WITH_GSTREAMER AND NOT HAVE_GSTREAMER OR WITH_GSTREAMER_0_10)
|
||||
CHECK_MODULE(gstreamer-base-0.10 HAVE_GSTREAMER_BASE)
|
||||
CHECK_MODULE(gstreamer-video-0.10 HAVE_GSTREAMER_VIDEO)
|
||||
CHECK_MODULE(gstreamer-app-0.10 HAVE_GSTREAMER_APP)
|
||||
CHECK_MODULE(gstreamer-riff-0.10 HAVE_GSTREAMER_RIFF)
|
||||
CHECK_MODULE(gstreamer-pbutils-0.10 HAVE_GSTREAMER_PBUTILS)
|
||||
CHECK_MODULE(gstreamer-base-0.10 HAVE_GSTREAMER_BASE VIDEOIO)
|
||||
CHECK_MODULE(gstreamer-video-0.10 HAVE_GSTREAMER_VIDEO VIDEOIO)
|
||||
CHECK_MODULE(gstreamer-app-0.10 HAVE_GSTREAMER_APP VIDEOIO)
|
||||
CHECK_MODULE(gstreamer-riff-0.10 HAVE_GSTREAMER_RIFF VIDEOIO)
|
||||
CHECK_MODULE(gstreamer-pbutils-0.10 HAVE_GSTREAMER_PBUTILS VIDEOIO)
|
||||
|
||||
if(HAVE_GSTREAMER_BASE AND HAVE_GSTREAMER_VIDEO AND HAVE_GSTREAMER_APP AND HAVE_GSTREAMER_RIFF AND HAVE_GSTREAMER_PBUTILS)
|
||||
set(HAVE_GSTREAMER TRUE)
|
||||
@ -65,8 +65,8 @@ endif(WITH_GSTREAMER AND NOT HAVE_GSTREAMER OR WITH_GSTREAMER_0_10)
|
||||
# --- unicap ---
|
||||
ocv_clear_vars(HAVE_UNICAP)
|
||||
if(WITH_UNICAP)
|
||||
CHECK_MODULE(libunicap HAVE_UNICAP_)
|
||||
CHECK_MODULE(libucil HAVE_UNICAP_UCIL)
|
||||
CHECK_MODULE(libunicap HAVE_UNICAP_ VIDEOIO)
|
||||
CHECK_MODULE(libucil HAVE_UNICAP_UCIL VIDEOIO)
|
||||
if(HAVE_UNICAP_ AND HAVE_UNICAP_UCIL)
|
||||
set(HAVE_UNICAP TRUE)
|
||||
endif()
|
||||
@ -162,9 +162,9 @@ if(WITH_1394)
|
||||
"${CMU1394_LIB_DIR}/lib1394camera.a")
|
||||
endif(HAVE_DC1394_2)
|
||||
else(WIN32 AND MINGW)
|
||||
CHECK_MODULE(libdc1394-2 HAVE_DC1394_2)
|
||||
CHECK_MODULE(libdc1394-2 HAVE_DC1394_2 VIDEOIO)
|
||||
if(NOT HAVE_DC1394_2)
|
||||
CHECK_MODULE(libdc1394 HAVE_DC1394)
|
||||
CHECK_MODULE(libdc1394 HAVE_DC1394 VIDEOIO)
|
||||
endif()
|
||||
endif(WIN32 AND MINGW)
|
||||
endif(WITH_1394)
|
||||
@ -172,15 +172,15 @@ endif(WITH_1394)
|
||||
# --- xine ---
|
||||
ocv_clear_vars(HAVE_XINE)
|
||||
if(WITH_XINE)
|
||||
CHECK_MODULE(libxine HAVE_XINE)
|
||||
CHECK_MODULE(libxine HAVE_XINE VIDEOIO)
|
||||
endif(WITH_XINE)
|
||||
|
||||
# --- V4L ---
|
||||
ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2 HAVE_VIDEOIO)
|
||||
if(WITH_V4L)
|
||||
if(WITH_LIBV4L)
|
||||
CHECK_MODULE(libv4l1 HAVE_LIBV4L1)
|
||||
CHECK_MODULE(libv4l2 HAVE_LIBV4L2)
|
||||
CHECK_MODULE(libv4l1 HAVE_LIBV4L1 VIDEOIO)
|
||||
CHECK_MODULE(libv4l2 HAVE_LIBV4L2 VIDEOIO)
|
||||
if(HAVE_LIBV4L1 AND HAVE_LIBV4L2)
|
||||
set(HAVE_LIBV4L YES)
|
||||
else()
|
||||
@ -301,7 +301,7 @@ endif()
|
||||
# --- gPhoto2 ---
|
||||
ocv_clear_vars(HAVE_GPHOTO2)
|
||||
if(WITH_GPHOTO2)
|
||||
CHECK_MODULE(libgphoto2 HAVE_GPHOTO2)
|
||||
CHECK_MODULE(libgphoto2 HAVE_GPHOTO2 VIDEOIO)
|
||||
endif(WITH_GPHOTO2)
|
||||
|
||||
# --- VA & VA_INTEL ---
|
||||
|
@ -499,7 +499,7 @@ endmacro()
|
||||
# Macros that checks if module have been installed.
|
||||
# After it adds module to build and define
|
||||
# constants passed as second arg
|
||||
macro(CHECK_MODULE module_name define)
|
||||
macro(CHECK_MODULE module_name define cv_module)
|
||||
set(${define} 0)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
set(ALIAS ALIASOF_${module_name})
|
||||
@ -509,25 +509,9 @@ macro(CHECK_MODULE module_name define)
|
||||
set(ALIAS_LIBRARIES ${ALIAS}_LIBRARIES)
|
||||
|
||||
PKG_CHECK_MODULES(${ALIAS} ${module_name})
|
||||
|
||||
if(${ALIAS_FOUND})
|
||||
set(${define} 1)
|
||||
foreach(P "${ALIAS_INCLUDE_DIRS}")
|
||||
if(${P})
|
||||
list(APPEND VIDEOIO_INCLUDE_DIRS ${${P}})
|
||||
list(APPEND HIGHGUI_INCLUDE_DIRS ${${P}})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(P "${ALIAS_LIBRARY_DIRS}")
|
||||
if(${P})
|
||||
list(APPEND VIDEOIO_LIBRARY_DIRS ${${P}})
|
||||
list(APPEND HIGHGUI_LIBRARY_DIRS ${${P}})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list(APPEND VIDEOIO_LIBRARIES ${${ALIAS_LIBRARIES}})
|
||||
list(APPEND HIGHGUI_LIBRARIES ${${ALIAS_LIBRARIES}})
|
||||
ocv_append_build_options(${cv_module} ${ALIAS})
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
Loading…
Reference in New Issue
Block a user