| Summary: | autotests CMakeLists tries to build ffmpegextractortest even when only some FFmpeg components are found | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-kfilemetadata | Reporter: | Justin Zobel <justin.zobel> |
| Component: | general | Assignee: | Pinak Ahuja <pinak.ahuja> |
| Status: | CONFIRMED --- | ||
| Severity: | minor | CC: | nate, stefan.bruens |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
From my CMake log:
Found FFmpeg: /usr/lib64/libavcodec.so (Required is at least version "57.48") found components:
AVCODEC
Found FFmpeg: /usr/lib64/libavformat.so (Required is at least version "57.40") found components:
AVFORMAT
Found FFmpeg: /usr/lib64/libavutil.so (Required is at least version "55.27") found components:
AVUTIL
Found xattr
And the CMakeLists.txt file has this in it:
find_package(FFmpeg 57.48 COMPONENTS AVCODEC)
find_package(FFmpeg 57.40 COMPONENTS AVFORMAT)
find_package(FFmpeg 55.27 COMPONENTS AVUTIL)
set_package_properties(FFmpeg PROPERTIES DESCRIPTION "Video Tag reader"
URL "https://ffmpeg.org/" TYPE OPTIONAL
PURPOSE "Support for video metadata")
Looks like the intention is to have it marked as an optional dependency. That fact that it fails to build when missing might be the actual bug.
The complete error message is:
---
[ 66%] Building CXX object autotests/CMakeFiles/ffmpegextractortest.dir/__/src/extractors/ffmpegextractor.cpp.o
cc1plus: warning: /home/stefan/Sources/kfilemetadata/autotests/AVCODEC_INCLUDE_DIRS-NOTFOUND: No such file or directory [-Wmissing-include-dirs]
cc1plus: warning: /home/stefan/Sources/kfilemetadata/autotests/AVFORMAT_INCLUDE_DIRS-NOTFOUND: No such file or directory [-Wmissing-include-dirs]
/home/stefan/Sources/kfilemetadata/src/extractors/ffmpegextractor.cpp:26:10: fatal error: libavformat/avformat.h: No such file or directory
26 | #include <libavformat/avformat.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [autotests/CMakeFiles/ffmpegextractortest.dir/build.make:104: autotests/CMakeFiles/ffmpegextractortest.dir/__/src/extractors/ffmpegextractor.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1383: autotests/CMakeFiles/ffmpegextractortest.dir/all] Error 2
---
So the compilation of the tests failed, which would have been helpful information.
Also, already CMake complains:
---
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
/home/stefan/Sources/kfilemetadata/autotests/AVCODEC_INCLUDE_DIRS
used as include directory in directory /home/stefan/Sources/kfilemetadata/autotests
/home/stefan/Sources/kfilemetadata/autotests/AVFORMAT_INCLUDE_DIRS
used as include directory in directory /home/stefan/Sources/kfilemetadata/autotests
AVCODEC_LIBRARIES (ADVANCED)
linked by target "ffmpegextractortest" in directory /home/stefan/Sources/kfilemetadata/autotests
AVFORMAT_LIBRARIES (ADVANCED)
linked by target "ffmpegextractortest" in directory /home/stefan/Sources/kfilemetadata/autotests
---
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kfilemetadata/-/merge_requests/112 Git commit f5c605d07f7f97057be8fce5e4b63863330baf8b by Stefan Brüns. Committed on 12/11/2023 at 19:01. Pushed by bruns into branch 'master'. [FFmpegExtractor] Bail out on first missing component during find_package The various FFmpeg componets have different version schemes, so it is not possible to query all components in a single call. On the other hand, subsequent find_package calls will overwrite the FOUND_FFMPEG variable with the last result, thus FOUND_FFMPEG will be set even when only libavutil is installed. Make the component checks dependent on the earlier ones, so the summary shows the correct result. M +6 -2 CMakeLists.txt https://invent.kde.org/frameworks/kfilemetadata/-/commit/f5c605d07f7f97057be8fce5e4b63863330baf8b Git commit 4d6337c594b7a54d70cc53b07f3e96217c2d490b by Stefan Brüns. Committed on 12/11/2023 at 19:11. Pushed by bruns into branch 'kf5'. [FFmpegExtractor] Bail out on first missing component during find_package The various FFmpeg componets have different version schemes, so it is not possible to query all components in a single call. On the other hand, subsequent find_package calls will overwrite the FOUND_FFMPEG variable with the last result, thus FOUND_FFMPEG will be set even when only libavutil is installed. Make the component checks dependent on the earlier ones, so the summary shows the correct result. (cherry picked from commit f5c605d07f7f97057be8fce5e4b63863330baf8b) M +6 -2 CMakeLists.txt https://invent.kde.org/frameworks/kfilemetadata/-/commit/4d6337c594b7a54d70cc53b07f3e96217c2d490b |
/home/justin/kde/src/kfilemetadata/src/extractors/ffmpegextractor.cpp:26:10: fatal error: libavformat/avformat.h: No such file or directory 26 | #include <libavformat/avformat.h> | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.