From d05071221ecb327ca9bc65ab1f0f7a5fdff3b96e Mon Sep 17 00:00:00 2001 From: scribam Date: Wed, 22 Nov 2017 21:54:38 +0100 Subject: [PATCH] cmake: check if ffmpeg libswscale is present --- rpcs3/cmake_modules/FindFFMPEG.cmake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rpcs3/cmake_modules/FindFFMPEG.cmake b/rpcs3/cmake_modules/FindFFMPEG.cmake index 6be21cd8ab..510f53fa58 100644 --- a/rpcs3/cmake_modules/FindFFMPEG.cmake +++ b/rpcs3/cmake_modules/FindFFMPEG.cmake @@ -1,4 +1,4 @@ -# - Try to find ffmpeg libraries (libavcodec, libavformat and libavutil) +# - Try to find ffmpeg libraries (libavcodec, libavformat, libavutil and libswscale) # Once done this will define # # FFMPEG_FOUND - system has ffmpeg or libav @@ -7,6 +7,7 @@ # FFMPEG_LIBAVCODEC # FFMPEG_LIBAVFORMAT # FFMPEG_LIBAVUTIL +# FFMPEG_LIBSWSCALE # # Copyright (c) 2008 Andreas Schneider # Modified for other libraries by Lasse Kärkkäinen @@ -27,6 +28,7 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR) pkg_check_modules(_FFMPEG_AVCODEC libavcodec) pkg_check_modules(_FFMPEG_AVFORMAT libavformat) pkg_check_modules(_FFMPEG_AVUTIL libavutil) + pkg_check_modules(_FFMPEG_SWSCALE libswscale) endif (PKG_CONFIG_FOUND) find_path(FFMPEG_AVCODEC_INCLUDE_DIR @@ -50,7 +52,12 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR) PATHS ${_FFMPEG_AVUTIL_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib ) - if (FFMPEG_LIBAVCODEC AND FFMPEG_LIBAVFORMAT) + find_library(FFMPEG_LIBSWSCALE + NAMES swscale + PATHS ${_FFMPEG_SWSCALE_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib + ) + + if (FFMPEG_LIBAVCODEC AND FFMPEG_LIBAVFORMAT AND FFMPEG_LIBSWSCALE) set(FFMPEG_FOUND TRUE) endif() @@ -61,6 +68,7 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR) ${FFMPEG_LIBAVCODEC} ${FFMPEG_LIBAVFORMAT} ${FFMPEG_LIBAVUTIL} + ${FFMPEG_LIBSWSCALE} ) endif (FFMPEG_FOUND) @@ -71,7 +79,7 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR) endif (NOT FFMPEG_FIND_QUIETLY) else (FFMPEG_FOUND) if (FFMPEG_FIND_REQUIRED) - message(FATAL_ERROR "Could not find libavcodec or libavformat or libavutil") + message(FATAL_ERROR "Could not find libavcodec or libavformat or libavutil or libswscale") endif (FFMPEG_FIND_REQUIRED) endif (FFMPEG_FOUND)