diff options
Diffstat (limited to 'qmake/generators/symbian/symmake.cpp')
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 8bf2176..bdba329 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -574,7 +574,30 @@ void SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) void SymbianMakefileGenerator::addMacro(QTextStream& t, const QString& value) { - t << "MACRO\t\t" << value << endl; + // String macros for Makefile based platforms are defined like this in pro files: + // + // DEFINES += VERSION_STRING=\\\"1.2.3\\\" + // + // This will not work in *.mmp files, which don't need double escaping, and + // will therefore result in a VERSION_STRING value of \"1.2.3\" instead of "1.2.3". + // Improve cross platform support by removing one level of escaping from all + // DEFINES values. + static QChar backslash = QLatin1Char('\\'); + QString fixedValue; + fixedValue.reserve(value.size()); + int pos = 0; + int prevPos = 0; + while (pos < value.size()) { + if (value.at(pos) == backslash) { + fixedValue += value.mid(prevPos, pos - prevPos); + pos++; + prevPos = pos; + } + pos++; + } + fixedValue += value.mid(prevPos); + + t << "MACRO\t\t" << fixedValue << endl; } |