qt5base-lts/mkspecs/features/qml_module.prf
Oswald Buddenhagen fbfb4d4b9a preserve the directory structure of QML_FILES
Change-Id: I39ccdbf59887f14be7dad492598160eebb94ce78
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-08 12:04:49 +02:00

34 lines
1.1 KiB
Plaintext

equals(TEMPLATE, app): TEMPLATE = aux
isEmpty(TARGETPATH): error("Must set TARGETPATH (QML import name)")
fq_qml_files = $$_PRO_FILE_PWD_/qmldir
for(qmlf, QML_FILES): fq_qml_files += $$absolute_path($$qmlf, $$_PRO_FILE_PWD_)
# Only for Qt Creator's project view
OTHER_FILES += $$fq_qml_files
exists($$[QT_HOST_PREFIX]/.qmake.cache) {
# These bizarre rules copy the files to the qtbase build directory
defineReplace(qmlModStripSrcDir) {
return($$relative_path($$1, $$_PRO_FILE_PWD_))
}
qmlfiles2build.input = fq_qml_files
qmlfiles2build.output = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH/${QMAKE_FUNC_FILE_IN_qmlModStripSrcDir}
!contains(TEMPLATE, vc.*): qmlfiles2build.variable_out = PRE_TARGETDEPS
qmlfiles2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
qmlfiles2build.name = COPY ${QMAKE_FILE_IN}
qmlfiles2build.CONFIG = no_link no_clean
QMAKE_EXTRA_COMPILERS += qmlfiles2build
}
# Install rules
qmldir.base = $$_PRO_FILE_PWD_
qmldir.files = $$fq_qml_files
qmldir.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
INSTALLS += qmldir