cmake: check for ffmpeg >= 4.0.4
Check for the specific `ffmpeg` lib versions in `ffmpeg` `4.0.4` "Wu", Do not pass `-DENABLE_FFMPEG=OFF` to the xenial travis job, as this is detected automatically now. Add a note about the required ffmpeg version to `README.md`. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
0b9c771027
commit
8b3470507d
|
@ -32,8 +32,7 @@ matrix:
|
||||||
script:
|
script:
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
# ffmpeg currently broken on xenial
|
- cmake .. -DENABLE_SDL=ON
|
||||||
- cmake .. -DENABLE_SDL=ON -DENABLE_FFMPEG=OFF
|
|
||||||
- make -j2
|
- make -j2
|
||||||
# xvfb fails on xenial too
|
# xvfb fails on xenial too
|
||||||
# - xvfb-run ./visualboyadvance-m --help
|
# - xvfb-run ./visualboyadvance-m --help
|
||||||
|
|
|
@ -120,13 +120,17 @@ set(FFMPEG_DEFAULT OFF)
|
||||||
|
|
||||||
find_package(PkgConfig)
|
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)
|
if(PKGCONFIG_FOUND)
|
||||||
set(FFMPEG_DEFAULT ON)
|
set(FFMPEG_DEFAULT ON)
|
||||||
|
|
||||||
foreach(ffmpeg_lib libavcodec libavformat libswscale libavutil libswresample)
|
foreach(ffmpeg_lib ${FFMPEG_LIBS_LIST})
|
||||||
pkg_check_modules(FFMPEG_LIB_${ffmpeg_lib} ${ffmpeg_lib} QUIET)
|
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)
|
set(FFMPEG_DEFAULT OFF)
|
||||||
break()
|
break()
|
||||||
endif()
|
endif()
|
||||||
|
@ -290,7 +294,7 @@ set(
|
||||||
if(ENABLE_FFMPEG)
|
if(ENABLE_FFMPEG)
|
||||||
find_package(PkgConfig REQUIRED)
|
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)
|
if(FFMPEG_STATIC)
|
||||||
set(FFMPEG_LIBRARIES ${FFMPEG_STATIC_LIBRARIES})
|
set(FFMPEG_LIBRARIES ${FFMPEG_STATIC_LIBRARIES})
|
||||||
|
|
|
@ -111,7 +111,7 @@ And the following development libraries:
|
||||||
|
|
||||||
- [zlib](https://zlib.net/) (required)
|
- [zlib](https://zlib.net/) (required)
|
||||||
- [mesa](https://mesa3d.org/) (if using X11 or any OpenGL otherwise)
|
- [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)
|
- [gettext](https://www.gnu.org/software/gettext/) and gettext-tools (optional, with ENABLE_NLS)
|
||||||
- [libpng](http://www.libpng.org/pub/png/libpng.html) (required)
|
- [libpng](http://www.libpng.org/pub/png/libpng.html) (required)
|
||||||
- [SDL2](https://www.libsdl.org/) (required)
|
- [SDL2](https://www.libsdl.org/) (required)
|
||||||
|
|
Loading…
Reference in New Issue