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.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 9ebaf60843..d88c6e447a 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -43,6 +43,9 @@
#include "option.h"
#include "cachekeys.h"
#include "meta.h"
+
+#include <ioutils.h>
+
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
@@ -52,6 +55,7 @@
#include <qbuffer.h>
#include <qsettings.h>
#include <qdatetime.h>
+
#if defined(Q_OS_UNIX)
#include <unistd.h>
#else
@@ -92,7 +96,7 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const
QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const
{
- QString edir = escape ? escapeFilePath(dir) : dir;
+ QString edir = escape ? escapeFilePath(Option::fixPathToTargetOS(dir, false, false)) : dir;
return "@" + makedir.arg(edir);
}
@@ -2261,7 +2265,7 @@ QString MakefileGenerator::buildArgs()
{
QString ret;
- foreach (const QString &arg, Option::qmake_args)
+ foreach (const QString &arg, Option::globals->qmake_args)
ret += " " + escapeFilePath(arg);
return ret;
}
@@ -3270,7 +3274,11 @@ MakefileGenerator::writePkgConfigFile()
}
}
t << "Description: " << desc << endl;
- t << "Version: " << project->first("VERSION") << endl;
+ ProString version = project->first("QMAKE_PKGCONFIG_VERSION");
+ if (version.isEmpty())
+ version = project->first("VERSION");
+ if (!version.isEmpty())
+ t << "Version: " << version << endl;
// libs
t << "Libs: ";
@@ -3341,11 +3349,17 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt
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*/)
- ret += " -e \"s," + match + "," + replace + ",g\"";
+ ret += " -e " + shellQuote("s," + match + "," + replace + ",g");
}
ret += " \"" + src + "\" >\"" + dst + "\"";
}
return ret;
}
+QString MakefileGenerator::shellQuote(const QString &str)
+{
+ return isWindowsShell() ? QMakeInternal::IoUtils::shellQuoteWin(str)
+ : QMakeInternal::IoUtils::shellQuoteUnix(str);
+}
+
QT_END_NAMESPACE