Write PKG_CONFIG_EXECUTABLE to qmodule.pri

... and use that variable in qt_configure.prf to find the pkg-config we
detected during qtbase configuration.
This is required for modules outside of qtbase being able to use
pkg-config to configure external libraries.

We do not use the PKG_CONFIG variable any more, as that interferes with
the $$pkgConfigExecutable() function, which some Qt modules still use.

Change-Id: I8886a266207e04301009fe8207c16b02c5455b2f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Lars Knoll 2016-10-26 13:42:24 +02:00
parent 99331f661d
commit ed99ffdc32
2 changed files with 4 additions and 3 deletions

View File

@ -325,8 +325,9 @@ defineTest(qtConfOutput_qreal) {
defineTest(qtConfOutput_pkgConfig) {
!$${2}: return()
PKG_CONFIG = $$eval($${currentConfig}.tests.pkg-config.pkgConfig)
export(PKG_CONFIG)
PKG_CONFIG_EXECUTABLE = $$eval($${currentConfig}.tests.pkg-config.pkgConfig)
qtConfOutputVar(assign, "privatePro", "PKG_CONFIG_EXECUTABLE", $$PKG_CONFIG_EXECUTABLE)
export(PKG_CONFIG_EXECUTABLE)
# this method also exports PKG_CONFIG_(LIB|SYSROOT)DIR, so that tests using pkgConfig will work correctly
PKG_CONFIG_SYSROOT_DIR = $$eval($${currentConfig}.tests.pkg-config.pkgConfigSysrootDir)
!isEmpty(PKG_CONFIG_SYSROOT_DIR) {

View File

@ -376,7 +376,7 @@ defineReplace(qtConfPkgConfig) {
$$host {
pkg_config = $$qtConfFindInPath("pkg-config")
} else {
pkg_config = "$$qtConfPkgConfigEnv()$$PKG_CONFIG"
pkg_config = "$$qtConfPkgConfigEnv()$$PKG_CONFIG_EXECUTABLE"
}
return($$pkg_config)