Skip to content
This repository was archived by the owner on Mar 22, 2020. It is now read-only.

Commit 002e025

Browse files
committed
Fix FFmpeg support
1 parent 6330fa5 commit 002e025

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cmake/OpenCVFindLibsVideo.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ if(WITH_FFMPEG) # try FFmpeg autodetection
203203
find_package(ffmpeg CONFIG REQUIRED)
204204

205205
set(FFMPEG_FOUND TRUE)
206+
set(HAVE_FFMPEG TRUE)
206207
foreach(lib avcodec avformat avutil swresample swscale)
207208
get_target_property(
208209
${lib}_INCLUDE_DIR
@@ -211,6 +212,7 @@ if(WITH_FFMPEG) # try FFmpeg autodetection
211212
)
212213
list(APPEND FFMPEG_INCLUDE_DIRS "${${lib}_INCLUDE_DIR}")
213214
list(APPEND FFMPEG_LIBRARIES "ffmpeg::${lib}")
215+
set(FFMPEG_lib${lib}_FOUND TRUE)
214216
endforeach()
215217
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
216218
endif()
@@ -239,8 +241,7 @@ if(HAVE_FFMPEG
239241
"${OpenCV_BINARY_DIR}"
240242
"${OpenCV_SOURCE_DIR}/cmake/checks/ffmpeg_test.cpp"
241243
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${FFMPEG_INCLUDE_DIRS}"
242-
"-DLINK_DIRECTORIES:STRING=${FFMPEG_LIBRARY_DIRS}"
243-
"-DLINK_LIBRARIES:STRING=${FFMPEG_LIBRARIES}"
244+
LINK_LIBRARIES ${FFMPEG_LIBRARIES}
244245
OUTPUT_VARIABLE TRY_OUT
245246
)
246247
if(NOT __VALID_FFMPEG)

cmake/templates/OpenCVConfig.cmake.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,10 @@ if("@WEBP_FOUND@")
340340
find_dependency(WebP CONFIG)
341341
endif()
342342

343+
if("@WITH_FFMPEG@")
344+
find_dependency(ffmpeg CONFIG)
345+
endif()
346+
343347
# AWP: Qt5 dependencies -- start
344348
if("@Qt5Core_FOUND@")
345349
find_dependency(Qt5Core)

0 commit comments

Comments
 (0)