summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/resources.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/resources.prf')
-rw-r--r--mkspecs/features/resources.prf35
1 files changed, 1 insertions, 34 deletions
diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf
index 6d9f27b86b..151051163d 100644
--- a/mkspecs/features/resources.prf
+++ b/mkspecs/features/resources.prf
@@ -1,6 +1,5 @@
qtPrepareTool(QMAKE_RCC, rcc, _DEP)
-isEmpty(RCC_DIR):RCC_DIR = .
isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc
!contains(QMAKE_RESOURCE_FLAGS, -root):!isEmpty(QMAKE_RESOURCE_ROOT):QMAKE_RESOURCE_FLAGS += -root $$QMAKE_RESOURCE_ROOT
@@ -8,39 +7,7 @@ isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc
load(resources_functions)
qtFlattenResources()
-
-!isEmpty(RESOURCES):contains(TEMPLATE, .*lib):plugin:static {
- pluginBaseName = $$basename(TARGET)
- pluginName = $$lower($$replace(pluginBaseName, [-], _))
- resource_init_function = $${pluginName}_plugin_resource_init
- DEFINES += "QT_PLUGIN_RESOURCE_INIT_FUNCTION=$$resource_init_function"
- RESOURCE_INIT_CPP = $$OUT_PWD/$${pluginName}_plugin_resources.cpp
-
- GENERATED_SOURCES += $$RESOURCE_INIT_CPP
- QMAKE_DISTCLEAN += $$RESOURCE_INIT_CPP
-
- isEmpty(BUILDS)|build_pass {
- RESOURCE_INIT_CONT = \
- "// This file is autogenerated by qmake. It contains a function that" \
- "// references all resources the plugin includes and the function is" \
- "// referenced by Qt_(MOC_)EXPORT_PLUGIN to ensure the inclusion in" \
- "// the statically linked plugin." \
- "$${LITERAL_HASH}include <QtCore/qglobal.h>" \
- "void $${resource_init_function}() " \
- "{" \
-
- for (resource, RESOURCES) {
- resource_name = $$replace($$list($$basename(resource)),\.qrc$, )
- resource_name = $$replace(resource_name, [^a-zA-Z0-9_], _)
- RESOURCE_INIT_CONT += " Q_INIT_RESOURCE($$resource_name);"
- }
-
- RESOURCE_INIT_CONT += \
- "}"
-
- write_file($$RESOURCE_INIT_CPP, RESOURCE_INIT_CONT)|error()
- }
-}
+qtEnsurePluginResourcesCpp()
rcc.input = RESOURCES
rcc.name = RCC ${QMAKE_FILE_IN}