[CMake] pkgconfig and cross compiling

Alexander Neundorf a.neundorf-work at gmx.net
Tue Nov 4 14:57:16 EST 2008


On Tuesday 04 November 2008, Alan W. Irwin wrote:
...
> I don't get the behaviour you describe for my version of pkg-config
> (0.22-1).
>
> For that version of pkg-config, if I point PKG_CONFIG_LIBDIR to a directory
> then if the required *.pc file is not in that directory, then it gives an
> error message and quits, i.e., it finds nothing else regardless of how
> PKG_CONFIG_PATH is set. As you have stated that is the ideal behaviour for
> cross-compilation.
>
> I suspect the problem is you are using a really old version of pkg-config.
> There is a bug report at https://bugs.freedesktop.org/show_bug.cgi?id=3093
> that describes the incorrect behaviour of PKG_CONFIG_LIBDIR that you see on
> your system.  That bug was fixed as of version pkg-config 0.18 (released in
> June 2005).
>
> So install a recent version of pkg-config, and I think your troubles with
> PKG_CONFIG_LIBDIR will be over.

Hmm. Directly copied from my terminal:
hammer:~$ echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
hammer:~$ export PKG_CONFIG_LIBDIR=/tmp
hammer:~$ strace pkg-config alsa --variable=includedir 2> pkgconfig.log
/usr/include
hammer:~$ grep alsa.pc pkgconfig.log
open("/usr/lib/pkgconfig/alsa.pc", O_RDONLY) = 3
hammer:~$ pkg-config --version
0.21
hammer:~$

(there are no pc-files in /tmp)

Alex


More information about the CMake mailing list