pkgconfig under Windows ? Was: review FindBlueZ.cmake

Pedro Lopez-Cabanillas pedro.lopez.cabanillas at
Sat Oct 1 22:17:46 UTC 2011

On Saturday 01 October 2011, Patrick Spendrin wrote:
> The issue with pkgconfig and also the point why we don't use it is the
> following: pkgconfig uses .pc files to find out about the layout of a
> library. This means that e.g. the installation path is hardcoded into
> that file, which makes sense as long as you don't send around packages
> containing these files: on a different system those paths will not have
> any meaning, so it is completely useless to put those paths in there.

The hardcoded path in the .pc file is interpreted (in Windows) relative to the 
directory where the .pc file was found. It is explained in the man page:

"Windows Specialities

If a .pc file is found in a directory that matches the usual conventions 
(i.e., ends with \lib\pkgconfig), the prefix for that package is assumed to be 
the grandparent of the directory where the file was found, and the prefix 
variable is overridden for that file accordingly.

In addition to the PKG_CONFIG_PATH environment variable, the Registry keys 
HKEY_LOCAL_MACHINE\Software\pkgconfig\PKG_CONFIG_PATH can be used to specify 
directories to search for .pc files. Each (string) value in these keys is 
treated as a directory where to look for .pc files."


More information about the Kde-buildsystem mailing list