From 0eeb55cb2445aa72ff96478b8dc94ec68f2805f2 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Fri, 9 Dec 2022 10:09:23 +0100 Subject: [PATCH 1/2] Fix FindAVDEVICE.cmake in case without pkg-config Signed-off-by: Silvio --- cmake/FindAVDEVICE.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/FindAVDEVICE.cmake b/cmake/FindAVDEVICE.cmake index c681bf2b..495050f8 100644 --- a/cmake/FindAVDEVICE.cmake +++ b/cmake/FindAVDEVICE.cmake @@ -32,6 +32,13 @@ if(NOT AVDEVICE_FOUND) if(AVDEVICE_FOUND) file(READ "${AVDEVICE_INCLUDE_DIRS}/libavdevice/version.h" ver_file) + # ffmpeg 5.1 splitted version information in two files + # https://github.com/FFmpeg/FFmpeg/commit/884c5976592c2d8084e8c9951c94ddf04019d81d + if(EXISTS "${AVDEVICE_INCLUDE_DIRS}/libavdevice/version_major.h") + file(READ "${AVDEVICE_INCLUDE_DIRS}/libavdevice/version_major.h" ver_major_file) + string(CONCAT ver_file ${ver_file} ${ver_major_file}) + endif() + string(REGEX MATCH "LIBAVDEVICE_VERSION_MAJOR[ \t\r\n]+([0-9]*)" _ ${ver_file}) set(ver_major ${CMAKE_MATCH_1}) @@ -52,4 +59,4 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args( AVDEVICE - REQUIRED_VARS AVDEVICE_FOUND) \ No newline at end of file + REQUIRED_VARS AVDEVICE_FOUND) From 290f4e1e21d68cab551def907f0aa3b32cfc8c66 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 22 Dec 2022 19:43:57 +0100 Subject: [PATCH 2/2] Delete empty line at the end