2012-02-24 18:21:51 +00:00
|
|
|
CONFIG *= thread
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#handle defines
|
|
|
|
win32 {
|
2016-08-05 11:35:39 +00:00
|
|
|
qtConfig(shared) {
|
2012-05-30 10:09:00 +00:00
|
|
|
# this variable is read by qmake in qmake/generators/win32/msvc_vcproj.cpp
|
2015-03-16 13:15:27 +00:00
|
|
|
# function VcprojGenerator::initDeploymentTool()
|
|
|
|
QMAKE_DLL_PATHS += $$[QT_INSTALL_BINS/get]
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG
|
2016-08-05 11:35:39 +00:00
|
|
|
qtConfig(force_asserts): DEFINES += QT_FORCE_ASSERTS
|
2011-04-27 10:05:43 +00:00
|
|
|
no_keywords:DEFINES += QT_NO_KEYWORDS
|
|
|
|
plugin { #Qt plugins
|
|
|
|
static:DEFINES += QT_STATICPLUGIN
|
|
|
|
DEFINES += QT_PLUGIN
|
|
|
|
}
|
|
|
|
|
2012-12-20 08:05:29 +00:00
|
|
|
qtestlib {
|
|
|
|
warning("CONFIG+=qtestlib is deprecated. Use QT+=testlib instead.")
|
|
|
|
QT += testlib
|
|
|
|
}
|
|
|
|
qdbus {
|
|
|
|
warning("CONFIG+=qdbus is deprecated. Use QT+=dbus instead.")
|
|
|
|
QT += dbus
|
|
|
|
}
|
|
|
|
help {
|
|
|
|
warning("CONFIG+=help is deprecated. Use QT+=help instead.")
|
|
|
|
QT += help-private # sic!
|
|
|
|
}
|
|
|
|
designer {
|
|
|
|
warning("CONFIG+=designer is deprecated. Use QT+=designer instead.")
|
|
|
|
QT += designer
|
|
|
|
}
|
|
|
|
uitools {
|
|
|
|
warning("CONFIG+=uitools is deprecated. Use QT+=uitools instead.")
|
|
|
|
QT += uitools
|
|
|
|
}
|
|
|
|
qaxcontainer {
|
|
|
|
warning("CONFIG+=qaxcontainer is deprecated. Use QT+=axcontainer instead.")
|
|
|
|
QT += axcontainer
|
|
|
|
}
|
|
|
|
qaxserver {
|
|
|
|
warning("CONFIG+=qaxserver is deprecated. Use QT+=axserver instead.")
|
|
|
|
QT += axserver
|
|
|
|
}
|
2012-12-10 13:56:29 +00:00
|
|
|
|
2015-06-05 17:01:50 +00:00
|
|
|
# target variable, flag source variable
|
|
|
|
defineTest(qtProcessModuleFlags) {
|
|
|
|
for(flag, $$2) {
|
|
|
|
contains(flag, ^-.*): \
|
|
|
|
$$1 -= $$replace(flag, ^-, )
|
|
|
|
else: \
|
|
|
|
$$1 += $$flag
|
|
|
|
}
|
|
|
|
export($$1)
|
|
|
|
}
|
|
|
|
|
2012-12-20 08:05:29 +00:00
|
|
|
unset(using_privates)
|
2015-06-05 17:01:50 +00:00
|
|
|
var_sfx =
|
|
|
|
for(ever) {
|
|
|
|
# qmake variables cannot contain dashes, so normalize the names first
|
|
|
|
CLEAN_QT$$var_sfx = $$replace(QT$$var_sfx, -private$, _private)
|
|
|
|
# Topological resolution of modules based on their QT.<module>.depends variable
|
|
|
|
FULL_QT$$var_sfx = $$resolve_depends(CLEAN_QT$$var_sfx, "QT.")
|
|
|
|
# Finally actually add the modules
|
|
|
|
unset(BAD_QT)
|
|
|
|
for(QTLIB, FULL_QT$$var_sfx) {
|
|
|
|
MODULE_NAME = $$eval(QT.$${QTLIB}.name)
|
2015-11-19 16:11:05 +00:00
|
|
|
MODULE_MODULE = $$eval(QT.$${QTLIB}.module)
|
2015-06-05 17:01:50 +00:00
|
|
|
MODULE_INCLUDES = $$eval(QT.$${QTLIB}.includes)
|
|
|
|
MODULE_LIBS = $$eval(QT.$${QTLIB}.libs)
|
2015-11-19 16:11:05 +00:00
|
|
|
MODULE_FRAMEWORKS = $$eval(QT.$${QTLIB}.frameworks)
|
2016-10-12 09:30:58 +00:00
|
|
|
MODULE_USES = $$eval(QT.$${QTLIB}.uses)
|
2015-06-05 17:01:50 +00:00
|
|
|
MODULE_CONFIG = $$eval(QT.$${QTLIB}.module_config)
|
|
|
|
|
|
|
|
isEmpty(MODULE_NAME) {
|
|
|
|
BAD_QT += $$QTLIB
|
|
|
|
next()
|
|
|
|
}
|
|
|
|
|
|
|
|
contains(MODULE_CONFIG, internal_module): \
|
|
|
|
using_privates = true
|
|
|
|
contains(MODULE_CONFIG, ltcg): \
|
|
|
|
CONFIG += link_ltcg
|
|
|
|
|
|
|
|
qtProcessModuleFlags(CONFIG, QT.$${QTLIB}.CONFIG)
|
|
|
|
qtProcessModuleFlags(DEFINES, QT.$${QTLIB}.DEFINES)
|
|
|
|
|
|
|
|
MODULE_INCLUDES -= $$QMAKE_DEFAULT_INCDIRS
|
|
|
|
MODULE_LIBS_ADD = $$MODULE_LIBS
|
|
|
|
MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS
|
|
|
|
|
2015-11-19 16:11:05 +00:00
|
|
|
!contains(MODULE_CONFIG, v2) {
|
|
|
|
# Backwards compatibility with pre-5.6 module .pri files
|
2015-06-05 17:01:50 +00:00
|
|
|
|
2015-11-19 16:11:05 +00:00
|
|
|
contains(MODULE_CONFIG, lib_bundle) {
|
|
|
|
MODULE_FRAMEWORKS = $$MODULE_LIBS
|
|
|
|
inc = $$MODULE_LIBS/$${MODULE_NAME}.framework/Headers
|
|
|
|
MODULE_INCLUDES = $$inc
|
|
|
|
contains(MODULE_CONFIG, internal_module): \
|
|
|
|
MODULE_INCLUDES += \
|
|
|
|
$$inc/$$eval(QT.$${QTLIB}.VERSION) \
|
|
|
|
$$inc/$$eval(QT.$${QTLIB}.VERSION)/$$MODULE_NAME
|
|
|
|
} else {
|
|
|
|
# Re-insert the major version in the library name (cf qt5LibraryTarget above)
|
2015-06-05 17:01:50 +00:00
|
|
|
MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
|
2015-11-19 16:11:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Only link to this module if a libs directory is set, else this is just a module
|
|
|
|
# to give access to sources or include files, and not for linking.
|
|
|
|
!isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link): \
|
|
|
|
MODULE_MODULE = $${MODULE_NAME}$${QT_LIBINFIX}
|
|
|
|
}
|
2015-06-05 17:01:50 +00:00
|
|
|
|
2015-11-19 16:11:05 +00:00
|
|
|
# Frameworks shouldn't need include paths, but much code does not use
|
|
|
|
# module-qualified #includes, so by default we add paths which point
|
|
|
|
# directly into the frameworks. Private modules have somewhat convoluted
|
|
|
|
# header paths, so adding them is necessary in every case.
|
|
|
|
!if(contains(MODULE_CONFIG, lib_bundle):qt_no_framework_direct_includes) \
|
|
|
|
|contains(MODULE_CONFIG, internal_module): \
|
|
|
|
INCLUDEPATH *= $$MODULE_INCLUDES
|
|
|
|
QMAKE_FRAMEWORKPATH *= $$MODULE_FRAMEWORKS
|
|
|
|
!isEmpty(MODULE_MODULE) {
|
|
|
|
contains(MODULE_CONFIG, lib_bundle) {
|
2016-02-15 18:41:20 +00:00
|
|
|
LIBS$$var_sfx += -framework $$MODULE_MODULE
|
2015-11-19 16:11:05 +00:00
|
|
|
} else {
|
2015-06-05 17:01:50 +00:00
|
|
|
!isEmpty(MODULE_LIBS_ADD): \
|
2015-11-19 16:11:05 +00:00
|
|
|
LIBS$$var_sfx += -L$$MODULE_LIBS_ADD
|
|
|
|
|
|
|
|
lib = $$MODULE_MODULE$$qtPlatformTargetSuffix()
|
|
|
|
LIBS$$var_sfx += -l$$lib
|
2015-06-05 17:01:50 +00:00
|
|
|
|
|
|
|
contains(MODULE_CONFIG, staticlib): \
|
|
|
|
PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
|
|
|
|
|
2015-11-19 16:11:05 +00:00
|
|
|
!isEmpty(QMAKE_LSB) {
|
|
|
|
!isEmpty(MODULE_LIBS_ADD): \
|
|
|
|
QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS_ADD
|
|
|
|
QMAKE_LFLAGS *= --lsb-shared-libs=$$lib
|
|
|
|
QMAKE_LIBDIR *= /opt/lsb/lib
|
|
|
|
}
|
2015-06-05 17:01:50 +00:00
|
|
|
}
|
|
|
|
}
|
2016-10-12 09:30:58 +00:00
|
|
|
QMAKE_USE$$var_sfx += $$MODULE_USES
|
2016-03-17 09:29:43 +00:00
|
|
|
# Add capabilities as defined by modules used in the project
|
|
|
|
winrt {
|
|
|
|
MODULE_WINRT_CAPABILITIES = $$eval(QT.$${QTLIB}.winrt_capabilities)
|
|
|
|
!isEmpty(MODULE_WINRT_CAPABILITIES): \
|
|
|
|
WINRT_MANIFEST.capabilities_default += $$MODULE_WINRT_CAPABILITIES
|
|
|
|
MODULE_WINRT_CAPABILITIES_DEVICE = $$eval(QT.$${QTLIB}.winrt_capabilities_device)
|
|
|
|
!isEmpty(MODULE_WINRT_CAPABILITIES_DEVICE): \
|
|
|
|
WINRT_MANIFEST.capabilities_device_default += $$MODULE_WINRT_CAPABILITIES_DEVICE
|
|
|
|
}
|
2015-06-05 17:01:50 +00:00
|
|
|
}
|
|
|
|
!isEmpty(BAD_QT):error("Unknown module(s) in QT$$var_sfx: $$replace(BAD_QT, _private$, -private)")
|
|
|
|
|
|
|
|
!isEmpty(var_sfx): break()
|
|
|
|
var_sfx = _PRIVATE
|
|
|
|
}
|
2016-07-08 17:02:59 +00:00
|
|
|
!isEmpty(using_privates):!no_private_qt_headers_warning:!build_pass {
|
2012-12-20 08:05:29 +00:00
|
|
|
message("This project is using private headers and will therefore be tied to this specific Qt module build version.")
|
|
|
|
message("Running this project against other versions of the Qt modules may crash at any arbitrary point.")
|
|
|
|
message("This is not a bug, but a result of using Qt internals. You have been warned!")
|
|
|
|
}
|
|
|
|
|
2015-06-05 17:01:50 +00:00
|
|
|
qt_module_deps = $$CLEAN_QT $$CLEAN_QT_PRIVATE
|
2013-11-04 11:08:43 +00:00
|
|
|
qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
|
2014-04-02 20:17:40 +00:00
|
|
|
|
2016-08-05 11:35:39 +00:00
|
|
|
!no_qt_rpath:!static:qtConfig(rpath):!qtConfig(static):\
|
2015-06-04 19:20:25 +00:00
|
|
|
contains(qt_module_deps, core) {
|
2015-11-12 08:48:03 +00:00
|
|
|
relative_qt_rpath:!isEmpty(QMAKE_REL_RPATH_BASE):contains(INSTALLS, target):\
|
2015-09-23 16:36:08 +00:00
|
|
|
isEmpty(target.files):isEmpty(target.commands):isEmpty(target.extra) {
|
2015-09-23 16:29:02 +00:00
|
|
|
# NOT the /dev property, as INSTALLS use host paths
|
2016-03-09 16:42:29 +00:00
|
|
|
QMAKE_RPATHDIR += $$relative_path($$[QT_INSTALL_LIBS], $$qtRelativeRPathBase())
|
2015-06-05 15:45:47 +00:00
|
|
|
} else {
|
|
|
|
QMAKE_RPATHDIR += $$[QT_INSTALL_LIBS/dev]
|
|
|
|
}
|
2015-06-04 19:20:25 +00:00
|
|
|
}
|
|
|
|
|
2016-08-05 11:35:39 +00:00
|
|
|
!isEmpty(QMAKE_LFLAGS_RPATHLINK):!qtConfig(static) {
|
2015-06-04 19:04:49 +00:00
|
|
|
# -rpath-link is used by the linker to find dependencies of dynamic
|
|
|
|
# libraries which were NOT specified on the command line.
|
|
|
|
# This means that paths of direct dependencies (QT & QT_PRIVATE)
|
|
|
|
# don't need to be listed, unlike their private dependencies' paths.
|
|
|
|
privdep = $$resolve_depends(qt_module_deps, "QT.", ".depends" ".run_depends")
|
|
|
|
privdep -= $$qt_module_deps
|
|
|
|
rpaths =
|
|
|
|
for(dep, privdep): \
|
|
|
|
rpaths += $$eval(QT.$${dep}.libs)
|
|
|
|
QMAKE_RPATHLINKDIR *= $$unique(rpaths)
|
|
|
|
}
|
|
|
|
|
2014-04-02 20:17:40 +00:00
|
|
|
# static builds: link qml import plugins into the app.
|
2013-11-04 11:08:43 +00:00
|
|
|
contains(qt_module_deps, qml): \
|
2016-08-05 11:35:39 +00:00
|
|
|
qtConfig(static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
|
2016-11-24 16:01:24 +00:00
|
|
|
exists($$[QT_INSTALL_QML/get]): \
|
|
|
|
QMLPATHS *= $$[QT_INSTALL_QML/get]
|
2014-06-02 09:40:36 +00:00
|
|
|
|
2013-09-10 14:25:32 +00:00
|
|
|
# run qmlimportscanner
|
2014-09-15 15:32:59 +00:00
|
|
|
qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner, , system)
|
2013-10-18 11:20:41 +00:00
|
|
|
for (QMLPATH, QMLPATHS): \
|
2016-08-24 15:35:59 +00:00
|
|
|
IMPORTPATHS += -importPath $$system_quote($$QMLPATH)
|
2013-10-18 11:20:41 +00:00
|
|
|
|
2014-09-15 15:32:59 +00:00
|
|
|
#message(run $$QMLIMPORTSCANNER $$_PRO_FILE_PWD_ $$IMPORTPATHS)
|
2016-08-24 15:35:59 +00:00
|
|
|
JSON = $$system($$QMLIMPORTSCANNER $$system_quote($$_PRO_FILE_PWD_) $$IMPORTPATHS)
|
2013-09-10 14:25:32 +00:00
|
|
|
|
|
|
|
parseJson(JSON, IMPORTS)| error("Failed to parse qmlimportscanner output.")
|
|
|
|
|
|
|
|
!isEmpty(IMPORTS._KEYS_) {
|
|
|
|
# add import plugins to LIBS line
|
2016-01-06 12:01:22 +00:00
|
|
|
for (key, IMPORTS._KEYS_) {
|
2013-09-10 14:25:32 +00:00
|
|
|
PATH = $$eval(IMPORTS.$${key}.path)
|
|
|
|
PLUGIN = $$eval(IMPORTS.$${key}.plugin)
|
2013-11-01 14:21:45 +00:00
|
|
|
!isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$${PLUGIN}$$qtPlatformTargetSuffix()
|
2013-09-10 14:25:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# create qml_plugin_import.cpp
|
|
|
|
IMPORT_FILE_CONT = \
|
|
|
|
"// This file is autogenerated by qmake. It imports static plugin classes for" \
|
|
|
|
"// static plugins used by QML imports." \
|
|
|
|
"$${LITERAL_HASH}include <QtPlugin>"
|
|
|
|
for (key, IMPORTS._KEYS_) {
|
|
|
|
PLUGIN = $$eval(IMPORTS.$${key}.plugin)
|
|
|
|
CLASSNAME = $$eval(IMPORTS.$${key}.classname)
|
|
|
|
!isEmpty(PLUGIN) {
|
|
|
|
!isEmpty(CLASSNAME) {
|
|
|
|
!contains(ADDED_IMPORTS, $$PLUGIN) {
|
|
|
|
ADDED_IMPORTS += $$PLUGIN
|
|
|
|
IMPORT_FILE_CONT += "Q_IMPORT_PLUGIN($$CLASSNAME)"
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
error("Plugin $$PLUGIN is missing a classname entry, please add one to the qmldir file.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
QML_IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_qml_plugin_import.cpp
|
2016-07-14 14:50:02 +00:00
|
|
|
write_file($$QML_IMPORT_CPP, IMPORT_FILE_CONT)|error()
|
2015-11-04 13:41:05 +00:00
|
|
|
GENERATED_SOURCES += $$QML_IMPORT_CPP
|
2014-06-25 08:44:54 +00:00
|
|
|
QMAKE_DISTCLEAN += $$QML_IMPORT_CPP
|
2013-09-10 14:25:32 +00:00
|
|
|
|
|
|
|
# copy qml files. this part is platform spesific.
|
2013-10-22 10:56:14 +00:00
|
|
|
mac {
|
|
|
|
osx {
|
|
|
|
# Note: user can override QMAKE_BUNDLE_QML from pro file to change target bundle path
|
|
|
|
isEmpty(QMAKE_QML_BUNDLE_PATH):QMAKE_QML_BUNDLE_PATH = "Resources/qt_qml"
|
|
|
|
qmlTargetPath = $$OUT_PWD/$${TARGET}.app/Contents/$$QMAKE_QML_BUNDLE_PATH
|
|
|
|
qtconfTargetPath = $$OUT_PWD/$${TARGET}.app/Contents/Resources/qt.conf
|
|
|
|
} else {
|
|
|
|
# iOS: flat bundle layout (no Contents/Resources)
|
|
|
|
isEmpty(QMAKE_QML_BUNDLE_PATH):QMAKE_QML_BUNDLE_PATH = "qt_qml"
|
|
|
|
qmlTargetPath = $CODESIGNING_FOLDER_PATH/$$QMAKE_QML_BUNDLE_PATH
|
|
|
|
qtconfTargetPath = $CODESIGNING_FOLDER_PATH/qt.conf
|
|
|
|
}
|
2013-09-10 14:25:32 +00:00
|
|
|
|
2013-10-22 10:56:14 +00:00
|
|
|
# set import path in qt.conf to point to the bundeled qml:
|
2013-09-10 14:25:32 +00:00
|
|
|
QT_CONF_CONTENTS = \
|
|
|
|
"[Paths]" \
|
2013-10-22 10:56:14 +00:00
|
|
|
"Imports = $$QMAKE_QML_BUNDLE_PATH" \
|
|
|
|
"Qml2Imports = $$QMAKE_QML_BUNDLE_PATH"
|
2016-07-14 14:50:02 +00:00
|
|
|
write_file("$$OUT_PWD/qt.conf", QT_CONF_CONTENTS)|error()
|
2013-09-10 14:25:32 +00:00
|
|
|
|
2013-10-22 10:56:14 +00:00
|
|
|
# write qt.conf and copy each qml import dir into the bundle.
|
|
|
|
# But strip away archives and other files that are not needed:
|
|
|
|
!isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK += ";"
|
|
|
|
QMAKE_POST_LINK += \
|
2016-08-24 15:35:59 +00:00
|
|
|
"cp $$shell_quote($$OUT_PWD/qt.conf) \"$$qtconfTargetPath\"; " \
|
|
|
|
"test -d \"$$qmlTargetPath\" && rm -r \"$$qmlTargetPath\"; " \
|
|
|
|
"mkdir -p \"$$qmlTargetPath\" && " \
|
2013-10-22 10:56:14 +00:00
|
|
|
"for p in $$QMLPATHS; do" \
|
|
|
|
"rsync -r --exclude='*.a' --exclude='*.prl' --exclude='*.qmltypes' "
|
2016-08-24 15:35:59 +00:00
|
|
|
macx-xcode: QMAKE_POST_LINK += "$p/ \"$$qmlTargetPath\"; done"
|
|
|
|
else: QMAKE_POST_LINK += "\$\$p/ \"$$qmlTargetPath\"; done"
|
2013-09-10 14:25:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-16 19:18:27 +00:00
|
|
|
!import_qpa_plugin {
|
|
|
|
warning("CONFIG-=import_qpa_plugin is deprecated. Use QTPLUGIN.platforms=- instead.")
|
|
|
|
QTPLUGIN.platforms = -
|
|
|
|
} else: qpa_minimal_plugin {
|
|
|
|
warning("CONFIG+=qpa_minimal_plugin is deprecated. Use QTPLUGIN.platforms=qminimal instead.")
|
|
|
|
QTPLUGIN.platforms = qminimal
|
|
|
|
}
|
|
|
|
|
2014-04-02 20:17:40 +00:00
|
|
|
contains(TEMPLATE, .*app) {
|
|
|
|
autoplugs =
|
|
|
|
for (qtmod, qt_module_deps) {
|
|
|
|
for (ptype, QT.$${qtmod}.plugin_types) {
|
2016-10-10 15:59:19 +00:00
|
|
|
nptype = $$replace(ptype, [-/], _)
|
|
|
|
isEmpty(QTPLUGIN.$$nptype) {
|
2014-04-02 20:17:40 +00:00
|
|
|
for (plug, QT_PLUGINS) {
|
|
|
|
equals(QT_PLUGIN.$${plug}.TYPE, $$ptype) {
|
|
|
|
for (dep, QT_PLUGIN.$${plug}.EXTENDS) {
|
|
|
|
!contains(qt_module_deps, $$dep) {
|
|
|
|
plug =
|
|
|
|
break()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
autoplugs += $$plug
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2016-10-10 15:59:19 +00:00
|
|
|
plug = $$eval(QTPLUGIN.$$nptype)
|
2014-04-02 20:17:40 +00:00
|
|
|
!equals(plug, -): \
|
|
|
|
autoplugs += $$plug
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
manualplugs = $$QTPLUGIN
|
|
|
|
manualplugs -= $$autoplugs
|
|
|
|
QTPLUGIN -= $$manualplugs
|
|
|
|
!isEmpty(QTPLUGIN): \
|
|
|
|
warning("Redundant entries in QTPLUGIN: $$QTPLUGIN")
|
|
|
|
QTPLUGIN = $$manualplugs $$autoplugs
|
|
|
|
}
|
|
|
|
|
2012-12-20 08:05:29 +00:00
|
|
|
QT_PLUGIN_VERIFY = DEPLOYMENT_PLUGIN
|
2016-08-05 11:35:39 +00:00
|
|
|
qtConfig(static) {
|
2012-12-10 13:56:29 +00:00
|
|
|
QT_PLUGIN_VERIFY += QTPLUGIN
|
2012-12-20 08:05:29 +00:00
|
|
|
force_import_plugins|contains(TEMPLATE, .*app) {
|
2012-12-10 13:56:29 +00:00
|
|
|
import_plugins:!isEmpty(QTPLUGIN) {
|
|
|
|
IMPORT_FILE_CONT = \
|
|
|
|
"// This file is autogenerated by qmake. It imports static plugin classes for" \
|
|
|
|
"// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables." \
|
|
|
|
"$${LITERAL_HASH}include <QtPlugin>"
|
|
|
|
for(IMPORT_PLUG, $$list($$unique(QTPLUGIN))) {
|
|
|
|
PLUG_CLASS = $$eval(QT_PLUGIN.$${IMPORT_PLUG}.CLASS_NAME)
|
|
|
|
!isEmpty(PLUG_CLASS): \
|
|
|
|
IMPORT_FILE_CONT += "Q_IMPORT_PLUGIN($$PLUG_CLASS)"
|
|
|
|
else: \
|
|
|
|
warning("Plugin class name could not be determined for $$IMPORT_PLUG plugin.")
|
|
|
|
}
|
|
|
|
IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_plugin_import.cpp
|
2016-07-14 14:50:02 +00:00
|
|
|
write_file($$IMPORT_CPP, IMPORT_FILE_CONT)|error()
|
2015-11-04 13:41:05 +00:00
|
|
|
GENERATED_SOURCES += $$IMPORT_CPP
|
2012-12-10 13:56:29 +00:00
|
|
|
QMAKE_DISTCLEAN += $$IMPORT_CPP
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
|
|
|
|
for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {
|
|
|
|
# Check if the plugin is known to Qt. We can use this to determine
|
|
|
|
# the plugin path. Unknown plugins must rely on the default link path.
|
2012-10-24 13:02:08 +00:00
|
|
|
QT_PLUGINPATH = $$eval(QT_PLUGIN.$${QTPLUG}.TYPE)
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
# Generate the plugin linker line
|
2015-11-10 19:39:25 +00:00
|
|
|
QT_LINKAGE = -l$${QTPLUG}$$qtPlatformTargetSuffix()
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
# Only link against plugin in static builds
|
2016-01-06 12:01:22 +00:00
|
|
|
isEqual(QT_CURRENT_VERIFY, QTPLUGIN) {
|
2014-04-04 14:49:26 +00:00
|
|
|
!isEmpty(QT_PLUGINPATH) {
|
|
|
|
plugpath = $$eval(QT_PLUGIN.$${QTPLUG}.PATH)
|
|
|
|
isEmpty(plugpath): \
|
|
|
|
plugpath = $$[QT_INSTALL_PLUGINS/get]
|
|
|
|
LIBS *= -L$$plugpath/$$QT_PLUGINPATH
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
LIBS += $$QT_LINKAGE
|
|
|
|
# if the plugin is linked statically there is no need to deploy it
|
|
|
|
DEPLOYMENT_PLUGIN -= $$QT_CURRENT_VERIFY
|
|
|
|
}
|
2015-06-19 10:26:48 +00:00
|
|
|
|
|
|
|
# The following block is currently broken, because qt_plugin_XXX.prf files
|
|
|
|
# are not generated for dynamic builds.
|
2016-03-09 13:59:20 +00:00
|
|
|
false:isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:winrt {
|
2011-04-27 10:05:43 +00:00
|
|
|
QT_ITEM =
|
2013-02-15 17:15:22 +00:00
|
|
|
debug: QT_ITEM = $${QTPLUG}d4.dll
|
2011-04-27 10:05:43 +00:00
|
|
|
else: QT_ITEM = $${QTPLUG}4.dll
|
|
|
|
|
2015-06-01 15:06:20 +00:00
|
|
|
qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS/get]/$${QT_PLUGINPATH}/$${QT_ITEM}
|
|
|
|
qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2015-05-26 15:32:47 +00:00
|
|
|
INSTALLS *= qt_additional_plugin_$${QTPLUG}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|