Make qt.prf use new qt_module.pri structure for QT variable

This change requires the new resolve_depends(var, prefix) function in qmake.
This commit is contained in:
Marius Storm-Olsen 2010-11-24 22:20:01 -06:00 committed by axis
parent bca5a5d6f6
commit 78797cc7e9
3 changed files with 82 additions and 72 deletions

View File

@ -35,19 +35,6 @@ plugin { #Qt plugins
INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picking up "stale" includes
win32:INCLUDEPATH += $$QMAKE_INCDIR_QT/ActiveQt
# As order does matter for static libs, we reorder the QT variable here
TMPLIBS = declarative webkit phonon multimedia dbus testlib script scripttools svg qt3support sql xmlpatterns xml egl opengl openvg gui network core meegographicssystemhelper
for(QTLIB, $$list($$TMPLIBS)) {
contains(QT, $$QTLIB): QT_ORDERED += $$QTLIB
}
QT_UNKNOWN = $$QT
QT_UNKNOWN -= $$QT_ORDERED
QT = $$QT_ORDERED
for(QTLIB, $$list($$QT_UNKNOWN)) {
!contains(TMPLIBS, $$QTLIB):message("Warning: unknown QT: $$QTLIB")
}
QT_PLUGIN_VERIFY = QTPLUGIN DEPLOYMENT_PLUGIN
for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {
@ -128,69 +115,27 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
}
}
}
#specific module settings
!isEmpty(QT_BUILD_TREE):QMAKE_LIBDIR = $$QT_BUILD_TREE/lib $$QMAKE_LIBDIR #as above, prepending prevents us from picking up "stale" libs
QMAKE_LIBDIR += $$QMAKE_LIBDIR_QT
# Topological ordering of modules based on their QT.<module>.depends variable
QT = $$resolve_depends($$QT, "QT.")
for(QTLIB, $$list($$lower($$unique(QT)))) {
unset(qlib_style)
!qt_debug:!qt_release {
CONFIG(debug, debug|release):qlib_style = debug
else:qlib_style = release
} else:CONFIG(qt_debug, qt_debug|qt_release) {
qlib_style = debug
} else {
qlib_style = release
}
isEmpty(QT.$${QTLIB}.name) {
message("Warning: unknown QT module: $$QTLIB")
next()
}
unset(qlib)
isEqual(QTLIB, gui):qlib = QtGui
else:isEqual(QTLIB, network):qlib = QtNetwork
else:isEqual(QTLIB, xml):qlib = QtXml
else:isEqual(QTLIB, xmlpatterns):qlib = QtXmlPatterns
else:isEqual(QTLIB, opengl):qlib = QtOpenGL
else:isEqual(QTLIB, openvg):qlib = QtOpenVG
else:isEqual(QTLIB, sql):qlib = QtSql
else:isEqual(QTLIB, core):qlib = QtCore
else:isEqual(QTLIB, canvas):qlib = QtCanvas
else:isEqual(QTLIB, qt3support):qlib = Qt3Support
else:isEqual(QTLIB, svg):qlib = QtSvg
else:isEqual(QTLIB, script):qlib = QtScript
else:isEqual(QTLIB, scripttools):qlib = QtScriptTools
else:isEqual(QTLIB, testlib):qlib = QtTest
else:isEqual(QTLIB, dbus):qlib = QtDBus
else:isEqual(QTLIB, phonon) {
qlib = phonon
INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon_compat
# The Helix backend requires this. Since we can't let a plugin set it,
# we bump the values for all Symbian Phonon plugins.
symbian:isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x040000 0x1600000
} else:isEqual(QTLIB, webkit) {
qlib = QtWebKit
aix-xlc {
# Flags recommended by IBM when using WebKit
QMAKE_LFLAGS -= -bmaxdata:0x80000000
QMAKE_LFLAGS += -bmaxdata:0xD0000000/dsa
}
} else:isEqual(QTLIB, declarative):qlib = QtDeclarative
else:isEqual(QTLIB, multimedia):qlib = QtMultimedia
else:isEqual(QTLIB, meegographicssystemhelper):qlib = QtMeeGoGraphicsSystemHelper
else:message("Unknown QT: $$QTLIB"):qlib =
!isEmpty(qlib) {
target_qt:isEqual(TARGET, qlib) {
warning($$TARGET cannot have a QT of $$QTLIB)
} else {
DEFINES *= $$upper(QT_$${QTLIB}_LIB)
isEqual(QTLIB, opengl):CONFIG += opengl
isEqual(QTLIB, openvg):CONFIG += openvg
isEqual(QTLIB, qt3support):DEFINES *= QT3_SUPPORT
isEqual(QTLIB, testlib):CONFIG += console
isEqual(QTLIB, dbus):CONFIG += dbusadaptors dbusinterfaces
qtAddLibrary($$qlib)
}
}
target_qt:isEqual(TARGET, QTLIB) {
warning($$TARGET cannot have a QT of $$QTLIB)
next()
}
qtAddModule($$QTLIB)
}
qt_compat {

View File

@ -92,6 +92,69 @@ defineTest(qtAddLibrary) {
return(true)
}
defineTest(qtAddModule) {
MODULE_NAME = $$eval(QT.$${1}.name)
MODULE_INCLUDES = $$eval(QT.$${1}.includes)
MODULE_LIBS = $$eval(QT.$${1}.libs)
CONFIG += $$eval(QT.$${1}.CONFIG)
DEFINES += $$eval(QT.$${1}.DEFINES)
INCLUDEPATH -= $$MODULE_INCLUDES
INCLUDEPATH = $$MODULE_INCLUDES $$INCLUDEPATH
unset(LINKAGE)
mac {
CONFIG(qt_framework, qt_framework|qt_no_framework) { #forced
QMAKE_FRAMEWORKPATH *= $${QMAKE_LIBDIR_QT}
FRAMEWORK_INCLUDE = $$MODULE_INCLUDES.framework/Headers
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
INCLUDEPATH -= $$FRAMEWORK_INCLUDE
INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH
}
LINKAGE = -framework $${MODULE_NAME}$${QT_LIBINFIX}
} else:!qt_no_framework { #detection
for(frmwrk_dir, $$list($$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH) /Library/Frameworks)) {
exists($${frmwrk_dir}/$${MODULE_NAME}.framework) {
QMAKE_FRAMEWORKPATH *= $${frmwrk_dir}
FRAMEWORK_INCLUDE = $$frmwrk_dir/$${MODULE_NAME}.framework/Headers
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
INCLUDEPATH -= $$FRAMEWORK_INCLUDE
INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH
}
LINKAGE = -framework $${MODULE_NAME}
break()
}
}
}
}
isEmpty(LINKAGE) {
# Make sure we can link to uninstalled libraries
!isEqual(MODULE_LIBS, $[QT_INSTALL_LIBS]) {
QMAKE_LFLAGS *= -L$$MODULE_LIBS
unix:QMAKE_LFLAGS *= "-Wl,-rpath-link,$$MODULE_LIBS"
}
if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
win32:LINKAGE = -l$${MODULE_NAME}$${QT_LIBINFIX}d
mac:LINKAGE = -l$${MODULE_NAME}$${QT_LIBINFIX}_debug
}
isEmpty(LINKAGE):LINKAGE = -l$${MODULE_NAME}$${QT_LIBINFIX}
}
!isEmpty(QMAKE_LSB) {
QMAKE_LFLAGS *= --lsb-libpath=$$$$QMAKE_LIBDIR_QT
QMAKE_LFLAGS *= -L/opt/lsb/lib
QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX}
}
LIBS += $$LINKAGE
export(CONFIG)
export(DEFINES)
export(LIBS)
export(INCLUDEPATH)
export(QMAKE_FRAMEWORKPATH)
export(QMAKE_LFLAGS)
return(true)
}
# variable, default
defineTest(qtPrepareTool) {
isEmpty($$1) {

View File

@ -1,5 +1,7 @@
isEmpty(TARGET):error("You must set TARGET before include()'ing $${_FILE_}")
INCLUDEPATH *= $$QMAKE_INCDIR_QT/$$TARGET #just for today to have some compat
MODULE_INCLUDES = $$eval(QT.$${MODULE}.includes)
INCLUDEPATH *= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. #just for today to have some compat
!isEmpty(RCC_DIR): INCLUDEPATH += $$RCC_DIR
isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700
TEMPLATE = lib