2014-07-10 22:27:32 +08:00
|
|
|
set(the_description "Media I/O")
|
2015-05-20 22:59:42 +08:00
|
|
|
ocv_add_module(videoio opencv_imgproc opencv_imgcodecs WRAP java python)
|
2014-07-10 22:27:32 +08:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# CMake file for videoio. See root CMakeLists.txt
|
|
|
|
# Some parts taken from version of Hartmut Seichter, HIT Lab NZ.
|
|
|
|
# Jose Luis Blanco, 2008
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2015-12-09 10:42:25 +08:00
|
|
|
if(DEFINED WINRT AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE)
|
2014-07-10 22:27:32 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
ocv_include_directories(${ZLIB_INCLUDE_DIRS})
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES ${ZLIB_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(videoio_hdrs
|
2014-08-01 22:11:20 +08:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/precomp.hpp
|
2014-07-10 22:27:32 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
set(videoio_srcs
|
2014-08-01 22:11:20 +08:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_images.cpp
|
2015-03-26 05:39:29 +08:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_mjpeg_encoder.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_mjpeg_decoder.cpp
|
2014-07-10 22:27:32 +08:00
|
|
|
)
|
|
|
|
|
2014-08-08 19:57:54 +08:00
|
|
|
file(GLOB videoio_ext_hdrs
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/*.hpp"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.hpp"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.h")
|
2014-07-10 22:27:32 +08:00
|
|
|
|
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")
|
|
|
|
|
|
|
|
# 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()
|
|
|
|
|
2017-03-23 16:55:43 +08:00
|
|
|
if(HAVE_MFX)
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_common.cpp)
|
|
|
|
list(APPEND videoio_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_common.hpp)
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_reader.cpp)
|
|
|
|
list(APPEND videoio_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_reader.hpp)
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_writer.cpp)
|
|
|
|
list(APPEND videoio_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/cap_mfx_writer.hpp)
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES mfx)
|
|
|
|
endif()
|
|
|
|
|
2014-07-10 22:27:32 +08:00
|
|
|
if(WIN32 AND NOT ARM)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_cmu.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32 AND HAVE_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)
|
2017-08-20 05:51:02 +08:00
|
|
|
if (MINGW64)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTRSAFE_NO_DEPRECATE")
|
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32 AND HAVE_MSMF)
|
2014-09-25 18:05:54 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_msmf.hpp)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_msmf.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32 AND HAVE_VFW)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_vfw.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_XINE)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_xine.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif(HAVE_XINE)
|
|
|
|
|
|
|
|
if(HAVE_DC1394_2)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_dc1394_v2.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif(HAVE_DC1394_2)
|
|
|
|
|
|
|
|
if(HAVE_DC1394)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_dc1394.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif(HAVE_DC1394)
|
|
|
|
|
|
|
|
if(HAVE_GSTREAMER)
|
2015-12-09 22:08:19 +08:00
|
|
|
IF(WIN32)
|
|
|
|
INCLUDE_DIRECTORIES(${GSTREAMER_INCLUDE_DIR})
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES ${GSTREAMER_LIBRARIES})
|
|
|
|
ENDIF(WIN32)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_gstreamer.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif(HAVE_GSTREAMER)
|
|
|
|
|
|
|
|
if(HAVE_UNICAP)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_unicap.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif(HAVE_UNICAP)
|
|
|
|
|
|
|
|
if(HAVE_LIBV4L)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_libv4l.cpp)
|
2015-10-24 07:45:44 +08:00
|
|
|
elseif(HAVE_CAMV4L2 OR HAVE_VIDEOIO)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_v4l.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_OPENNI)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_openni.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
ocv_include_directories(${OPENNI_INCLUDE_DIR})
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES ${OPENNI_LIBRARY})
|
|
|
|
endif(HAVE_OPENNI)
|
|
|
|
|
2014-07-20 20:49:47 +08:00
|
|
|
if(HAVE_OPENNI2)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_openni2.cpp)
|
2014-07-20 20:49:47 +08:00
|
|
|
ocv_include_directories(${OPENNI2_INCLUDE_DIR})
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES ${OPENNI2_LIBRARY})
|
|
|
|
endif(HAVE_OPENNI2)
|
|
|
|
|
2014-07-10 22:27:32 +08:00
|
|
|
if(HAVE_XIMEA)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_ximea.cpp)
|
2014-09-09 23:24:16 +08:00
|
|
|
if(XIMEA_PATH)
|
|
|
|
ocv_include_directories(${XIMEA_PATH})
|
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
if(XIMEA_LIBRARY_DIR)
|
|
|
|
link_directories("${XIMEA_LIBRARY_DIR}")
|
|
|
|
endif()
|
2014-09-09 23:24:16 +08:00
|
|
|
if(WIN32 AND X86_64)
|
2015-11-05 22:56:47 +08:00
|
|
|
list(APPEND VIDEOIO_LIBRARIES xiapi64)
|
2016-01-25 18:05:55 +08:00
|
|
|
elseif(WIN32)
|
2016-01-25 20:13:13 +08:00
|
|
|
list(APPEND VIDEOIO_LIBRARIES xiapi32)
|
2014-09-09 23:25:14 +08:00
|
|
|
elseif(APPLE)
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES "-framework m3api")
|
2014-07-10 22:27:32 +08:00
|
|
|
else()
|
2016-01-25 18:05:55 +08:00
|
|
|
list(APPEND VIDEOIO_LIBRARIES m3api)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
endif(HAVE_XIMEA)
|
|
|
|
|
|
|
|
if(HAVE_FFMPEG)
|
2014-09-25 18:37:38 +08:00
|
|
|
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)
|
2014-07-10 22:27:32 +08:00
|
|
|
if(UNIX AND BZIP2_LIBRARIES)
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES ${BZIP2_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
if(APPLE)
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES "-framework VideoDecodeAcceleration" bz2)
|
|
|
|
endif()
|
|
|
|
endif(HAVE_FFMPEG)
|
|
|
|
|
|
|
|
if(HAVE_PVAPI)
|
|
|
|
add_definitions(-DHAVE_PVAPI)
|
|
|
|
add_definitions(${PVAPI_DEFINITIONS})
|
|
|
|
ocv_include_directories(${PVAPI_INCLUDE_PATH})
|
2014-08-01 22:11:20 +08:00
|
|
|
set(videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_pvapi.cpp ${videoio_srcs})
|
2014-07-10 22:27:32 +08:00
|
|
|
list(APPEND VIDEOIO_LIBRARIES ${PVAPI_LIBRARY})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_GIGE_API)
|
|
|
|
add_definitions(-DHAVE_GIGE_API)
|
|
|
|
ocv_include_directories(${GIGEAPI_INCLUDE_PATH})
|
2014-08-01 22:11:20 +08:00
|
|
|
set(videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_giganetix.cpp ${videoio_srcs})
|
2014-07-10 22:27:32 +08:00
|
|
|
list(APPEND VIDEOIO_LIBRARIES ${GIGEAPI_LIBRARIES})
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_giganetix.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif(HAVE_GIGE_API)
|
|
|
|
|
2016-10-08 03:55:49 +08:00
|
|
|
if(HAVE_ARAVIS_API)
|
|
|
|
add_definitions(-DHAVE_ARAVIS_API)
|
|
|
|
ocv_include_directories(${ARAVIS_INCLUDE_PATH})
|
|
|
|
set(videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_aravis.cpp ${videoio_srcs})
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES ${ARAVIS_LIBRARIES})
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_aravis.cpp)
|
|
|
|
endif(HAVE_ARAVIS_API)
|
|
|
|
|
2014-07-10 22:27:32 +08:00
|
|
|
if(HAVE_AVFOUNDATION)
|
2016-09-09 20:38:00 +08:00
|
|
|
if(IOS)
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_avfoundation.mm)
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES "-framework AVFoundation" "-framework QuartzCore")
|
|
|
|
else()
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_avfoundation_mac.mm)
|
2016-12-23 16:30:17 +08:00
|
|
|
list(APPEND VIDEOIO_LIBRARIES "-framework Cocoa" "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore")
|
2016-09-09 20:38:00 +08:00
|
|
|
endif()
|
2016-05-09 02:50:16 +08:00
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
|
|
|
|
if(HAVE_QUICKTIME)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_qt.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
list(APPEND VIDEOIO_LIBRARIES "-framework Carbon" "-framework QuickTime" "-framework CoreFoundation" "-framework QuartzCore")
|
|
|
|
elseif(HAVE_QTKIT)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_qtkit.mm)
|
2014-07-10 22:27:32 +08:00
|
|
|
list(APPEND VIDEOIO_LIBRARIES "-framework QTKit" "-framework QuartzCore" "-framework AppKit")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_INTELPERC)
|
2014-08-01 22:11:20 +08:00
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_intelperc.cpp)
|
2014-07-10 22:27:32 +08:00
|
|
|
ocv_include_directories(${INTELPERC_INCLUDE_DIR})
|
|
|
|
list(APPEND VIDEOIO_LIBRARIES ${INTELPERC_LIBRARIES})
|
|
|
|
endif(HAVE_INTELPERC)
|
|
|
|
|
2015-05-21 06:41:39 +08:00
|
|
|
if(HAVE_GPHOTO2)
|
|
|
|
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_gphoto2.cpp)
|
|
|
|
endif(HAVE_GPHOTO2)
|
|
|
|
|
2014-07-10 22:27:32 +08:00
|
|
|
if(IOS)
|
2014-08-01 22:11:20 +08:00
|
|
|
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)
|
2017-01-21 00:16:01 +08:00
|
|
|
|
2014-07-10 22:27:32 +08:00
|
|
|
list(APPEND VIDEOIO_LIBRARIES "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreImage" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore" "-framework AssetsLibrary")
|
2017-02-21 17:52:06 +08:00
|
|
|
if(APPLE_FRAMEWORK)
|
2017-01-21 00:16:01 +08:00
|
|
|
list(APPEND VIDEOIO_LIBRARIES "-framework UIKit")
|
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
link_directories("${OpenCV_SOURCE_DIR}/3rdparty/lib") # for ffmpeg wrapper only
|
|
|
|
include_directories(AFTER SYSTEM "${OpenCV_SOURCE_DIR}/3rdparty/include") # for directshow in VS2005 and multi-monitor support on MinGW
|
|
|
|
include_directories(AFTER SYSTEM "${OpenCV_SOURCE_DIR}/3rdparty/include/ffmpeg_") # for tests
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(UNIX)
|
|
|
|
#these variables are set by CHECK_MODULE macro
|
|
|
|
foreach(P ${VIDEOIO_INCLUDE_DIRS})
|
|
|
|
ocv_include_directories(${P})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
foreach(P ${VIDEOIO_LIBRARY_DIRS})
|
|
|
|
link_directories(${P})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
source_group("Src" FILES ${videoio_srcs} ${videoio_hdrs})
|
|
|
|
source_group("Include" FILES ${videoio_ext_hdrs})
|
|
|
|
ocv_set_module_sources(HEADERS ${videoio_ext_hdrs} SOURCES ${videoio_srcs} ${videoio_hdrs})
|
|
|
|
ocv_module_include_directories()
|
|
|
|
|
|
|
|
ocv_create_module(${VIDEOIO_LIBRARIES})
|
|
|
|
|
2014-08-01 22:11:20 +08:00
|
|
|
macro(ocv_videoio_configure_target)
|
2014-07-10 22:27:32 +08:00
|
|
|
if(APPLE)
|
2014-10-17 18:37:25 +08:00
|
|
|
add_apple_compiler_options(the_module)
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /NODEFAULTLIB:libcmt.lib /DEBUG")
|
2017-06-30 08:56:09 +08:00
|
|
|
if(DEFINED WINRT AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE)
|
|
|
|
set_target_properties(${the_module} PROPERTIES VS_DESKTOP_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated-declarations)
|
|
|
|
|
2017-03-15 18:19:59 +08:00
|
|
|
if(WIN32 AND HAVE_FFMPEG)
|
2014-07-10 22:27:32 +08:00
|
|
|
#copy ffmpeg dll to the output folder
|
|
|
|
if(MSVC64 OR MINGW64)
|
|
|
|
set(FFMPEG_SUFFIX _64)
|
|
|
|
endif()
|
|
|
|
|
2017-03-15 18:19:59 +08:00
|
|
|
set(ffmpeg_dir "${OpenCV_BINARY_DIR}/3rdparty/ffmpeg")
|
2014-07-10 22:27:32 +08:00
|
|
|
set(ffmpeg_bare_name "opencv_ffmpeg${FFMPEG_SUFFIX}.dll")
|
|
|
|
set(ffmpeg_bare_name_ver "opencv_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)
|
|
|
|
add_custom_command(TARGET ${the_module} POST_BUILD
|
2015-09-09 03:42:05 +08:00
|
|
|
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
|
|
|
COMMENT "Copying ${ffmpeg_path} to the output directory")
|
|
|
|
elseif(MSVC AND (CMAKE_GENERATOR MATCHES "Visual"))
|
|
|
|
add_custom_command(TARGET ${the_module} POST_BUILD
|
2015-09-09 03:42:05 +08:00
|
|
|
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
|
|
|
COMMENT "Copying ${ffmpeg_path} to the output directory")
|
|
|
|
else()
|
|
|
|
add_custom_command(TARGET ${the_module} POST_BUILD
|
2015-09-09 03:42:05 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${ffmpeg_bare_name_ver}"
|
2014-07-10 22:27:32 +08:00
|
|
|
COMMENT "Copying ${ffmpeg_path} to the output directory")
|
|
|
|
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)
|
2017-03-15 18:19:59 +08:00
|
|
|
install(FILES "${ffmpeg_dir}/opencv_ffmpeg.dll" DESTINATION "bin/" COMPONENT libs RENAME "opencv_ffmpeg${OPENCV_DLLVERSION}.dll")
|
|
|
|
install(FILES "${ffmpeg_dir}/opencv_ffmpeg_64.dll" DESTINATION "bin/" COMPONENT libs RENAME "opencv_ffmpeg${OPENCV_DLLVERSION}_64.dll")
|
2015-12-18 20:06:19 +08:00
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
endif()
|
2014-08-01 22:11:20 +08:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
if(NOT BUILD_opencv_world)
|
|
|
|
ocv_videoio_configure_target()
|
|
|
|
endif()
|
2014-07-10 22:27:32 +08:00
|
|
|
|
|
|
|
ocv_add_accuracy_tests()
|
|
|
|
ocv_add_perf_tests()
|