2012-12-11 21:08:15 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
|
2012-07-09 17:17:00 +00:00
|
|
|
load(qt_build_config)
|
|
|
|
|
|
|
|
TEMPLATE = lib
|
|
|
|
CONFIG += plugin
|
|
|
|
|
2012-10-16 09:51:29 +00:00
|
|
|
if(win32|mac):!macx-xcode {
|
2016-08-05 11:35:39 +00:00
|
|
|
qtConfig(debug_and_release): CONFIG += debug_and_release
|
|
|
|
qtConfig(build_all): CONFIG += build_all
|
2012-10-16 09:51:29 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 14:26:30 +00:00
|
|
|
CONFIG += relative_qt_rpath # Qt's QML plugins should be relocatable
|
|
|
|
|
2013-03-01 18:05:15 +00:00
|
|
|
!no_cxx_module:isEmpty(CXX_MODULE) {
|
2012-07-09 17:17:00 +00:00
|
|
|
CXX_MODULE = $$TARGET
|
|
|
|
TARGET = declarative_$${TARGET}
|
|
|
|
}
|
|
|
|
isEmpty(TARGETPATH): TARGETPATH = $$eval(QT.$${CXX_MODULE}.name)
|
|
|
|
|
2016-04-04 16:36:53 +00:00
|
|
|
win32:CONFIG(shared, static|shared) {
|
2015-06-04 13:57:50 +00:00
|
|
|
# Embed a VERSIONINFO resource into the plugin's DLL.
|
|
|
|
isEmpty(VERSION): VERSION = $$MODULE_VERSION
|
|
|
|
CONFIG += skip_target_version_ext
|
|
|
|
}
|
|
|
|
|
2013-09-02 07:50:19 +00:00
|
|
|
# Insert the plugins URI into its meta data to enable usage
|
|
|
|
# of static plugins in QtDeclarative:
|
|
|
|
URI = $$replace(TARGETPATH, "/", ".")
|
|
|
|
QMAKE_MOC_OPTIONS += -Muri=$$URI
|
|
|
|
|
2012-07-09 17:17:00 +00:00
|
|
|
QMLTYPEFILE = $$_PRO_FILE_PWD_/plugins.qmltypes
|
2016-08-10 20:58:43 +00:00
|
|
|
exists($$QMLTYPEFILE): AUX_QML_FILES += $$QMLTYPEFILE
|
2012-07-09 17:17:00 +00:00
|
|
|
|
|
|
|
# Install rules
|
|
|
|
|
2013-03-01 18:05:15 +00:00
|
|
|
load(qt_build_paths)
|
|
|
|
|
2012-10-15 20:23:13 +00:00
|
|
|
qml1_target {
|
2013-03-01 18:05:15 +00:00
|
|
|
DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH
|
2012-10-26 13:26:34 +00:00
|
|
|
instbase = $$[QT_INSTALL_IMPORTS]
|
2012-10-15 20:23:13 +00:00
|
|
|
} else {
|
2013-03-01 18:05:15 +00:00
|
|
|
DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
|
2012-10-15 20:23:13 +00:00
|
|
|
instbase = $$[QT_INSTALL_QML]
|
|
|
|
}
|
2012-10-26 13:26:34 +00:00
|
|
|
|
|
|
|
target.path = $$instbase/$$TARGETPATH
|
2012-08-06 18:39:49 +00:00
|
|
|
INSTALLS += target
|
2012-07-09 17:17:00 +00:00
|
|
|
|
|
|
|
# Some final setup
|
|
|
|
|
2015-02-25 15:00:58 +00:00
|
|
|
TARGET = $$qt5LibraryTarget($$TARGET)
|
2012-07-09 17:17:00 +00:00
|
|
|
|
|
|
|
load(qt_targets)
|
2013-01-24 22:54:08 +00:00
|
|
|
load(qt_common)
|
2012-08-06 14:43:43 +00:00
|
|
|
|
|
|
|
# plugins.qmltypes is used by Qt Creator for syntax highlighting and the QML code model. It needs
|
|
|
|
# to be regenerated whenever the QML elements exported by the plugin change. This cannot be done
|
|
|
|
# automatically at compile time because qmlplugindump does not support some QML features and it may
|
|
|
|
# not be possible when cross-compiling.
|
|
|
|
#
|
|
|
|
# To regenerate run 'make qmltypes' which will update the plugins.qmltypes file in the source
|
|
|
|
# directory. Then review and commit the changes made to plugins.qmltypes.
|
|
|
|
#
|
|
|
|
!cross_compile {
|
2016-08-14 16:05:59 +00:00
|
|
|
qml1_target {
|
|
|
|
qmlplugindump = qml1plugindump
|
|
|
|
importpath.name = QML_IMPORT_PATH
|
|
|
|
} else {
|
|
|
|
qmlplugindump = qmlplugindump
|
|
|
|
importpath.name = QML2_IMPORT_PATH
|
|
|
|
}
|
|
|
|
importpath.value =
|
|
|
|
for(qmod, QTREPOS) {
|
|
|
|
qml1_target: \
|
|
|
|
qmod = $$qmod/imports
|
|
|
|
else: \
|
|
|
|
qmod = $$qmod/qml
|
|
|
|
exists($$qmod): importpath.value += $$shell_path($$qmod)
|
|
|
|
}
|
|
|
|
importpath.value = $$unique(importpath.value)
|
|
|
|
QT_TOOL_ENV = importpath
|
|
|
|
qtPrepareTool(QMLPLUGINDUMP, $$qmlplugindump)
|
|
|
|
QT_TOOL_ENV =
|
|
|
|
|
|
|
|
# qtPrepareTool() must be called outside a build pass, as it protects
|
|
|
|
# against concurrent wrapper creation by omitting it during build passes.
|
|
|
|
# However, creating the actual targets is reserved to the build passes.
|
2012-10-23 14:46:32 +00:00
|
|
|
build_pass|!debug_and_release {
|
2013-03-01 18:05:15 +00:00
|
|
|
isEmpty(IMPORT_VERSION) {
|
|
|
|
no_cxx_module {
|
|
|
|
IMPORT_VERSION = $$replace(MODULE_VERSION, ^(\\d+\\.\\d+).*, \\1)
|
|
|
|
isEmpty(IMPORT_VERSION): error("Must set IMPORT_VERSION")
|
|
|
|
} else {
|
|
|
|
IMPORT_VERSION = $$eval(QT.$${CXX_MODULE}.MAJOR_VERSION).$$eval(QT.$${CXX_MODULE}.MINOR_VERSION)
|
|
|
|
}
|
|
|
|
}
|
2012-10-23 14:46:32 +00:00
|
|
|
|
|
|
|
load(resolve_target)
|
2012-10-23 18:10:25 +00:00
|
|
|
TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, )
|
2012-10-23 14:46:32 +00:00
|
|
|
qmltypes.target = qmltypes
|
2013-05-13 16:34:08 +00:00
|
|
|
qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE
|
2012-10-23 14:46:32 +00:00
|
|
|
qmltypes.depends = $$QMAKE_RESOLVED_TARGET
|
|
|
|
} else {
|
|
|
|
qmltypes.CONFIG += recursive
|
|
|
|
}
|
2012-08-06 14:43:43 +00:00
|
|
|
QMAKE_EXTRA_TARGETS += qmltypes
|
|
|
|
}
|
2012-08-06 18:39:49 +00:00
|
|
|
|
|
|
|
load(qml_module)
|