summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/qt.prf35
-rw-r--r--mkspecs/features/qt_functions.prf43
2 files changed, 43 insertions, 35 deletions
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index eaedc55864..8f797a5960 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -135,40 +135,9 @@ uitools {
QT += uitools
}
-# Figure out from which modules we're wanting to use the private headers
unset(using_privates)
-NEWQT =
-for(QTLIB, QT) {
- QTLIBRAW = $$replace(QTLIB, -private$, )
- !isEqual(QTLIBRAW, $$QTLIB) {
- want_var = QT.$${QTLIBRAW}.want_private
- $$want_var = UsePrivate
- using_privates = true
- NEWQT += $$eval(QT.$${QTLIBRAW}.private_depends)
- }
- NEWQT += $$QTLIBRAW
- contains(QT.$${QTLIBRAW}.CONFIG, auto_use_privates): CONFIG += auto_use_privates
-}
-# Topological resolution of modules based on their QT.<module>.depends variable
-QT = $$resolve_depends(NEWQT, "QT.")
-# Finally actually add the modules
-unset(BAD_QT)
-for(QTLIB, QT) {
- QTLIBNAME = $$eval(QT.$${QTLIB}.name)
- isEmpty(QTLIBNAME) {
- BAD_QT += $$QTLIB
- next()
- }
-
- target_qt:isEqual(TARGET, $$QTLIBNAME) {
- warning($$TARGET cannot have a QT of $$QTLIB)
- next()
- }
-
- qtAddModule($$QTLIB, $$eval(QT.$${QTLIB}.want_private))
-}
-!isEmpty(BAD_QT):error("Unknown module(s) in QT: $$BAD_QT")
-
+qtAddModules(QT, LIBS)
+qtAddModules(QT_PRIVATE, LIBS_PRIVATE)
!isEmpty(using_privates):!auto_use_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("Running this project against other versions of the Qt modules may crash at any arbitrary point.")
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 3517e695a5..7a13f9feca 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -35,6 +35,7 @@ defineTest(qtAddLibrary) {
error("No module matching library '$$1' found.")
}
+# qt module, UsePrivate flag, libs variable
defineTest(qtAddModule) {
MODULE_NAME = $$eval(QT.$${1}.name)
MODULE_INCLUDES = $$eval(QT.$${1}.includes)
@@ -102,11 +103,11 @@ defineTest(qtAddModule) {
QMAKE_LIBDIR *= /opt/lsb/lib
QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX}
}
- LIBS += $$LINKAGE
+ $$3 += $$LINKAGE
}
export(CONFIG)
export(DEFINES)
- export(LIBS)
+ export($$3)
export(INCLUDEPATH)
export(QMAKE_FRAMEWORKPATH)
export(QMAKE_LFLAGS)
@@ -114,6 +115,44 @@ defineTest(qtAddModule) {
return(true)
}
+# qt variable, libs variable
+defineTest(qtAddModules) {
+ # Figure out from which modules we're wanting to use the private headers
+ NEWQT =
+ for(QTLIB, $$1) {
+ QTLIBRAW = $$replace(QTLIB, -private$, )
+ !isEqual(QTLIBRAW, $$QTLIB) {
+ want_var = QT.$${QTLIBRAW}.want_private
+ $$want_var = UsePrivate
+ using_privates = true
+ NEWQT += $$eval(QT.$${QTLIBRAW}.private_depends)
+ }
+ NEWQT += $$QTLIBRAW
+ contains(QT.$${QTLIBRAW}.CONFIG, auto_use_privates): CONFIG += auto_use_privates
+ }
+ # Topological resolution of modules based on their QT.<module>.depends variable
+ $$1 = $$resolve_depends(NEWQT, "QT.")
+ # 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()
+ }
+
+ qtAddModule($$QTLIB, $$eval(QT.$${QTLIB}.want_private), $$2)
+ }
+ !isEmpty(BAD_QT):error("Unknown module(s) in QT: $$BAD_QT")
+
+ export(using_privates)
+}
+
# variable, default
defineTest(qtPrepareTool) {
$$1 = $$eval(QT_TOOL.$${2}.binary)