Use CMake varialbles instead of depending on FFmpeg binary

DATV will be excluded when the ffmpeg binary is not installed,
although the actual dependencies are fulfilled.
pull/575/head
StefanBruens 2020-07-19 03:55:27 +02:00 zatwierdzone przez GitHub
rodzic e60e4da02c
commit ba28373258
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 7 usunięć

Wyświetl plik

@ -30,20 +30,16 @@ if(NOT SERVER_MODE)
# libavutil 55.27.100 # libavutil 55.27.100
# libavcodec 57.48.101 # libavcodec 57.48.101
# libavformat 57.40.101 # libavformat 57.40.101
# TODO use libavcodec/version.h find_package(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
find_package(FFmpeg)
if (FFMPEG_FOUND) if (FFMPEG_FOUND)
if(WIN32) if(WIN32)
add_subdirectory(demoddatv) add_subdirectory(demoddatv)
else() else()
# You can only get FFmpeg version from the command line if((AVUTIL_VERSION VERSION_GREATER "55.27.99") AND (AVCODEC_VERSION VERSION_GREATER "57.48.101"))
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")
message(STATUS "Include demoddatv") message(STATUS "Include demoddatv")
add_subdirectory(demoddatv) add_subdirectory(demoddatv)
else() 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() endif()
endif() endif()