diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-01-15 12:02:16 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-01-18 13:48:23 +0000 |
commit | b772d9cbd786a2180f8ead923a04b537c8904ddd (patch) | |
tree | 9ace846b0c65baa71d7d191298d4f709556551b2 /mkspecs/features | |
parent | e86f3c018833141776db2d15772ba53995656eac (diff) |
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>
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/qt_example_installs.prf | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf index 668669e4cd..c9ce926b1a 100644 --- a/mkspecs/features/qt_example_installs.prf +++ b/mkspecs/features/qt_example_installs.prf @@ -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 += \ |