How do you specify the pkg-config path when compiling something with cmake?
3
votes
1
answer
2902
views
I want to build ffmpeg with support for the av1 codec on CentOS 7.
I start by following the instructions here :
git clone https://aomedia.googlesource.com/aom
mkdir aom_build
cd aom_build
cmake ../aom
make
sudo make install
This writes a file to
/usr/local/lib64/pkgconfig/aom.pc
.
When I later clone ffmpeg's git repo and try to run ./configure --enable-libaom ...
, it complains that pkg-config can't find the aom.pc file.
This is because if I run pkg-config --variable pc_path pkg-config
, I can see that pkg-config only checks here:
/usr/lib64/pkgconfig:/usr/share/pkgconfig
It doesn't look in /usr/local/lib64/pkgconfig
, where aom.pc is.
So far, the only fix I've come up with is to run this instead in ffmpeg's git directory:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH/usr/local/lib64/pkgconfig: ./configure --enable-libaom ...
This works, but I'd rather just tell libaom to write aom.pc to /usr/lib64/pkgconfig in the first place.
Is there any way, when building aom, to tell cmake or make to write the aom.pc file to /usr/lib64/pkgconfig instead of /usr/local/lib64/pkgconfig?
In other projects that have a ./configure
step, I've seen it possible to specify this with ./configure --pkgconfigdir=/usr/lib64/pkgconfig
, but the aom project doesn't have a ./configure
script, so I'm not sure what to do here.
Asked by Tal
(2252 rep)
Apr 24, 2019, 02:52 PM
Last activity: Jul 28, 2025, 12:07 AM
Last activity: Jul 28, 2025, 12:07 AM