factor qml_module out of qml_plugin

this makes it comfortable to create qml-only modules

Change-Id: I17a5a3ee24210b93db05e50502c6ca91a4e7a9d8
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
Oswald Buddenhagen 2012-08-06 20:39:49 +02:00 committed by Qt by Nokia
parent 8e134b63bc
commit 842b1bd29e
2 changed files with 32 additions and 27 deletions

View File

@ -0,0 +1,28 @@
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
qmlfiles2build.input = fq_qml_files
qmlfiles2build.output = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
!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.files = $$fq_qml_files
qmldir.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
INSTALLS += qmldir

View File

@ -10,38 +10,13 @@ isEmpty(CXX_MODULE) {
isEmpty(TARGETPATH): TARGETPATH = $$eval(QT.$${CXX_MODULE}.name)
DESTDIR = $$eval(QT.$${CXX_MODULE}.imports)/$$TARGETPATH
QMLDIRFILE = $$_PRO_FILE_PWD_/qmldir
fq_qml_files = $$QMLDIRFILE
QMLTYPEFILE = $$_PRO_FILE_PWD_/plugins.qmltypes
exists($$QMLTYPEFILE): fq_qml_files += $$QMLTYPEFILE
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
qmlfiles2build.input = fq_qml_files
qmlfiles2build.output = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
!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
}
exists($$QMLTYPEFILE): QML_FILES += $$QMLTYPEFILE
# Install rules
target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
qmldir.files = $$fq_qml_files
qmldir.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
INSTALLS += target qmldir
INSTALLS += target
# Some final setup
@ -68,3 +43,5 @@ load(qt_targets)
qmltypes.depends = $$QMAKE_RESOLVED_TARGET
QMAKE_EXTRA_TARGETS += qmltypes
}
load(qml_module)