Skip to content

Fix version checks in FindFFmpeg.cmake

Stefan Brüns requested to merge bruns/kfilemetadata:ffmpeg_cleanup into master

The pkconfig version were quite pointless, as the result was only used as HINTS for the following find_path/find_library calls, e.g. avcodec_LIBRARIES was typically also set after a failed version check.

The failure for the version check was also somewhat fortunate, as otherwise the libavutil lookup would have always failed, libavutil is currently (FFmpeg 4.x) at 56.x, while the (cached) check for libavcodec looks for 57.48.

Move the version checks out of the cached call for all libraries, and do the version checks manually for each component.

Check for the same _FOUND list as used in the target_link_libraries, as FFMPEG_FOUND is set when at least one component has been found.

Merge request reports