summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-11-24 17:01:24 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-11-25 17:31:02 +0000
commitf91bbd243890511c99a084a478e7abe96d334860 (patch)
tree0890caef71faf9a66c4745878558c3fa5d5e8244
parent38259594e2cbb371a34942e98ab4fca1028fd497 (diff)
make handling of qml module search path saner
excise knowledge of QTREPOS from qt.prf - this is a private variable of the qt build system which the public functions should not know anything about. instead, move this handling to a function in qt_build_config.prf (where QTREPOS comes from in the first place), and call it from qt_app.prf and qt_example_installs.prf (which should be the only consumers within qt). qt.prf now also checks that the qml install dir actually exists, which is not the case during a modular prefix build of qtdeclarative. not really incidentally, this fixes modular static builds of qtdeclarative. Task-number: QTBUG-57308 Change-Id: I31465b9cd400483264fc236934c6f9f26a5fdd73 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--mkspecs/features/qt.prf9
-rw-r--r--mkspecs/features/qt_app.prf2
-rw-r--r--mkspecs/features/qt_build_config.prf16
-rw-r--r--mkspecs/features/qt_example_installs.prf3
4 files changed, 23 insertions, 7 deletions
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 9bf0d2fad3..98f794c485 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -194,13 +194,8 @@ qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
# static builds: link qml import plugins into the app.
contains(qt_module_deps, qml): \
qtConfig(static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
- !isEmpty(QTREPOS) {
- for (qrep, QTREPOS): \
- exists($$qrep/qml): \
- QMLPATHS += $$qrep/qml
- } else {
- QMLPATHS += $$[QT_INSTALL_QML/get]
- }
+ exists($$[QT_INSTALL_QML/get]): \
+ QMLPATHS *= $$[QT_INSTALL_QML/get]
# run qmlimportscanner
qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner, , system)
diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
index 87e32d6d42..cb84ae0da8 100644
--- a/mkspecs/features/qt_app.prf
+++ b/mkspecs/features/qt_app.prf
@@ -37,6 +37,8 @@ INSTALLS += target
load(qt_targets)
load(qt_common)
+qtSetQmlPath()
+
no_launch_target: return()
load(resolve_target)
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf
index 95e63ecae0..3762c14f98 100644
--- a/mkspecs/features/qt_build_config.prf
+++ b/mkspecs/features/qt_build_config.prf
@@ -52,6 +52,22 @@ QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR
unset(modpath)
}
+defineTest(qtSetQmlPath) {
+ !qtConfig(static)|host_build|no_import_scan: \
+ return()
+ deps = $$replace(QT, -private$, _private)
+ deps = $$resolve_depends(deps, "QT.")
+ !contains(deps, qml): \
+ return()
+
+ isEmpty(QTREPOS): \
+ QTREPOS = $$shadowed($$dirname(_QMAKE_CONF_))
+ for (qrep, QTREPOS): \
+ exists($$qrep/qml): \
+ QMLPATHS += $$qrep/qml
+ export(QMLPATHS)
+}
+
# Apply extra compiler flags passed via configure last.
CONFIG = qt_build_extra $$CONFIG
diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf
index 4c68cfd72f..0a008374e5 100644
--- a/mkspecs/features/qt_example_installs.prf
+++ b/mkspecs/features/qt_example_installs.prf
@@ -9,6 +9,9 @@
# We mean it.
#
+contains(TEMPLATE, .*app): \
+ qtSetQmlPath()
+
contains(TEMPLATE, "vc.*"): return()
defineTest(addInstallFiles) {