summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkspecs/features/qt_module.prf2
-rw-r--r--qmake/generators/makefile.cpp13
-rw-r--r--src/winmain/winmain.pro1
3 files changed, 15 insertions, 1 deletions
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 5068f7028f..84882ccbc2 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -146,8 +146,10 @@ unix|win32-g++* {
rplbase = $$MODULE_BASE_OUTDIR
include_replace.match = $$rplbase/include
include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
+ include_replace.CONFIG = path
lib_replace.match = $$rplbase/lib
lib_replace.replace = $$QMAKE_PKGCONFIG_LIBDIR
+ lib_replace.CONFIG = path
QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace
QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
}
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index d88c6e447a..d40c065ed4 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3336,6 +3336,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;
@@ -3348,8 +3355,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 + "\"";
}
diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro
index 4303c3bc12..62f8b3a6f2 100644
--- a/src/winmain/winmain.pro
+++ b/src/winmain/winmain.pro
@@ -34,5 +34,6 @@ wince*:QMAKE_POST_LINK =
unix|win32-g++* {
lib_replace.match = $$[QT_INSTALL_LIBS/get]
lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
+ lib_replace.CONFIG = path
QMAKE_PRL_INSTALL_REPLACE += lib_replace
}