2011-11-24 07:01:08 +00:00
|
|
|
defineReplace(qtPlatformTargetSuffix) {
|
2013-10-25 15:20:05 +00:00
|
|
|
ios:CONFIG(iphonesimulator, iphonesimulator|iphoneos): \
|
|
|
|
suffix = _iphonesimulator
|
|
|
|
else: \
|
|
|
|
suffix =
|
|
|
|
|
2011-11-24 07:01:08 +00:00
|
|
|
CONFIG(debug, debug|release) {
|
|
|
|
!debug_and_release|build_pass {
|
2013-10-25 15:20:05 +00:00
|
|
|
mac: return($${suffix}_debug)
|
|
|
|
win32: return($${suffix}d)
|
2011-11-24 07:01:08 +00:00
|
|
|
}
|
|
|
|
}
|
2013-10-25 15:20:05 +00:00
|
|
|
return($$suffix)
|
2011-11-24 07:01:08 +00:00
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
defineReplace(qtLibraryTarget) {
|
|
|
|
LIBRARY_NAME = $$1
|
2013-02-15 18:28:28 +00:00
|
|
|
mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
|
2011-04-27 10:05:43 +00:00
|
|
|
QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME
|
|
|
|
export(QMAKE_FRAMEWORK_BUNDLE_NAME)
|
2012-10-16 02:45:16 +00:00
|
|
|
} else {
|
2014-08-29 14:45:15 +00:00
|
|
|
# insert the major version of Qt in the library name
|
2012-10-16 02:45:16 +00:00
|
|
|
# unless it's a framework build
|
2014-08-29 14:45:15 +00:00
|
|
|
LIBRARY_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2013-02-18 12:53:46 +00:00
|
|
|
return($$LIBRARY_NAME$$qtPlatformTargetSuffix())
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
defineTest(qtAddLibrary) {
|
2013-10-21 14:43:43 +00:00
|
|
|
warning("qtAddLibrary() is deprecated. Use QT+= instead.")
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2012-03-01 17:49:29 +00:00
|
|
|
# Reverse-engineer the module name from the library name.
|
2013-06-17 10:18:36 +00:00
|
|
|
for(var, QT_MODULES) {
|
|
|
|
isEqual(QT.$${var}.name, $$1) {
|
2013-10-21 19:05:35 +00:00
|
|
|
qtAddModule($$var, LIBS)
|
2013-10-21 14:45:15 +00:00
|
|
|
return(true)
|
2012-03-01 17:49:29 +00:00
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2012-03-01 17:49:29 +00:00
|
|
|
error("No module matching library '$$1' found.")
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2012-11-06 15:22:20 +00:00
|
|
|
# target variable, flag source variable
|
|
|
|
defineTest(qtProcessModuleFlags) {
|
|
|
|
for(flag, $$2) {
|
|
|
|
contains(flag, ^-.*): \
|
|
|
|
$$1 -= $$replace(flag, ^-, )
|
|
|
|
else: \
|
|
|
|
$$1 += $$flag
|
|
|
|
}
|
|
|
|
export($$1)
|
|
|
|
}
|
|
|
|
|
2012-12-21 11:09:56 +00:00
|
|
|
# qt module
|
|
|
|
defineTest(qtHaveModule) {
|
2013-10-25 10:24:20 +00:00
|
|
|
!isEmpty(QT.$$replace(1, -, _).name): \
|
2012-12-21 11:09:56 +00:00
|
|
|
return(true)
|
|
|
|
return(false)
|
|
|
|
}
|
|
|
|
|
2013-10-21 19:05:35 +00:00
|
|
|
# qt module, libs variable
|
2010-11-25 04:20:01 +00:00
|
|
|
defineTest(qtAddModule) {
|
|
|
|
MODULE_NAME = $$eval(QT.$${1}.name)
|
|
|
|
MODULE_INCLUDES = $$eval(QT.$${1}.includes)
|
|
|
|
MODULE_LIBS = $$eval(QT.$${1}.libs)
|
2011-09-15 22:47:33 +00:00
|
|
|
MODULE_CONFIG = $$eval(QT.$${1}.module_config)
|
2010-11-25 04:20:01 +00:00
|
|
|
|
2013-10-21 19:05:35 +00:00
|
|
|
contains(MODULE_CONFIG, internal_module) {
|
|
|
|
using_privates = true
|
|
|
|
export(using_privates)
|
|
|
|
}
|
2014-11-23 05:00:34 +00:00
|
|
|
contains(MODULE_CONFIG, ltcg): CONFIG += link_ltcg
|
2013-06-28 14:06:52 +00:00
|
|
|
|
2012-11-06 15:22:20 +00:00
|
|
|
qtProcessModuleFlags(CONFIG, QT.$${1}.CONFIG)
|
|
|
|
qtProcessModuleFlags(DEFINES, QT.$${1}.DEFINES)
|
2010-11-25 04:20:01 +00:00
|
|
|
|
2012-07-12 07:38:44 +00:00
|
|
|
MODULE_INCLUDES -= $$QMAKE_DEFAULT_INCDIRS
|
2012-12-08 10:47:31 +00:00
|
|
|
MODULE_LIBS_ADD = $$MODULE_LIBS
|
|
|
|
MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS
|
2012-04-10 16:49:01 +00:00
|
|
|
|
2010-11-25 04:20:01 +00:00
|
|
|
unset(LINKAGE)
|
2013-06-19 14:35:59 +00:00
|
|
|
mac:contains(MODULE_CONFIG, lib_bundle) {
|
2012-07-05 04:14:22 +00:00
|
|
|
FRAMEWORK_INCLUDE = $${MODULE_LIBS}/$${MODULE_NAME}.framework/Headers
|
2012-08-08 07:56:39 +00:00
|
|
|
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
|
2012-04-10 16:49:01 +00:00
|
|
|
INCLUDEPATH *= $$FRAMEWORK_INCLUDE
|
2012-08-08 07:56:39 +00:00
|
|
|
}
|
2013-10-21 19:05:35 +00:00
|
|
|
contains(MODULE_CONFIG, internal_module): \
|
2013-06-19 11:30:04 +00:00
|
|
|
INCLUDEPATH += \
|
|
|
|
$$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION) \
|
|
|
|
$$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION)/$$MODULE_NAME
|
2013-06-17 19:09:43 +00:00
|
|
|
QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS}
|
2013-10-21 19:05:35 +00:00
|
|
|
export(QMAKE_FRAMEWORKPATH)
|
|
|
|
!contains(MODULE_CONFIG, no_link): \
|
|
|
|
LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX}
|
2013-06-18 12:16:32 +00:00
|
|
|
} else {
|
|
|
|
INCLUDEPATH *= $$MODULE_INCLUDES
|
2010-11-25 04:20:01 +00:00
|
|
|
}
|
2013-10-21 19:05:35 +00:00
|
|
|
export(INCLUDEPATH)
|
2011-08-24 07:47:20 +00:00
|
|
|
|
2013-10-21 19:05:35 +00:00
|
|
|
# Only link to this module if a libs directory is set, else this is just a module
|
|
|
|
# to give access to sources or include files, and not for linking.
|
|
|
|
!isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link) {
|
|
|
|
|
|
|
|
# Re-insert the major version in the library name (cf qtLibraryTarget above)
|
|
|
|
# unless it's a framework build
|
|
|
|
!mac|!contains(MODULE_CONFIG, lib_bundle): \
|
2014-08-29 14:45:15 +00:00
|
|
|
MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
|
2013-10-21 19:05:35 +00:00
|
|
|
|
|
|
|
win32 {
|
|
|
|
# Make sure the version number isn't appended again to the lib name
|
|
|
|
ver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}_VERSION_OVERRIDE
|
|
|
|
dver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}D_VERSION_OVERRIDE
|
|
|
|
$$ver_var = 0
|
|
|
|
$$dver_var = 0
|
|
|
|
export($$ver_var)
|
|
|
|
export($$dver_var)
|
|
|
|
}
|
2012-10-16 02:45:16 +00:00
|
|
|
|
2013-10-21 19:05:35 +00:00
|
|
|
isEmpty(LINKAGE) {
|
|
|
|
!isEmpty(MODULE_LIBS_ADD): \
|
|
|
|
LINKAGE = -L$$MODULE_LIBS_ADD
|
|
|
|
lib = $${MODULE_NAME}$${QT_LIBINFIX}$$qtPlatformTargetSuffix()
|
|
|
|
LINKAGE += -l$$lib
|
2011-12-06 07:44:59 +00:00
|
|
|
|
2013-10-21 19:05:35 +00:00
|
|
|
contains(QT_CONFIG, rpath) {
|
|
|
|
QMAKE_RPATHDIR *= $$eval(QT.$${1}.rpath)
|
|
|
|
export(QMAKE_RPATHDIR)
|
|
|
|
}
|
2012-08-08 19:38:35 +00:00
|
|
|
|
2013-10-21 19:05:35 +00:00
|
|
|
contains(MODULE_CONFIG, staticlib) {
|
|
|
|
PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
|
|
|
|
export(PRE_TARGETDEPS)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$$2 += $$LINKAGE
|
|
|
|
export($$2)
|
2012-08-09 13:02:44 +00:00
|
|
|
|
2011-04-20 18:57:51 +00:00
|
|
|
!isEmpty(QMAKE_LSB) {
|
2013-10-21 19:05:35 +00:00
|
|
|
!isEmpty(MODULE_LIBS_ADD): \
|
|
|
|
QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS_ADD
|
2011-04-20 18:57:51 +00:00
|
|
|
QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX}
|
2013-10-21 19:05:35 +00:00
|
|
|
QMAKE_LIBDIR *= /opt/lsb/lib
|
|
|
|
export(QMAKE_LFLAGS)
|
|
|
|
export(QMAKE_LIBDIR)
|
2011-04-20 18:57:51 +00:00
|
|
|
}
|
2010-11-25 04:20:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-02 14:09:04 +00:00
|
|
|
# qt variable, libs variable
|
|
|
|
defineTest(qtAddModules) {
|
2013-10-21 19:05:35 +00:00
|
|
|
# qmake variables cannot contain dashes, so normalize the names first
|
|
|
|
$$1 = $$replace($$1, -private$, _private)
|
2012-08-02 14:09:04 +00:00
|
|
|
# Topological resolution of modules based on their QT.<module>.depends variable
|
2013-10-21 19:05:35 +00:00
|
|
|
$$1 = $$resolve_depends($$1, "QT.")
|
2012-08-02 14:09:04 +00:00
|
|
|
# Finally actually add the modules
|
|
|
|
unset(BAD_QT)
|
|
|
|
for(QTLIB, $$1) {
|
|
|
|
QTLIBNAME = $$eval(QT.$${QTLIB}.name)
|
|
|
|
isEmpty(QTLIBNAME) {
|
|
|
|
BAD_QT += $$QTLIB
|
|
|
|
next()
|
|
|
|
}
|
|
|
|
|
|
|
|
target_qt:isEqual(TARGET, $$QTLIBNAME) {
|
|
|
|
warning("$$TARGET cannot have a $$1 of $$QTLIB")
|
|
|
|
next()
|
|
|
|
}
|
|
|
|
|
2013-10-21 19:05:35 +00:00
|
|
|
qtAddModule($$QTLIB, $$2)
|
2012-08-02 14:09:04 +00:00
|
|
|
}
|
2013-10-21 19:05:35 +00:00
|
|
|
!isEmpty(BAD_QT):error("Unknown module(s) in $$1: $$replace(BAD_QT, _private$, -private)")
|
2012-08-02 14:09:04 +00:00
|
|
|
}
|
|
|
|
|
2013-02-01 16:30:31 +00:00
|
|
|
defineTest(qtAddRpathLink) {
|
|
|
|
# -rpath-link is used by the linker to find dependencies of dynamic
|
|
|
|
# libraries which were NOT specified on the command line.
|
|
|
|
# This means that paths of direct dependencies (QT & QT_PRIVATE)
|
|
|
|
# don't need to appear here. However, their private dependencies'
|
|
|
|
# paths OTOH need to be put there.
|
2013-10-21 19:05:35 +00:00
|
|
|
pubqt = $$replace(1, -private$, _private)
|
2013-02-01 16:30:31 +00:00
|
|
|
pubdep = $$resolve_depends(pubqt, "QT.")
|
|
|
|
privdep = $$resolve_depends(pubqt, "QT.", ".depends" ".private_depends" ".run_depends")
|
|
|
|
privdep -= $$pubdep
|
|
|
|
rpaths =
|
|
|
|
for(dep, privdep): \
|
|
|
|
rpaths += $$eval(QT.$${dep}.libs)
|
|
|
|
QMAKE_RPATHLINKDIR *= $$unique(rpaths)
|
|
|
|
export(QMAKE_RPATHLINKDIR)
|
|
|
|
}
|
|
|
|
|
2014-09-15 15:30:42 +00:00
|
|
|
# variable, default, [suffix for variable for system() use], [prepare primary variable for system() use]
|
2011-04-27 10:05:43 +00:00
|
|
|
defineTest(qtPrepareTool) {
|
2014-05-21 13:14:45 +00:00
|
|
|
cmd = $$eval(QT_TOOL.$${2}.binary)
|
|
|
|
isEmpty(cmd) {
|
|
|
|
cmd = $$[QT_HOST_BINS]/$$2
|
|
|
|
exists($${cmd}.pl) {
|
|
|
|
cmd = perl -w $$system_path($${cmd}.pl)
|
2013-05-10 16:54:41 +00:00
|
|
|
} else: contains(QMAKE_HOST.os, Windows) {
|
2014-05-21 13:14:45 +00:00
|
|
|
cmd = $$system_path($${cmd}.exe)
|
2012-07-03 17:26:36 +00:00
|
|
|
} else:contains(QMAKE_HOST.os, Darwin) {
|
2014-05-21 13:14:45 +00:00
|
|
|
BUNDLENAME = $${cmd}.app/Contents/MacOS/$$2
|
2012-07-03 17:26:36 +00:00
|
|
|
exists($$BUNDLENAME) {
|
2014-05-21 13:14:45 +00:00
|
|
|
cmd = $$BUNDLENAME
|
2012-07-03 17:26:36 +00:00
|
|
|
}
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2013-08-26 14:13:54 +00:00
|
|
|
QT_TOOL_ENV += $$eval(QT_TOOL.$${2}.envvars)
|
2014-09-15 15:30:42 +00:00
|
|
|
!isEmpty(3)|!isEmpty(4) {
|
2014-05-21 13:14:45 +00:00
|
|
|
$$1$$3 =
|
|
|
|
for (arg, cmd): \
|
|
|
|
$$1$$3 += $$system_quote($$arg)
|
2013-06-13 16:12:07 +00:00
|
|
|
qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system)
|
|
|
|
}
|
2014-09-15 15:30:42 +00:00
|
|
|
isEmpty(4) {
|
|
|
|
$$1 =
|
|
|
|
for (arg, cmd): \
|
|
|
|
$$1 += $$shell_quote($$arg)
|
|
|
|
qtAddTargetEnv($$1, QT_TOOL.$${2}.depends, )
|
|
|
|
}
|
2012-09-13 16:13:13 +00:00
|
|
|
}
|
|
|
|
|
2013-06-13 16:12:07 +00:00
|
|
|
# target variable, list of env var names, [non-empty: prepare for system(), not make]
|
2012-09-13 16:13:13 +00:00
|
|
|
defineTest(qtAddToolEnv) {
|
2013-06-13 16:12:07 +00:00
|
|
|
isEmpty(3): \
|
|
|
|
ds = $$QMAKE_DIR_SEP
|
|
|
|
else: \
|
|
|
|
ds = $$DIR_SEPARATOR
|
2012-09-13 16:13:13 +00:00
|
|
|
for(env, 2) {
|
|
|
|
value = $$eval($${env}.value)
|
|
|
|
!isEmpty(value) {
|
|
|
|
name = $$eval($${env}.name)
|
2013-06-13 16:12:07 +00:00
|
|
|
equals(ds, /) {
|
2012-09-13 16:13:13 +00:00
|
|
|
contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name}
|
|
|
|
else: infix =
|
2012-10-18 17:20:34 +00:00
|
|
|
val = "$$name=$$join(value, :)$$infix"
|
2012-09-13 16:13:13 +00:00
|
|
|
} else {
|
|
|
|
# Escape closing parens when expanding the variable, otherwise cmd confuses itself.
|
|
|
|
contains($${env}.CONFIG, prepend): infix = ;%$$name:)=^)%
|
|
|
|
else: infix =
|
2012-10-18 17:20:34 +00:00
|
|
|
val = "(set $$name=$$join(value, ;)$$infix) &"
|
2012-09-13 16:13:13 +00:00
|
|
|
}
|
2013-06-13 16:12:07 +00:00
|
|
|
isEmpty(3): !contains(TEMPLATE, vc.*) {
|
2013-06-13 15:37:53 +00:00
|
|
|
contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g
|
2013-06-13 15:41:36 +00:00
|
|
|
val ~= s,\\\$,\$\$,g
|
2013-06-13 15:37:53 +00:00
|
|
|
}
|
2012-10-18 17:20:34 +00:00
|
|
|
$$1 = "$$val $$eval($$1)"
|
2012-09-13 16:13:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
export($$1)
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2013-06-13 16:12:07 +00:00
|
|
|
# target variable, dependency var name, [non-empty: prepare for system(), not make]
|
2012-09-14 13:38:56 +00:00
|
|
|
defineTest(qtAddTargetEnv) {
|
2013-10-21 19:05:35 +00:00
|
|
|
deps = $$replace($$2, -private$, _private)
|
2013-03-07 16:17:12 +00:00
|
|
|
deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends")
|
2012-09-14 13:38:56 +00:00
|
|
|
!isEmpty(deps) {
|
2014-05-12 13:30:47 +00:00
|
|
|
ptypes =
|
2013-06-13 16:12:07 +00:00
|
|
|
for(dep, deps) {
|
|
|
|
isEmpty(3): \
|
|
|
|
deppath += $$shell_path($$eval(QT.$${dep}.libs))
|
|
|
|
else: \
|
|
|
|
deppath += $$system_path($$eval(QT.$${dep}.libs))
|
2014-05-12 13:30:47 +00:00
|
|
|
ptypes += $$eval(QT.$${dep}.plugin_types)
|
2013-06-13 16:12:07 +00:00
|
|
|
}
|
2012-10-29 10:18:06 +00:00
|
|
|
equals(QMAKE_HOST.os, Windows) {
|
2012-09-14 13:38:56 +00:00
|
|
|
deppath.name = PATH
|
2013-05-10 18:06:57 +00:00
|
|
|
} else:contains(QMAKE_HOST.os, Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|SunOS|HP-UX|QNX|GNU) {
|
2012-09-14 13:38:56 +00:00
|
|
|
deppath.name = LD_LIBRARY_PATH
|
2012-10-29 10:18:06 +00:00
|
|
|
} else:equals(QMAKE_HOST.os, Darwin) {
|
|
|
|
contains(QT_CONFIG, qt_framework): \
|
|
|
|
deppath.name = DYLD_FRAMEWORK_PATH
|
|
|
|
else: \
|
|
|
|
deppath.name = DYLD_LIBRARY_PATH
|
2013-05-10 18:06:57 +00:00
|
|
|
} else:equals(QMAKE_HOST.os, AIX) {
|
|
|
|
deppath.name = LIBPATH
|
2012-10-29 10:18:06 +00:00
|
|
|
} else {
|
2012-09-14 13:38:56 +00:00
|
|
|
error("Operating system not supported.")
|
2012-10-29 10:18:06 +00:00
|
|
|
}
|
2012-09-14 13:38:56 +00:00
|
|
|
deppath.value = $$unique(deppath)
|
|
|
|
deppath.CONFIG = prepend
|
2012-09-20 10:53:33 +00:00
|
|
|
|
2012-09-14 13:38:56 +00:00
|
|
|
pluginpath.value =
|
2014-05-12 13:30:47 +00:00
|
|
|
ppaths = $$[QT_INSTALL_PLUGINS/get]
|
|
|
|
for(qplug, QT_PLUGINS): \
|
|
|
|
contains(ptypes, QT_PLUGIN.$${qplug}.TYPE): \
|
|
|
|
ppaths += $$eval(QT_PLUGIN.$${qplug}.PATH)
|
|
|
|
ppaths = $$unique(ppaths)
|
|
|
|
for(qplug, ppaths) {
|
|
|
|
isEmpty(3): \
|
|
|
|
pluginpath.value += $$shell_path($$qplug)
|
|
|
|
else: \
|
|
|
|
pluginpath.value += $$system_path($$qplug)
|
2012-09-20 10:53:33 +00:00
|
|
|
}
|
|
|
|
pluginpath.name = QT_PLUGIN_PATH
|
|
|
|
|
2012-09-14 13:38:56 +00:00
|
|
|
QT_TOOL_ENV += deppath pluginpath
|
|
|
|
}
|
2013-06-13 16:12:07 +00:00
|
|
|
qtAddToolEnv($$1, $$QT_TOOL_ENV, $$3)
|
2012-09-14 13:38:56 +00:00
|
|
|
}
|
|
|
|
|
2011-10-19 13:36:33 +00:00
|
|
|
defineReplace(pkgConfigExecutable) {
|
|
|
|
isEmpty(PKG_CONFIG) {
|
|
|
|
PKG_CONFIG = pkg-config
|
|
|
|
|
|
|
|
!isEmpty(PKG_CONFIG_SYSROOT_DIR) {
|
|
|
|
win32:isEmpty(MINGW_IN_SHELL):PKG_CONFIG = set PKG_CONFIG_SYSROOT_DIR=$$PKG_CONFIG_SYSROOT_DIR& $$PKG_CONFIG
|
|
|
|
else:PKG_CONFIG = PKG_CONFIG_SYSROOT_DIR=\"$$PKG_CONFIG_SYSROOT_DIR\" $$PKG_CONFIG
|
|
|
|
}
|
|
|
|
|
|
|
|
!isEmpty(PKG_CONFIG_LIBDIR) {
|
|
|
|
win32:isEmpty(MINGW_IN_SHELL):PKG_CONFIG = set PKG_CONFIG_LIBDIR=$$PKG_CONFIG_LIBDIR& $$PKG_CONFIG
|
|
|
|
else:PKG_CONFIG = PKG_CONFIG_LIBDIR=\"$$PKG_CONFIG_LIBDIR\" $$PKG_CONFIG
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-07 14:21:30 +00:00
|
|
|
equals(QMAKE_HOST.os, Windows): \
|
|
|
|
PKG_CONFIG += 2> NUL
|
|
|
|
else: \
|
|
|
|
PKG_CONFIG += 2> /dev/null
|
|
|
|
|
2011-10-19 13:36:33 +00:00
|
|
|
return($$PKG_CONFIG)
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
defineTest(packagesExist) {
|
2012-11-19 14:53:57 +00:00
|
|
|
contains(QT_CONFIG, no-pkg-config):return(false)
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
# this can't be done in global scope here because qt_functions is loaded
|
|
|
|
# before the .pro is parsed, so if the .pro set PKG_CONFIG, we wouldn't know it
|
|
|
|
# yet. oops.
|
2011-10-19 13:36:33 +00:00
|
|
|
pkg_config = $$pkgConfigExecutable()
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
for(package, ARGS) {
|
2011-10-19 13:36:33 +00:00
|
|
|
!system($$pkg_config --exists $$package):return(false)
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return(true)
|
|
|
|
}
|
|
|
|
|
2012-10-17 12:13:19 +00:00
|
|
|
# Prepares target that will iterate through all subdirs (except those
|
|
|
|
# with no_default_target or no_{name_of_target}_target. The prepared
|
|
|
|
# target must still be manually added to QMAKE_EXTRA_TARGETS.
|
|
|
|
defineTest(prepareRecursiveTarget) {
|
|
|
|
target = $$1
|
|
|
|
no_$${target}_target: return()
|
|
|
|
|
|
|
|
for(subdir, SUBDIRS) {
|
|
|
|
subdir_config = $$eval($${subdir}.CONFIG)
|
|
|
|
contains(subdir_config, no_default_target): next()
|
|
|
|
contains(subdir_config, no_$${target}_target): next()
|
|
|
|
|
|
|
|
$${target}.recurse += $$subdir
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set up the recurse target only when there
|
|
|
|
# is something to recurse into.
|
|
|
|
isEmpty($${target}.recurse): return()
|
|
|
|
|
|
|
|
$${target}.CONFIG = recursive
|
|
|
|
$${target}.recurse_target = $${target}
|
|
|
|
|
|
|
|
export($${target}.recurse)
|
|
|
|
export($${target}.CONFIG)
|
|
|
|
export($${target}.recurse_target)
|
|
|
|
}
|