diff options
author | Andy Shaw <andy.shaw@qt.io> | 2019-03-01 15:37:08 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2019-03-20 08:37:59 +0000 |
commit | c808a6978b0e99086b1e42b565afe957d7295a9d (patch) | |
tree | ae361661c46aa522db10d40ba9c7b90d914c44ce /mkspecs | |
parent | 7c506150a52031877145daceb032ccb882fd0a1b (diff) |
Add a means to handle dynamically created qmldir files
This will enable modules like QtWebView which needs to generate its
qmldir at qmake time since it changes depending on whether QtWebEngine
is available or not. This ensures that it is not created in the sources
directory and in the build directory and correctly picked up.
Task-number: QTBUG-65092
Change-Id: Iac628b97145d29778f554510e8e07102d588df64
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/qml_module.prf | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf index bd84ce597a..dbf5b74355 100644 --- a/mkspecs/features/qml_module.prf +++ b/mkspecs/features/qml_module.prf @@ -13,7 +13,14 @@ equals(TEMPLATE, app): TEMPLATE = aux isEmpty(TARGETPATH): error("Must set TARGETPATH (QML import name)") -qmldir_file = $$_PRO_FILE_PWD_/qmldir +!isEmpty(DYNAMIC_QMLDIR) { + qmldir_path = $$OUT_PWD + write_file($${qmldir_path}/qmldir, DYNAMIC_QMLDIR)|error("Aborting.") +} else { + qmldir_path = $$_PRO_FILE_PWD_ +} + +qmldir_file = $${qmldir_path}/qmldir fq_qml_files = for(qmlf, QML_FILES): fq_qml_files += $$absolute_path($$qmlf, $$_PRO_FILE_PWD_) @@ -42,13 +49,20 @@ builtin_resources { } # Install rules -qmldir.base = $$_PRO_FILE_PWD_ +qmldir.base = $$qmldir_path # Tools need qmldir and plugins.qmltypes always installed on the file system -qmldir.files = $$qmldir_file $$fq_aux_qml_files + +qmldir.files = $$qmldir_file install_qml_files: qmldir.files += $$fq_qml_files qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH INSTALLS += qmldir +qmlfiles.base = $$_PRO_FILE_PWD_ +qmlfiles.files = $$fq_aux_qml_files +install_qml_files: qmlfiles.files += $$fq_qml_files +qmlfiles.path = $${qmldir.path} +INSTALLS += qmlfiles + !debug_and_release|!build_all|CONFIG(release, debug|release) { !prefix_build { COPIES += qmldir |