1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-23 00:18:37 -05:00

Merge pull request #575 from StefanBruens/fix_ffmpeg_detection

Use CMake varialbles instead of depending on FFmpeg binary
This commit is contained in:
f4exb 2020-07-19 09:40:56 +02:00 committed by GitHub
commit 24ca0f0d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,20 +30,16 @@ if(NOT SERVER_MODE)
# libavutil 55.27.100
# libavcodec 57.48.101
# libavformat 57.40.101
# TODO use libavcodec/version.h
find_package(FFmpeg)
find_package(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
if (FFMPEG_FOUND)
if(WIN32)
add_subdirectory(demoddatv)
else()
# You can only get FFmpeg version from the command line
EXECUTE_PROCESS(COMMAND ffmpeg -version COMMAND grep ffmpeg COMMAND cut -d\ -f3 COMMAND tr -d '\n' OUTPUT_VARIABLE FFMPEG_VERSION)
message(STATUS "FFmpeg version ${FFMPEG_VERSION} found")
if(FFMPEG_VERSION VERSION_GREATER "3.1")
if((AVUTIL_VERSION VERSION_GREATER "55.27.99") AND (AVCODEC_VERSION VERSION_GREATER "57.48.101"))
message(STATUS "Include demoddatv")
add_subdirectory(demoddatv)
else()
message(STATUS "FFmpeg too old to compile demoddatv; needs at least ffmpeg 3.1")
message(STATUS "FFmpeg too old to compile demoddatv; needs at least avutil: 55.27.100, avcodec/avformat: 57.48.101")
endif()
endif()
endif()