Enhance FindFFmpeg.cmake with fallback version parsing, FFmpeg_VERSION, etc. #694
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My recent PR #693 depends on the availability of the
avformat_VERSION
value in CMake, just as a previous PR added a dependency on theavcodec_VERSION
for determining hardware-acceleration support. Previously, FFmpeg component versions were only available if PkgConfig had been used to retrieve the FFmpeg configuration.This PR enhances the Find module so that, if PkgConfig is not available/used, the component versions are parsed out of the relevant
version.h
file in each component's include directory.Along the way, it also makes several other enhancements to the Find module:
find_package()
line specifiesCOMPONENTS
orOPTIONAL_COMPONENTS
only those libraries will be available.FFmpeg_<component>_<var>
, instead of the previous<component>_<var>
.find_package_handle_standard_args()
is now called withHANDLE_COMPONENTS
to verify the component list againstFFmpeg_FIND_COMPONENTS
FFmpeg_VERSION
value is now parsed fromlibavutil/ffversion.h
and published as the module'sVERSION_VAR