summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r--qmake/generators/makefile.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index b701a11331..ac8bd8f9a7 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3334,6 +3334,13 @@ MakefileGenerator::writePkgConfigFile()
t << endl;
}
+static QString windowsifyPath(const QString &str)
+{
+ // The paths are escaped in prl files, so every slash needs to turn into two backslashes.
+ // Then each backslash needs to be escaped for sed. And another level for C quoting here.
+ return QString(str).replace('/', "\\\\\\\\");
+}
+
QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst)
{
QString ret;
@@ -3346,8 +3353,12 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt
for (int r = 0; r < replace_rules.size(); ++r) {
const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")),
replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
- if (!match.isEmpty() /*&& match != replace*/)
+ if (!match.isEmpty() /*&& match != replace*/) {
ret += " -e " + shellQuote("s," + match + "," + replace + ",g");
+ if (isWindowsShell() && project->first(ProKey(replace_rules.at(r) + ".CONFIG")).contains("path"))
+ ret += " -e " + shellQuote("s," + windowsifyPath(match.toQString())
+ + "," + windowsifyPath(replace.toQString()) + ",gi");
+ }
}
ret += " \"" + src + "\" >\"" + dst + "\"";
}