2021-10-07 01:25:32 +08:00
|
|
|
set(VIDEOIO_ENABLE_PLUGINS_DEFAULT ON)
|
2023-12-20 20:35:10 +08:00
|
|
|
if(EMSCRIPTEN OR IOS OR XROS OR WINRT)
|
2021-10-07 01:25:32 +08:00
|
|
|
set(VIDEOIO_ENABLE_PLUGINS_DEFAULT OFF)
|
|
|
|
endif()
|
|
|
|
|
2020-04-20 03:21:31 +08:00
|
|
|
set(VIDEOIO_PLUGIN_LIST "" CACHE STRING "List of videoio backends to be compiled as plugins (ffmpeg, gstreamer, mfx, msmf or special value 'all')")
|
2021-10-07 01:25:32 +08:00
|
|
|
set(VIDEOIO_ENABLE_PLUGINS "${VIDEOIO_ENABLE_PLUGINS_DEFAULT}" CACHE BOOL "Allow building and using of videoio plugins")
|
2021-02-04 06:04:35 +08:00
|
|
|
mark_as_advanced(VIDEOIO_PLUGIN_LIST VIDEOIO_ENABLE_PLUGINS)
|
2019-01-14 18:33:38 +08:00
|
|
|
|
2019-03-02 16:31:56 +08:00
|
|
|
string(REPLACE "," ";" VIDEOIO_PLUGIN_LIST "${VIDEOIO_PLUGIN_LIST}") # support comma-separated list (,) too
|
2021-12-22 00:34:48 +08:00
|
|
|
string(TOLOWER "${VIDEOIO_PLUGIN_LIST}" VIDEOIO_PLUGIN_LIST)
|
2021-04-19 10:01:57 +08:00
|
|
|
if(NOT VIDEOIO_ENABLE_PLUGINS)
|
|
|
|
if(VIDEOIO_PLUGIN_LIST)
|
|
|
|
message(WARNING "VideoIO: plugins are disabled through VIDEOIO_ENABLE_PLUGINS, so VIDEOIO_PLUGIN_LIST='${VIDEOIO_PLUGIN_LIST}' is ignored")
|
|
|
|
set(VIDEOIO_PLUGIN_LIST "")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
# Make virtual opencv_videoio_plugins target
|
|
|
|
if(NOT TARGET opencv_videoio_plugins)
|
|
|
|
add_custom_target(opencv_videoio_plugins ALL)
|
|
|
|
endif()
|
2019-03-02 16:31:56 +08:00
|
|
|
endif()
|
|
|
|
|
2020-06-09 02:32:53 +08:00
|
|
|
ocv_add_module(videoio opencv_imgproc opencv_imgcodecs WRAP java objc python)
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
set(videoio_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/precomp.hpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
|
|
|
|
set(videoio_srcs
|
2018-12-26 20:50:20 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/src/videoio_registry.cpp"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/src/videoio_c.cpp"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/src/cap.cpp"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/src/cap_images.cpp"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/src/cap_mjpeg_encoder.cpp"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/src/cap_mjpeg_decoder.cpp"
|
2019-03-03 06:36:18 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/src/backend_plugin.cpp"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/src/backend_static.cpp"
|
2018-12-26 20:50:20 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/src/container_avi.cpp")
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2014-08-08 19:57:54 +08:00
|
|
|
file(GLOB videoio_ext_hdrs
|
2018-12-26 20:50:20 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/*.hpp"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.hpp"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.h"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/legacy/*.h")
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2020-04-21 20:17:45 +08:00
|
|
|
if(OPENCV_DEBUG_POSTFIX)
|
|
|
|
ocv_append_source_file_compile_definitions("${CMAKE_CURRENT_LIST_DIR}/src/backend_plugin.cpp" "DEBUG_POSTFIX=${OPENCV_DEBUG_POSTFIX}")
|
|
|
|
endif()
|
|
|
|
|
2015-05-15 21:29:06 +08:00
|
|
|
# Removing WinRT API headers by default
|
|
|
|
list(REMOVE_ITEM videoio_ext_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/cap_winrt.hpp")
|
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(DEFINED WINRT AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW")
|
|
|
|
endif()
|
|
|
|
|
2015-05-15 21:29:06 +08:00
|
|
|
# Dependencies used by the implementation referenced
|
|
|
|
# below are not available on WinRT 8.0.
|
|
|
|
# Enabling it for WiRT 8.1+ only.
|
2015-12-09 10:42:25 +08:00
|
|
|
if(DEFINED WINRT AND NOT DEFINED WINRT_8_0 AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE)
|
2015-05-15 21:29:06 +08:00
|
|
|
|
|
|
|
# WinRT detected. Adding WinRT API header
|
2015-07-11 00:18:07 +08:00
|
|
|
message(STATUS " ${name}: WinRT detected. Adding WinRT API header")
|
2015-05-15 21:29:06 +08:00
|
|
|
list(APPEND videoio_ext_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/cap_winrt.hpp")
|
|
|
|
|
|
|
|
# Adding WinRT internal sources and headers
|
|
|
|
list(APPEND videoio_srcs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt_capture.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt_bridge.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt_video.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt/CaptureFrameGrabber.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt/MediaStreamSink.cpp)
|
|
|
|
list(APPEND videoio_hdrs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt_capture.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt_bridge.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt_video.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt/MFIncludes.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt/CaptureFrameGrabber.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt/MediaSink.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_winrt/MediaStreamSink.hpp)
|
|
|
|
endif()
|
|
|
|
|
2019-05-17 22:23:47 +08:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/cmake/plugin.cmake)
|
|
|
|
|
2021-05-15 00:48:50 +08:00
|
|
|
set(tgts "PRIVATE")
|
2018-12-26 20:50:20 +08:00
|
|
|
|
|
|
|
if(TARGET ocv.3rdparty.mediasdk)
|
2020-04-20 03:21:31 +08:00
|
|
|
if("mfx" IN_LIST VIDEOIO_PLUGIN_LIST OR VIDEOIO_PLUGIN_LIST STREQUAL "all")
|
2019-05-17 22:23:47 +08:00
|
|
|
ocv_create_builtin_videoio_plugin("opencv_videoio_intel_mfx" ocv.3rdparty.mediasdk "cap_mfx_common.cpp" "cap_mfx_reader.cpp" "cap_mfx_writer.cpp" "cap_mfx_plugin.cpp")
|
|
|
|
else()
|
|
|
|
list(APPEND videoio_srcs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_common.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_reader.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_writer.cpp)
|
|
|
|
list(APPEND videoio_hdrs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_common.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_reader.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_writer.hpp)
|
|
|
|
list(APPEND tgts ocv.3rdparty.mediasdk)
|
|
|
|
endif()
|
2017-03-23 16:55:43 +08:00
|
|
|
endif()
|
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.dshow)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_dshow.cpp)
|
|
|
|
list(APPEND videoio_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/cap_dshow.hpp)
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.dshow)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.msmf)
|
2020-04-20 03:21:31 +08:00
|
|
|
if("msmf" IN_LIST VIDEOIO_PLUGIN_LIST OR VIDEOIO_PLUGIN_LIST STREQUAL "all")
|
2020-04-08 01:25:10 +08:00
|
|
|
ocv_create_builtin_videoio_plugin("opencv_videoio_msmf" ocv.3rdparty.msmf "cap_msmf.cpp")
|
|
|
|
else()
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_msmf.hpp)
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_msmf.cpp)
|
|
|
|
list(APPEND tgts ocv.3rdparty.msmf)
|
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.xine)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_xine.cpp)
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.xine)
|
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.dc1394_2)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_dc1394_v2.cpp)
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.dc1394_2)
|
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.gstreamer)
|
2020-04-20 03:21:31 +08:00
|
|
|
if("gstreamer" IN_LIST VIDEOIO_PLUGIN_LIST OR VIDEOIO_PLUGIN_LIST STREQUAL "all")
|
2019-01-14 18:33:38 +08:00
|
|
|
ocv_create_builtin_videoio_plugin("opencv_videoio_gstreamer" ocv.3rdparty.gstreamer "cap_gstreamer.cpp")
|
|
|
|
else()
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_gstreamer.cpp)
|
|
|
|
list(APPEND tgts ocv.3rdparty.gstreamer)
|
|
|
|
endif()
|
2018-12-26 20:50:20 +08:00
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.v4l)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_v4l.cpp)
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.v4l)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.openni2)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_openni2.cpp)
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.openni2)
|
|
|
|
endif()
|
2014-07-20 20:49:47 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.ximea)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_ximea.cpp)
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.ximea)
|
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2020-10-18 17:48:41 +08:00
|
|
|
if(TARGET ocv.3rdparty.ueye)
|
|
|
|
if("ueye" IN_LIST VIDEOIO_PLUGIN_LIST OR VIDEOIO_PLUGIN_LIST STREQUAL "all")
|
|
|
|
ocv_create_builtin_videoio_plugin("opencv_videoio_ueye" ocv.3rdparty.ueye "cap_ueye.cpp")
|
|
|
|
else()
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_ueye.cpp)
|
|
|
|
list(APPEND tgts ocv.3rdparty.ueye)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.ffmpeg)
|
2019-05-31 21:18:00 +08:00
|
|
|
if(HAVE_FFMPEG_WRAPPER)
|
|
|
|
list(APPEND tgts ocv.3rdparty.ffmpeg)
|
2020-04-20 03:21:31 +08:00
|
|
|
elseif("ffmpeg" IN_LIST VIDEOIO_PLUGIN_LIST OR VIDEOIO_PLUGIN_LIST STREQUAL "all")
|
2019-01-14 18:33:38 +08:00
|
|
|
ocv_create_builtin_videoio_plugin("opencv_videoio_ffmpeg" ocv.3rdparty.ffmpeg "cap_ffmpeg.cpp")
|
2021-05-15 00:48:50 +08:00
|
|
|
if(TARGET ocv.3rdparty.ffmpeg.plugin_deps)
|
|
|
|
ocv_target_link_libraries(opencv_videoio_ffmpeg ocv.3rdparty.ffmpeg.plugin_deps)
|
|
|
|
endif()
|
|
|
|
if(TARGET ocv.3rdparty.mediasdk
|
|
|
|
AND NOT OPENCV_FFMPEG_DISABLE_MEDIASDK
|
|
|
|
)
|
|
|
|
ocv_target_link_libraries(opencv_videoio_ffmpeg ocv.3rdparty.mediasdk)
|
|
|
|
endif()
|
2019-01-14 18:33:38 +08:00
|
|
|
else()
|
|
|
|
list(APPEND videoio_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/cap_ffmpeg_impl.hpp)
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_ffmpeg.cpp)
|
|
|
|
list(APPEND tgts ocv.3rdparty.ffmpeg)
|
2021-05-15 00:48:50 +08:00
|
|
|
if(TARGET ocv.3rdparty.ffmpeg.builtin_deps)
|
|
|
|
list(APPEND tgts ocv.3rdparty.ffmpeg.builtin_deps)
|
|
|
|
endif()
|
|
|
|
if(TARGET ocv.3rdparty.mediasdk
|
|
|
|
AND NOT OPENCV_FFMPEG_DISABLE_MEDIASDK
|
|
|
|
)
|
|
|
|
list(APPEND tgts ocv.3rdparty.mediasdk)
|
|
|
|
endif()
|
2019-01-14 18:33:38 +08:00
|
|
|
endif()
|
2018-12-26 20:50:20 +08:00
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.pvapi)
|
2014-08-01 22:11:20 +08:00
|
|
|
set(videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_pvapi.cpp ${videoio_srcs})
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.pvapi)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.aravis)
|
2016-10-08 03:55:49 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_aravis.cpp)
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.aravis)
|
|
|
|
endif()
|
2016-10-08 03:55:49 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.avfoundation)
|
2023-12-20 20:35:10 +08:00
|
|
|
if(IOS OR XROS)
|
2016-09-09 20:38:00 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_avfoundation.mm)
|
|
|
|
else()
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_avfoundation_mac.mm)
|
|
|
|
endif()
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.avfoundation)
|
2016-05-09 02:50:16 +08:00
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.librealsense)
|
2018-05-16 22:27:25 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_librealsense.cpp)
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.librealsense)
|
|
|
|
endif()
|
2018-05-16 22:27:25 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.gphoto2)
|
2015-05-21 06:41:39 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_gphoto2.cpp)
|
2018-12-26 20:50:20 +08:00
|
|
|
list(APPEND tgts ocv.3rdparty.gphoto2)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
if(TARGET ocv.3rdparty.cap_ios)
|
|
|
|
list(APPEND videoio_srcs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_abstract_camera.mm
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_photo_camera.mm
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_video_camera.mm)
|
|
|
|
list(APPEND tgts ocv.3rdparty.cap_ios)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
2019-03-20 02:28:45 +08:00
|
|
|
if(TARGET ocv.3rdparty.android_mediandk)
|
|
|
|
list(APPEND videoio_srcs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_android_mediandk.cpp)
|
|
|
|
list(APPEND tgts ocv.3rdparty.android_mediandk)
|
|
|
|
endif()
|
|
|
|
|
2021-02-26 03:14:11 +08:00
|
|
|
if(TARGET ocv.3rdparty.android_native_camera)
|
|
|
|
list(APPEND videoio_srcs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_android_camera.cpp)
|
|
|
|
list(APPEND tgts ocv.3rdparty.android_native_camera)
|
|
|
|
endif()
|
|
|
|
|
2022-07-26 19:35:34 +08:00
|
|
|
if(TARGET ocv.3rdparty.obsensor)
|
2024-03-29 16:23:41 +08:00
|
|
|
if(OBSENSOR_USE_ORBBEC_SDK)
|
2022-07-26 19:35:34 +08:00
|
|
|
list(APPEND videoio_srcs
|
2024-03-29 16:23:41 +08:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor_liborbbec.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor_liborbbec.cpp)
|
|
|
|
else()
|
2022-07-26 19:35:34 +08:00
|
|
|
list(APPEND videoio_srcs
|
2024-03-29 16:23:41 +08:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor_capture.cpp)
|
2022-07-26 19:35:34 +08:00
|
|
|
list(APPEND videoio_hdrs
|
2024-03-29 16:23:41 +08:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor_capture.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor/obsensor_stream_channel_interface.hpp)
|
|
|
|
if(HAVE_OBSENSOR_MSMF)
|
|
|
|
list(APPEND videoio_srcs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor/obsensor_uvc_stream_channel.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor/obsensor_stream_channel_msmf.cpp)
|
|
|
|
list(APPEND videoio_hdrs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor/obsensor_uvc_stream_channel.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor/obsensor_stream_channel_msmf.hpp)
|
|
|
|
elseif(HAVE_OBSENSOR_V4L2)
|
|
|
|
list(APPEND videoio_srcs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor/obsensor_uvc_stream_channel.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor/obsensor_stream_channel_v4l2.cpp)
|
|
|
|
list(APPEND videoio_hdrs
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor/obsensor_uvc_stream_channel.hpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_obsensor/obsensor_stream_channel_v4l2.hpp)
|
|
|
|
endif()
|
2022-07-26 19:35:34 +08:00
|
|
|
endif()
|
|
|
|
list(APPEND tgts ocv.3rdparty.obsensor)
|
|
|
|
endif()
|
|
|
|
|
2021-05-15 00:48:50 +08:00
|
|
|
if(tgts STREQUAL "PRIVATE")
|
|
|
|
set(tgts "")
|
|
|
|
endif()
|
|
|
|
|
2023-02-19 00:21:07 +08:00
|
|
|
ocv_install_used_external_targets(${tgts})
|
2021-05-15 00:48:50 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
ocv_set_module_sources(HEADERS ${videoio_ext_hdrs} ${videoio_hdrs} SOURCES ${videoio_srcs})
|
2014-07-10 22:27:32 +08:00
|
|
|
ocv_module_include_directories()
|
2018-12-26 20:50:20 +08:00
|
|
|
ocv_create_module()
|
|
|
|
ocv_add_accuracy_tests(${tgts})
|
|
|
|
ocv_add_perf_tests(${tgts})
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2019-01-14 18:33:38 +08:00
|
|
|
if(VIDEOIO_ENABLE_PLUGINS)
|
|
|
|
ocv_target_compile_definitions(${the_module} PRIVATE ENABLE_PLUGINS)
|
|
|
|
endif()
|
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${tgts})
|
2014-07-10 22:27:32 +08:00
|
|
|
|
2018-12-26 20:50:20 +08:00
|
|
|
# copy FFmpeg dll to the output folder
|
2018-05-31 20:39:59 +08:00
|
|
|
if(WIN32 AND HAVE_FFMPEG_WRAPPER)
|
2019-12-11 06:35:36 +08:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
2014-07-10 22:27:32 +08:00
|
|
|
set(FFMPEG_SUFFIX _64)
|
|
|
|
endif()
|
2017-03-15 18:19:59 +08:00
|
|
|
set(ffmpeg_dir "${OpenCV_BINARY_DIR}/3rdparty/ffmpeg")
|
2019-06-16 22:41:04 +08:00
|
|
|
set(ffmpeg_bare_name "opencv_videoio_ffmpeg${FFMPEG_SUFFIX}.dll")
|
|
|
|
set(ffmpeg_bare_name_ver "opencv_videoio_ffmpeg${OPENCV_DLLVERSION}${FFMPEG_SUFFIX}.dll")
|
2017-03-15 18:19:59 +08:00
|
|
|
set(ffmpeg_path "${ffmpeg_dir}/${ffmpeg_bare_name}")
|
2014-07-10 22:27:32 +08:00
|
|
|
if(MSVC_IDE)
|
2018-12-26 20:50:20 +08:00
|
|
|
execute_process(
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/Release/${ffmpeg_bare_name_ver}"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/Debug/${ffmpeg_bare_name_ver}")
|
2014-07-10 22:27:32 +08:00
|
|
|
elseif(MSVC AND (CMAKE_GENERATOR MATCHES "Visual"))
|
2018-12-26 20:50:20 +08:00
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/${ffmpeg_bare_name_ver}")
|
2014-07-10 22:27:32 +08:00
|
|
|
else()
|
2018-12-26 20:50:20 +08:00
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${ffmpeg_bare_name_ver}")
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
install(FILES "${ffmpeg_path}" DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs RENAME "${ffmpeg_bare_name_ver}")
|
2015-12-18 20:06:19 +08:00
|
|
|
if(INSTALL_CREATE_DISTRIB)
|
2020-03-31 20:19:34 +08:00
|
|
|
install(FILES "${ffmpeg_dir}/opencv_videoio_ffmpeg${FFMPEG_SUFFIX}.dll" DESTINATION "bin/" COMPONENT libs RENAME "opencv_videoio_ffmpeg${OPENCV_DLLVERSION}${FFMPEG_SUFFIX}.dll")
|
2015-12-18 20:06:19 +08:00
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|