CMake: libav/ffmpeg cleanups

Use @Orphis's FindFFmpeg module from ppsspp:
2149d3db7f

From that commit:

> This new module should be able to handle both libraries in the regular
> paths and fallback to pkg-config.
> It is also able to find dynamic libraries, not just static libraries.
> It will generate imported targets with the name FFmpeg::<lib> that you
> can use in your scripts.
This commit is contained in:
Michael Maltese
2017-05-22 12:13:19 -07:00
parent d592bdd4d4
commit d951d2e4c4
4 changed files with 182 additions and 82 deletions

View File

@ -62,12 +62,14 @@ else()
set(SRCS ${SRCS} TextureDecoder_Generic.cpp)
endif()
if(LIBAV_FOUND OR WIN32)
set(SRCS ${SRCS} AVIDump.cpp)
endif()
add_dolphin_library(videocommon "${SRCS}" "${LIBS}")
if(LIBAV_FOUND)
target_link_libraries(videocommon PRIVATE ${LIBS} ${LIBAV_LIBRARIES})
if(FFmpeg_FOUND)
target_sources(videocommon PRIVATE AVIDump.cpp)
target_link_libraries(videocommon PRIVATE
FFmpeg::avcodec
FFmpeg::avformat
FFmpeg::avutil
FFmpeg::swscale
)
endif()