transitively resolve module dependencies

otherwise we need the nasty hack for includes, and CONFIGs and DEFINES
from dependencies are not included at all.

Change-Id: I7eaee761161a6e8fbac8e9237d26559aa11a88a1
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
This commit is contained in:
Oswald Buddenhagen 2012-02-24 19:18:02 +01:00 committed by Qt by Nokia
parent 8bf6d6a6ca
commit 1fc0e27b17

View File

@ -152,21 +152,22 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
!isEmpty(QT_BUILD_TREE):QMAKE_LIBDIR = $$QT_BUILD_TREE/lib $$QMAKE_LIBDIR #as above, prepending prevents us from picking up "stale" libs !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 QMAKE_LIBDIR += $$QMAKE_LIBDIR_QT
# Topological ordering of modules based on their QT.<module>.depends variable # Figure out from which modules we're wanting to use the private headers
QT = $$sort_depends(QT, "QT.")
QT_DEPENDS=
unset(using_privates) unset(using_privates)
NEWQT =
for(QTLIB, QT) { for(QTLIB, QT) {
# Figure out if we're wanting to use the private headers of a module QTLIBRAW = $$replace(QTLIB, -private$, )
contains(QTLIB, .*-private) { !isEqual(QTLIBRAW, $$QTLIB) {
QTLIB ~= s/-private// want_var = QT.$${QTLIBRAW}.want_private
use_private = UsePrivate $$want_var = UsePrivate
} else { using_privates = true
use_private = NoPrivate
} }
NEWQT += $$QTLIBRAW
}
# Topological resolution of modules based on their QT.<module>.depends variable
QT = $$resolve_depends(NEWQT, "QT.")
# Finally actually add the modules
for(QTLIB, QT) {
isEmpty(QT.$${QTLIB}.name) { isEmpty(QT.$${QTLIB}.name) {
message("Warning: unknown QT module: $$QTLIB") message("Warning: unknown QT module: $$QTLIB")
next() next()
@ -176,14 +177,9 @@ for(QTLIB, QT) {
warning($$TARGET cannot have a QT of $$QTLIB) warning($$TARGET cannot have a QT of $$QTLIB)
next() next()
} }
qtAddModule($$QTLIB, $$use_private)
QT_DEPENDS += $$eval(QT.$${QTLIB}.depends)
isEqual(use_private, UsePrivate):using_privates = true
}
# add include paths for all .depends, since module/application might need f.ex. template specializations etc. qtAddModule($$QTLIB, $$eval(QT.$${QTLIB}.want_private))
QT_DEPENDS -= $$QT }
for(QTLIB, $$list($$lower($$unique(QT_DEPENDS)))):INCLUDEPATH *= $$INCLUDEPATH $$eval(QT.$${QTLIB}.includes)
!isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) { !isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) {
message("This project is using private headers and will therefore be tied to this specific Qt module build version.") message("This project is using private headers and will therefore be tied to this specific Qt module build version.")