Skip to content

Commit

Permalink
fix example source installation of qrc/rc files in subdirs
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ossilator committed Jan 18, 2018
1 parent e86f3c0 commit b772d9c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions mkspecs/features/qt_example_installs.prf
Original file line number Diff line number Diff line change
Expand Up @@ -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 += \
Expand Down

0 comments on commit b772d9c

Please sign in to comment.