qt5base-lts/mkspecs/features/qml_module.prf
Simon Hausmann 6cc02ce6c8 Fix qmldir copying in debug and release builds on Windows
In a parallel build we may end up copying the qmldir file at the same
time, which doesn't work on Windows due to file locking. Apply the same
guard for the copying condition as in commit
770a0c91f3.

Change-Id: Ia34395e8654acf192b94e7ea6d0137730e4ea027
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-15 13:23:15 +00:00

59 lines
1.6 KiB
Plaintext

#
# W A R N I N G
# -------------
#
# This file is not part of the Qt API. It exists purely as an
# implementation detail. It may change from version to version
# without notice, or even be removed.
#
# We mean it.
#
equals(TEMPLATE, app): TEMPLATE = aux
isEmpty(TARGETPATH): error("Must set TARGETPATH (QML import name)")
qmldir_file = $$_PRO_FILE_PWD_/qmldir
fq_qml_files = $$qmldir_file
for(qmlf, QML_FILES): fq_qml_files += $$absolute_path($$qmlf, $$_PRO_FILE_PWD_)
load(qt_build_paths)
qml1_target {
DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH
instbase = $$[QT_INSTALL_IMPORTS]
} else {
DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
instbase = $$[QT_INSTALL_QML]
}
!qml1_target:static: CONFIG += builtin_resources
builtin_resources {
URITARGET = $$replace(URI, "\\.", "_")
# Ensure the qml files are included in the resources
$${URITARGET}.files = $$fq_qml_files
# qt-project.org/imports is the path used for locating imports inside the resources
$${URITARGET}.prefix = /qt-project.org/imports/$$TARGETPATH
RESOURCES += $${URITARGET}
}
# Install rules
qmldir.base = $$_PRO_FILE_PWD_
!builtin_resources: qmldir.files = $$fq_qml_files
else: qmldir.files = $$qmldir_file
qmldir.path = $$instbase/$$TARGETPATH
INSTALLS += qmldir
!debug_and_release|!build_all|CONFIG(release, debug|release) {
!prefix_build {
COPIES += qmldir
} else {
# For non-installed static builds, qmlimportscanner needs qmldir file in build dir
qmldir2build.files = $$qmldir_file
qmldir2build.path = $$DESTDIR
COPIES += qmldir2build
}
}