summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-11-11 13:35:03 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-11-13 16:25:53 +0100
commit63dae62b7fc6105a45dc88e01d205c89bcf0b683 (patch)
tree81837013f570bcc35684bd8e2d1d07efec3d55d3
parent5bd48047de4abecc47187d938c5e6ed8b8304aaf (diff)
In prefix builds, copy metatypes JSON to MODULE_BASE_OUTDIR
Otherwise we cannot find them when building further projects within the same module. For example, qmlmodels needs the metatypes of qml in order to build its plugins.qmltypes file, but the QML metatypes would only be available after installing. Change-Id: Ic2cdfa5b57fd3e5977eea16f2a9b192386737a1f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--mkspecs/features/metatypes.prf14
1 files changed, 12 insertions, 2 deletions
diff --git a/mkspecs/features/metatypes.prf b/mkspecs/features/metatypes.prf
index 515a472318..c6a655c7f1 100644
--- a/mkspecs/features/metatypes.prf
+++ b/mkspecs/features/metatypes.prf
@@ -1,5 +1,7 @@
qtPrepareTool(MOC_COLLECT_JSON, moc)
+load(qt_build_paths)
+
QMAKE_MOC_OPTIONS += --output-json
MOC_JSON_H_BASE = $${QMAKE_H_MOD_MOC}
@@ -35,8 +37,16 @@ moc_collect_json.name = Collect moc JSON output into central file
install_metatypes {
do_install_metatypes.path = $$[QT_INSTALL_LIBS]/metatypes
do_install_metatypes.files = $$OUT_PWD/$$MOC_COLLECT_JSON_OUTPUT
- prefix_build: INSTALLS += do_install_metatypes
- else: COPIES += do_install_metatypes
+ prefix_build {
+ !isEmpty(MODULE_BASE_OUTDIR) {
+ metatypes_to_builddir.files = $$do_install_metatypes.files
+ metatypes_to_builddir.path = $$MODULE_BASE_OUTDIR/lib/metatypes
+ COPIES += metatypes_to_builddir
+ }
+ INSTALLS += do_install_metatypes
+ } else {
+ COPIES += do_install_metatypes
+ }
}
QMAKE_EXTRA_COMPILERS += moc_collect_json moc_json_header moc_json_source