From 923d498029be406a684f8953afc68f10c07e2789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 26 Nov 2013 14:48:02 +0100 Subject: Add PBXCopyFilesBuildPhases to main target, not preprocessing step Otherwise the 'Wrapper' destination of the PBXCopyFilesBuildPhase will be empty, and the files end up outside of the application bundle. Task-number: QTBUG-34457 Change-Id: I799db28185a6c5d3d940602914fd8ba14c538bf2 Reviewed-by: Caroline Chao Reviewed-by: Richard Moe Gustavsen --- qmake/generators/mac/pbuilder_pbx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 5ea1ff14b9..e50df932e5 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1140,7 +1140,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) //### } - project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES").append(phase_key); + project->values("QMAKE_PBX_BUILDPHASES").append(phase_key); t << "\t\t" << phase_key << " = {\n" << "\t\t\t" << writeSettings("name", "Copy '" + bundle_data[i] + "' Files to Bundle") << ";\n" << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n" -- cgit v1.2.3 From 39baff5847e23cbfdc86055b98dcced55342908a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 20 Nov 2013 14:12:15 +0100 Subject: support s///i option in built-in sed Change-Id: I7521699a9b833c8b1d640a843b82f213952bba5a Reviewed-by: Joerg Bornemann --- qmake/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/main.cpp b/qmake/main.cpp index 79e3739f56..f5116ba752 100644 --- a/qmake/main.cpp +++ b/qmake/main.cpp @@ -85,6 +85,7 @@ static int doSed(int argc, char **argv) return 3; } QChar sep = ++j < cmd.length() ? cmd.at(j) : QChar(); + Qt::CaseSensitivity matchcase = Qt::CaseSensitive; bool escaped = false; int phase = 1; QStringList phases; @@ -126,12 +127,16 @@ static int doSed(int argc, char **argv) fprintf(stderr, "Error: sed s command requires three arguments (%d, %c, %s)\n", phase, sep.toLatin1(), qPrintable(curr)); return 3; } + if (curr.contains(QLatin1Char('i'))) { + curr.remove(QLatin1Char('i')); + matchcase = Qt::CaseInsensitive; + } if (curr != QLatin1String("g")) { - fprintf(stderr, "Error: sed s command must be used with the g option (only)\n"); + fprintf(stderr, "Error: sed s command supports only g & i options; g is required\n"); return 3; } SedSubst subst; - subst.from = QRegExp(phases.at(0)); + subst.from = QRegExp(phases.at(0), matchcase); subst.to = phases.at(1); subst.to.replace("\\\\", "\\"); // QString::replace(rx, sub) groks \1, but not \\. substs << subst; -- cgit v1.2.3 From 53f48a4ba2a527735fd67968a211052a8eda00dc Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 20 Nov 2013 15:14:52 +0100 Subject: properly replace windows paths in installed meta files it's bogus in the first place that the meta files contain windows paths, but straightening that out is a prohibitive effort. so instead generate additional s/// commands which take care of these paths. fwiw, the generated s///i command is a gnu extension. but as we are doing this on windows only where we are using our built-in sed command anyway, this should be fine. Task-number: QTBUG-33794 Change-Id: I46fcc598db12816ee56b5371ab184f6277eb3a22 Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'qmake') 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 + "\""; } -- cgit v1.2.3