summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/resources_functions.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/resources_functions.prf')
-rw-r--r--mkspecs/features/resources_functions.prf12
1 files changed, 9 insertions, 3 deletions
diff --git a/mkspecs/features/resources_functions.prf b/mkspecs/features/resources_functions.prf
index 9b7c409121..b525f482ca 100644
--- a/mkspecs/features/resources_functions.prf
+++ b/mkspecs/features/resources_functions.prf
@@ -35,10 +35,10 @@ defineTest(qtFlattenResources) {
}
RESOURCES -= $$resource
- !android|isEmpty(BUILDS)|build_pass {
+ isEmpty(BUILDS)|build_pass {
resource_file = $$absolute_path($$RCC_DIR/qmake_$${resource}.qrc, $$OUT_PWD)
RESOURCES += $$resource_file
- } else {
+ } else: android {
# Android will need a resource file for each architecture make sure it is placed
# correctly for other functions that need the right paths for these files
for (arch, ANDROID_ABIS) {
@@ -67,6 +67,12 @@ defineTest(qtFlattenResources) {
for (file, files) {
exists($$file/*): next() # exclude directories
alias = $$relative_path($$file, $$abs_base)
+
+ # If a resource is added by the build system from outside of $$_PRO_FILE_PWD_
+ # everything except the filename needs to be discarded.
+ subdir = $$find(alias, ^../)
+ if (!isEmpty(subdir)): alias = $$basename(file)
+
resource_file_content += \
"<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$file)</file>"
OTHER_FILES *= $$file
@@ -107,7 +113,7 @@ defineTest(qtEnsurePluginResourcesCpp) {
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" \
+ "// 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}() " \