This will make it easier to build blender from source when
using system libs for building.
Details
Diff Detail
- Repository
- rB Blender
- Branch
- use_pkgconfig_for_ffmpeg_libs (branched from master)
- Build Status
Buildable 24041 Build 24041: arc lint + arc unit
Event Timeline
It doesn't, pkg-config is not a thing on windows with msvc (although a mingw/msys based build will have it), our windows support currently has it's own handling and doesn't rely on FindFFmpeg.cmake to find libs, also system libs aren't a thing on windows so that simplifies things a lot... what i'm saying is: don't worry about windows
| CMakeLists.txt | ||
|---|---|---|
| 27 | We could discuss bumping our minimum required cmake version as a project, this however should not be part of a diff that just aims to make some ffmpeg tweaks | |
Can you describe which problem prompted you to make this change? This has worked for system libraries in the past, but maybe something changed or there's an issue with a specific setup?
| build_files/cmake/Modules/FindFFmpeg.cmake | ||
|---|---|---|
| 40 | This seems like it will prefer pkgconfig over other detection, which may break building with precompiled libraries where we want it to be the other way around. | |
| build_files/cmake/Modules/FindFFmpeg.cmake | ||
|---|---|---|
| 40 | FFMPEG_ROOT_DIR is also ignored here I guess, so even when using system libraries that may make it impossible to manually pick the ffmpeg to use. | |
| CMakeLists.txt | ||
|---|---|---|
| 27 | A couple things just so we have them here:
And a couple questions:
| |
| build_files/cmake/Modules/FindFFmpeg.cmake | ||
| 40 | I'll change this around. | |
Sure. I am trying to build Blender on Fedora Rawhide. The defaults location for ffmpeg libs on this system is /usr/lib64/ffmpeg/... However that directory isn't searched by the setup before the change. I can, of course manually set the FFMPEG_ROOT_DIR variable, but I thought it would be better to use pkg-config since that helps discover everything this module attempts to discover. Honestly, I wonder if at some point it would make sense to remove the non-pkg-config discovery that I left in for backward compat when pkg-config isn't available. I would be surprised if any mainstream linux distro doesn't ship the pkg-config support for ffmpeg.
| build_files/cmake/Modules/FindFFmpeg.cmake | ||
|---|---|---|
| 40 |
With the way I changed it, you would define FFMPEG_ROOT_DIR to use some other lib? Previously, I guess it would also try to find ffmpeg in /opt/lib/ffmpeg. After this change, that directory is not searched before the pkg-config discovery. This seems correct to me. I will grant that is can make a build that previously used a lib in /opt/lib/ffmpeg break if the FFMPEG_ROOT_DIR is not specified. That seems like it would be pretty rare. Is that a reasonable assumption? FWIW, any ffmpeg that was detected in dirs like /lib or /usr/lib (defaults already searched by find_path) before would continue to work either by the pkg-config discovery pointing there, or, if pkg-config support for ffmeg isn't there, would fall back to the old discovery mechanisms. | |
| CMakeLists.txt | ||
|---|---|---|
| 27 |
It may be, however my argument was you can't just bump the minimum cmake version for the whole project in a change that does some localized ffmpeg tweaks. These are 2 distinctly different changes and need to be done in separate commits.
Cmake shipped with a version of the FindPkgConfig module as early as 3.0.2, what behaviour is the 3.12 module providing that 3.10 isn't that this change depends on?
Usually the project admins do a survey every couple of years to see what cmake versions disto's ship out of the box and what the oldest version shipped is (cough usually centos cough) and base our minimum version on that. With our centos7 support retiring in 2023 I'm expecting they'll have another look somewhere early 2023 | |
| build_files/cmake/Modules/FindFFmpeg.cmake | ||
|---|---|---|
| 40 |
This seems fine with the current code. For precompiled libraries we explicitly specify FFMPEG_ROOT_DIR so those should keep working. | |
| build_files/cmake/Modules/FindFFmpeg.cmake | ||
|---|---|---|
| 40 | I believe this is working now. If FFMPEG_ROOT_DIR is set, the pkg-config logic will not be used. Are you satisfied with this logic? | |