diff --git a/.travis.yml b/.travis.yml index 84b00b9b..11808a3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,7 @@ matrix: script: - mkdir build - cd build -# ffmpeg currently broken on xenial - - cmake .. -DENABLE_SDL=ON -DENABLE_FFMPEG=OFF + - cmake .. -DENABLE_SDL=ON - make -j2 # xvfb fails on xenial too # - xvfb-run ./visualboyadvance-m --help diff --git a/CMakeLists.txt b/CMakeLists.txt index 259a79b9..faa24978 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,13 +120,17 @@ set(FFMPEG_DEFAULT OFF) find_package(PkgConfig) +set(FFMPEG_LIBS_LIST libavcodec>=58.18.100 libavformat>=58.12.100 libswscale>=5.1.100 libavutil>=56.14.100 libswresample>=3.1.100) + if(PKGCONFIG_FOUND) set(FFMPEG_DEFAULT ON) - foreach(ffmpeg_lib libavcodec libavformat libswscale libavutil libswresample) - pkg_check_modules(FFMPEG_LIB_${ffmpeg_lib} ${ffmpeg_lib} QUIET) + foreach(ffmpeg_lib ${FFMPEG_LIBS_LIST}) + string(REGEX REPLACE ">=.*" "" ffmpeg_lib_name ${ffmpeg_lib}) - if(NOT FFMPEG_LIB_${ffmpeg_lib}_FOUND) + pkg_check_modules(FFMPEG_LIB_${ffmpeg_lib_name} ${ffmpeg_lib} QUIET) + + if(NOT FFMPEG_LIB_${ffmpeg_lib_name}_FOUND) set(FFMPEG_DEFAULT OFF) break() endif() @@ -290,7 +294,7 @@ set( if(ENABLE_FFMPEG) find_package(PkgConfig REQUIRED) - pkg_check_modules(FFMPEG REQUIRED libavcodec libavformat libswscale libavutil libswresample) + pkg_check_modules(FFMPEG REQUIRED ${FFMPEG_LIBS_LIST}) if(FFMPEG_STATIC) set(FFMPEG_LIBRARIES ${FFMPEG_STATIC_LIBRARIES}) diff --git a/README.md b/README.md index ec3e69c4..1cfadd6b 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ And the following development libraries: - [zlib](https://zlib.net/) (required) - [mesa](https://mesa3d.org/) (if using X11 or any OpenGL otherwise) -- [ffmpeg](https://ffmpeg.org/) (optional, for game recording) +- [ffmpeg](https://ffmpeg.org/) (optional, at least version `4.0.4`, for game recording) - [gettext](https://www.gnu.org/software/gettext/) and gettext-tools (optional, with ENABLE_NLS) - [libpng](http://www.libpng.org/pub/png/libpng.html) (required) - [SDL2](https://www.libsdl.org/) (required)