diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2019-05-21 13:05:02 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2019-05-23 11:36:02 +0000 |
commit | cff203ffed4c296ca7ced5013ec9075332465d01 (patch) | |
tree | bd8814329333a7636969ae8904f0ed6a7bfe38e8 /qmake-features | |
parent | b8a24bb3d3c00fcf34bc20870749283cd20c5236 (diff) |
[build-system] Fix in-tree builds
Make the qmlplugin.prf more flexible by always using EXTRA_FILES
instead of having a second special rule for the qmldir file.
In case a qmldir exists it will be automatically added to EXTRA_FILES.
The EXTRA_FILES can now also be part of another folder, which is
needed for the future when qmlplugins are autogenerated as well
and the qmldir files are part of the build folder.
Change-Id: I0b310a19f611e8e5d7cb65de5de9fe06cfaf01e1
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'qmake-features')
-rw-r--r-- | qmake-features/qmlplugin.prf | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/qmake-features/qmlplugin.prf b/qmake-features/qmlplugin.prf index 4fada244..ea8b8ad6 100644 --- a/qmake-features/qmlplugin.prf +++ b/qmake-features/qmlplugin.prf @@ -7,26 +7,25 @@ TARGET = $$qtLibraryTarget($$TARGET) android: DESTDIR = $$BUILD_DIR/imports_shared_cpp/shared/$$replace(uri, \\., /) else: DESTDIR = $$BUILD_DIR/imports_shared/shared/$$replace(uri, \\., /) -OTHER_FILES = qmldir - -!equals(_PRO_FILE_PWD_, $$OUT_PWD) { - copy_qmldir.target = $$replace(DESTDIR, /, $$QMAKE_DIR_SEP)$${QMAKE_DIR_SEP}qmldir - copy_qmldir.depends = $$replace(_PRO_FILE_PWD_, /, $$QMAKE_DIR_SEP)$${QMAKE_DIR_SEP}qmldir - copy_qmldir.commands = $(COPY_FILE) \"$$copy_qmldir.depends\" \"$$copy_qmldir.target\" - QMAKE_EXTRA_TARGETS += copy_qmldir - PRE_TARGETDEPS += $$copy_qmldir.target +# if a qmldir exists automatically add it to the EXTRA_FILES +exists($$_PRO_FILE_PWD_/qmldir) { + EXTRA_FILES += $$_PRO_FILE_PWD_/qmldir } -!equals(_PRO_FILE_PWD_, $$OUT_PWD) { - for(extra_file, EXTRA_FILES) { - file = $$replace(_PRO_FILE_PWD_, /, $$QMAKE_DIR_SEP)$${QMAKE_DIR_SEP}$${extra_file} - target = $$replace(DESTDIR, /, $$QMAKE_DIR_SEP)$${QMAKE_DIR_SEP}$${extra_file} - copy_$${extra_file}.target = $$target - copy_$${extra_file}.depends = $$file - copy_$${extra_file}.commands = $(COPY_FILE) \"$$file\" \"$$target\" - QMAKE_EXTRA_TARGETS += copy_$${extra_file} - PRE_TARGETDEPS += $$target +# Always copy all EXTRA_FILES to the plugin destination +for(extra_file, EXTRA_FILES) { + exists($$extra_file) { + file = $$extra_file + } else { + file = $$_PRO_FILE_PWD_/$${extra_file} } + file = $$replace(file, /, $$QMAKE_DIR_SEP) + target = $$replace(DESTDIR, /, $$QMAKE_DIR_SEP)$${QMAKE_DIR_SEP}$$basename(file) + copy_$${extra_file}.target = $$target + copy_$${extra_file}.depends = $$file + copy_$${extra_file}.commands = $(COPY_FILE) \"$$file\" \"$$target\" + QMAKE_EXTRA_TARGETS += copy_$${extra_file} + PRE_TARGETDEPS += $$target } for(extra_file, EXTRA_FILES) { @@ -36,10 +35,8 @@ for(extra_file, EXTRA_FILES) { include(../config.pri) -qmldir.files = qmldir android: installPath = $$INSTALL_PREFIX/imports_shared_cpp/shared/$$replace(uri, \\., /) else: installPath = $$INSTALL_PREFIX/neptune3/imports_shared/shared/$$replace(uri, \\., /) -qmldir.path = $$installPath target.path = $$installPath extra_files_install.path = $$installPath -INSTALLS += target qmldir extra_files_install +INSTALLS += target extra_files_install |