mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
cmake: fix handling of VIDEOIO_ENABLE_PLUGINS=OFF
This commit is contained in:
parent
cfb77091ca
commit
0df6159149
@ -1,12 +1,18 @@
|
|||||||
set(VIDEOIO_PLUGIN_LIST "" CACHE STRING "List of videoio backends to be compiled as plugins (ffmpeg, gstreamer, mfx, msmf or special value 'all')")
|
set(VIDEOIO_PLUGIN_LIST "" CACHE STRING "List of videoio backends to be compiled as plugins (ffmpeg, gstreamer, mfx, msmf or special value 'all')")
|
||||||
set(VIDEOIO_ENABLE_PLUGINS "ON" CACHE BOOL "Allow building videoio plugin support")
|
set(VIDEOIO_ENABLE_PLUGINS "ON" CACHE BOOL "Allow building and using of videoio plugins")
|
||||||
mark_as_advanced(VIDEOIO_PLUGIN_LIST VIDEOIO_ENABLE_PLUGINS)
|
mark_as_advanced(VIDEOIO_PLUGIN_LIST VIDEOIO_ENABLE_PLUGINS)
|
||||||
|
|
||||||
string(REPLACE "," ";" VIDEOIO_PLUGIN_LIST "${VIDEOIO_PLUGIN_LIST}") # support comma-separated list (,) too
|
string(REPLACE "," ";" VIDEOIO_PLUGIN_LIST "${VIDEOIO_PLUGIN_LIST}") # support comma-separated list (,) too
|
||||||
|
if(NOT VIDEOIO_ENABLE_PLUGINS)
|
||||||
# Make virtual opencv_videoio_plugins target
|
if(VIDEOIO_PLUGIN_LIST)
|
||||||
if(NOT TARGET opencv_videoio_plugins)
|
message(WARNING "VideoIO: plugins are disabled through VIDEOIO_ENABLE_PLUGINS, so VIDEOIO_PLUGIN_LIST='${VIDEOIO_PLUGIN_LIST}' is ignored")
|
||||||
add_custom_target(opencv_videoio_plugins ALL)
|
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()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ocv_add_module(videoio opencv_imgproc opencv_imgcodecs WRAP java objc python)
|
ocv_add_module(videoio opencv_imgproc opencv_imgcodecs WRAP java objc python)
|
||||||
|
@ -684,6 +684,8 @@ Ptr<IBackendFactory> createPluginBackendFactory(VideoCaptureAPIs id, const char*
|
|||||||
#if OPENCV_HAVE_FILESYSTEM_SUPPORT && defined(ENABLE_PLUGINS)
|
#if OPENCV_HAVE_FILESYSTEM_SUPPORT && defined(ENABLE_PLUGINS)
|
||||||
return makePtr<impl::PluginBackendFactory>(id, baseName); //.staticCast<IBackendFactory>();
|
return makePtr<impl::PluginBackendFactory>(id, baseName); //.staticCast<IBackendFactory>();
|
||||||
#else
|
#else
|
||||||
|
CV_UNUSED(id);
|
||||||
|
CV_UNUSED(baseName);
|
||||||
return Ptr<IBackendFactory>();
|
return Ptr<IBackendFactory>();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ static const struct VideoBackendInfo builtin_backends[] =
|
|||||||
|
|
||||||
#ifdef HAVE_MSMF
|
#ifdef HAVE_MSMF
|
||||||
DECLARE_STATIC_BACKEND(CAP_MSMF, "MSMF", MODE_CAPTURE_ALL | MODE_WRITER, cvCreateCapture_MSMF, cvCreateCapture_MSMF, cvCreateVideoWriter_MSMF),
|
DECLARE_STATIC_BACKEND(CAP_MSMF, "MSMF", MODE_CAPTURE_ALL | MODE_WRITER, cvCreateCapture_MSMF, cvCreateCapture_MSMF, cvCreateVideoWriter_MSMF),
|
||||||
#elif defined(ENABLE_PLUGINS)
|
#elif defined(ENABLE_PLUGINS) && defined(_WIN32)
|
||||||
DECLARE_DYNAMIC_BACKEND(CAP_MSMF, "MSMF", MODE_CAPTURE_ALL | MODE_WRITER),
|
DECLARE_DYNAMIC_BACKEND(CAP_MSMF, "MSMF", MODE_CAPTURE_ALL | MODE_WRITER),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user