qt5base-lts/mkspecs/features/qml_module.prf
Thiago Macieira df3631045c Add a new location for QML 2.x imports
This commits adds a -qmldir configuration option for the configures to
allow the user to change the default location (it defaults to
$archdatadir/qml).

It adds a QLibraryInfo::Qml2ImportsPath value for
QLibraryInfo::location, a qmake property of QT_INSTALL_QML and a qt.conf
configure location entry "Qml2Imports".

At the same time, it makes the qmake .prf files dealing with QML plugins
be the QML 2 version. Those files are new in Qt 5, so we have the option
to choose which version we want to use.

Discussed-on: http://lists.qt-project.org/pipermail/development/2012-October/007136.html
Change-Id: I8c1c53e8685a5934ed0a9a42ba5663297b81a677
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-11-19 15:25:54 +01:00

39 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
qml1_target: \
instbase = $$[QT_INSTALL_IMPORTS]
else: \
instbase = $$[QT_INSTALL_QML]
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 = $$instbase/$$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 = $$instbase/$$TARGETPATH
INSTALLS += qmldir