1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Merge pull request #13949 from alalek:videoio_plugins_target

This commit is contained in:
Alexander Alekhin
2019-03-04 19:25:11 +00:00
3 changed files with 25 additions and 0 deletions
+7
View File
@@ -3,6 +3,13 @@ set(VIDEOIO_ENABLE_PLUGINS "ON" CACHE BOOL "Allow building videoio plugin suppor
set(VIDEOIO_ENABLE_STRICT_PLUGIN_CHECK "ON" CACHE BOOL "Make sure OpenCV version is the same in plugin and host code")
mark_as_advanced(VIDEOIO_PLUGIN_LIST VIDEOIO_ENABLE_PLUGINS VIDEOIO_ENABLE_STRICT_PLUGIN_CHECK)
string(REPLACE "," ";" VIDEOIO_PLUGIN_LIST "${VIDEOIO_PLUGIN_LIST}") # support comma-separated list (,) too
# Make virtual opencv_videoio_plugins target
if(NOT TARGET opencv_videoio_plugins)
add_custom_target(opencv_videoio_plugins ALL)
endif()
ocv_add_module(videoio opencv_imgproc opencv_imgcodecs WRAP java python)
set(videoio_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/precomp.hpp)
+6
View File
@@ -3,6 +3,8 @@
function(ocv_create_builtin_videoio_plugin name target videoio_src_file)
ocv_debug_message("ocv_create_builtin_videoio_plugin(${ARGV})")
if(NOT TARGET ${target})
message(FATAL_ERROR "${target} does not exist!")
endif()
@@ -10,6 +12,8 @@ function(ocv_create_builtin_videoio_plugin name target videoio_src_file)
message(FATAL_ERROR "OpenCV_SOURCE_DIR must be set to build the plugin!")
endif()
message(STATUS "Video I/O: add builtin plugin '${name}'")
add_library(${name} MODULE
"${CMAKE_CURRENT_LIST_DIR}/src/${videoio_src_file}"
"${CMAKE_CURRENT_LIST_DIR}/src/plugin_api.cpp")
@@ -28,6 +32,8 @@ function(ocv_create_builtin_videoio_plugin name target videoio_src_file)
)
install(TARGETS ${name} LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT plugins OPTIONAL)
add_dependencies(opencv_videoio_plugins ${name})
endfunction()
#=============================================