fix example source installation of qrc/rc files in subdirs

such a project structure violates the assumption that the referenced
resources are specified relative to the sub-project root, so we must
resolve them to absolute paths manually.

Task-number: QTBUG-65753
Change-Id: I8bcd5c6e7d7c6a713e5fcd3668be7d2f23169501
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Oswald Buddenhagen 2018-01-15 12:02:16 +01:00
parent e86f3c0188
commit b772d9cbd7

View File

@ -44,19 +44,25 @@ contains(TEMPLATE, .*app): \
for(ex, EXAMPLE_FILES): \
sourcefiles += $$files($$absolute_path($$ex, $$_PRO_FILE_PWD_))
for(res, RESOURCES) {
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
for(rline, rfile) {
!contains(res, \\.qrc$): \
next()
rfile = $$absolute_path($$res, $$_PRO_FILE_PWD_)
rpath = $$dirname(rfile)
rcont = $$cat($$rfile, lines)
for (rline, rcont) {
resrc = $$replace(rline, ^[ \\t]*<file[^>]*>([^<]+)</file>[ \\t]*$, \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
sourcefiles += $$absolute_path($$resrc, $$rpath)
}
}
for(res, RC_FILE) {
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
for(rline, rfile) {
rfile = $$absolute_path($$res, $$_PRO_FILE_PWD_)
rpath = $$dirname(rfile)
rcont = $$cat($$rfile, lines)
for (rline, rcont) {
resrc = $$replace(rline, "^\\d+\\s+ICON\\s+[^\"]*\"([^\"]+)\"\$", \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
sourcefiles += $$absolute_path($$resrc, $$rpath)
}
}
sourcefiles += \