summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/qt.prf')
-rw-r--r--mkspecs/features/qt.prf25
1 files changed, 24 insertions, 1 deletions
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 443914e011..6b2833b09e 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -36,7 +36,30 @@ plugin { #Qt plugins
}
QT_PLUGIN_VERIFY = DEPLOYMENT_PLUGIN
-contains(QT_CONFIG, static): QT_PLUGIN_VERIFY += QTPLUGIN
+
+contains(QT_CONFIG, static) {
+ QT_PLUGIN_VERIFY += QTPLUGIN
+ contains(TEMPLATE, .*app) {
+ 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
+ write_file($$IMPORT_CPP, IMPORT_FILE_CONT)|error("Aborting.")
+ SOURCES += $$IMPORT_CPP
+ QMAKE_DISTCLEAN += $$IMPORT_CPP
+ }
+ }
+}
+
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