From b739919fe473add0deba389de2b15b6b246155e7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 3 Jan 2020 09:30:26 -0700 Subject: [PATCH] CMake: Update FindFFMPEG to locate static ffmpeg dependencies too --- cmake/modules/FindFFMPEG.cmake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake index 649f2b80e2..88a0021be6 100644 --- a/cmake/modules/FindFFMPEG.cmake +++ b/cmake/modules/FindFFMPEG.cmake @@ -85,6 +85,31 @@ if(FFMPEG_LIBAVUTIL) list(APPEND FFMPEG_LIBRARIES "${FFMPEG_LIBAVUTIL}") endif() +if(APPLE) + # When statically built for Apple, FFMPEG may have dependencies on these + # additional frameworks and libraries. + + find_library(APPLE_COREVIDEO_LIBRARY CoreVideo) + if(APPLE_COREVIDEO_LIBRARY) + list(APPEND FFMPEG_LIBRARIES "${APPLE_COREVIDEO_LIBRARY}") + endif() + + find_library(APPLE_VDA_LIBRARY VideoDecodeAcceleration) + if(APPLE_VDA_LIBRARY) + list(APPEND FFMPEG_LIBRARIES "${APPLE_VDA_LIBRARY}") + endif() + + find_library(APPLE_ICONV_LIBRARY iconv) + if(APPLE_ICONV_LIBRARY) + list(APPEND FFMPEG_LIBRARIES "${APPLE_ICONV_LIBRARY}") + endif() + + find_library(APPLE_BZ2_LIBRARY bz2) + if(APPLE_BZ2_LIBRARY) + list(APPEND FFMPEG_LIBRARIES "${APPLE_BZ2_LIBRARY}") + endif() +endif() + mark_as_advanced(FFMPEG_LIBRARY_DIR) include(FindPackageHandleStandardArgs)