summaryrefslogtreecommitdiffstats
path: root/qmake/generators/unix/unixmake.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-09-29 20:06:05 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-10-20 17:18:16 +0000
commit2d8801a9622ca47e377dfb7e1cb73f1809c764ed (patch)
tree8cde178b850fb09fcddb5809ac8af4dcd41bf8e9 /qmake/generators/unix/unixmake.cpp
parentbf929938293abd398c2c6f3e88c4774e56f75efa (diff)
support relative paths in QMAKE_RPATHDIR
... and make use of it in qt.prf. [ChangeLog][qmake][Unix] Added support for relative paths in QMAKE_RPATHDIR. Note that this technically breaks backwards compatibility, as relative paths were previously silently resolved against $$_PRO_FILE_PWD_. This was not documented and seems rather useless, so i'm not worried. Change-Id: I855042a8962ab34ad4617899a5b9825af0087f8a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'qmake/generators/unix/unixmake.cpp')
-rw-r--r--qmake/generators/unix/unixmake.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 1d9ebb35e3..57c0a97228 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -125,10 +125,23 @@ UnixMakefileGenerator::init()
const ProStringList &rpathdirs = project->values("QMAKE_RPATHDIR");
for (int i = 0; i < rpathdirs.size(); ++i) {
QString rpathdir = rpathdirs[i].toQString();
- if (rpathdir.length() > 1 && rpathdir.at(0) == '$' && rpathdir.at(1) != '(')
+ if (rpathdir.length() > 1 && rpathdir.at(0) == '$' && rpathdir.at(1) != '(') {
rpathdir.replace(0, 1, "\\$$"); // Escape from make and the shell
- else if (!rpathdir.startsWith('@'))
- rpathdir = QFileInfo(rpathdir).absoluteFilePath();
+ } else if (!rpathdir.startsWith('@') && fileInfo(rpathdir).isRelative()) {
+ QString rpathbase = project->first("QMAKE_REL_RPATH_BASE").toQString();
+ if (rpathbase.isEmpty()) {
+ fprintf(stderr, "Error: This platform does not support relative paths in QMAKE_RPATHDIR (%s)\n",
+ rpathdir.toLatin1().constData());
+ continue;
+ }
+ if (rpathbase.startsWith('$'))
+ rpathbase.replace(0, 1, "\\$$"); // Escape from make and the shell
+ if (rpathdir == ".")
+ rpathdir = rpathbase;
+ else
+ rpathdir.prepend(rpathbase + '/');
+ project->values("QMAKE_LFLAGS").insertUnique(project->values("QMAKE_LFLAGS_REL_RPATH"));
+ }
project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + escapeFilePath(rpathdir);
}
}