summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefile.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-07-23 11:18:11 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-07-23 11:18:11 +0200
commit084c5b3db794af1ce86b2b17455d9be5e64baebe (patch)
tree46d29a7b89ff251c07b6fdd59c57e30f14baa64a /qmake/generators/makefile.cpp
parentf4a0d6d2494d1dd41cd5b854a48b435120714d32 (diff)
parent54987c6bf55b159d3ddb79461439700f6e0111f9 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp Change-Id: I18a9d83fc14f4a9afdb1e40523ec51e3fa1d7754
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r--qmake/generators/makefile.cpp56
1 files changed, 38 insertions, 18 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 0264dbf37e..a8ae84a4e2 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1984,17 +1984,29 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
QString &file = dep_cmd_deps[i];
- if(!exists(file)) {
+ QString absFile = QDir(Option::output_dir).absoluteFilePath(file);
+ if (exists(absFile)) {
+ file = absFile;
+ } else {
QString localFile;
QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
- for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin();
- it != depdirs.end(); ++it) {
- if(exists((*it).real() + Option::dir_sep + file)) {
- localFile = (*it).local() + Option::dir_sep + file;
+ for (QList<QMakeLocalFileName>::Iterator dit = depdirs.begin();
+ dit != depdirs.end(); ++dit) {
+ if (exists((*dit).real() + Option::dir_sep + file)) {
+ localFile = (*dit).local() + Option::dir_sep + file;
break;
}
}
- file = localFile;
+ if (localFile.isEmpty()) {
+ if (exists(file))
+ warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
+ " prints paths relative to source directory",
+ (*it).toLatin1().constData());
+ else
+ file.clear();
+ } else {
+ file = localFile;
+ }
}
if(!file.isEmpty())
file = fileFixify(file);
@@ -2062,17 +2074,29 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
QString &file = dep_cmd_deps[i];
- if(!exists(file)) {
+ QString absFile = QDir(Option::output_dir).absoluteFilePath(file);
+ if (exists(absFile)) {
+ file = absFile;
+ } else {
QString localFile;
QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
- for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin();
- it != depdirs.end(); ++it) {
- if(exists((*it).real() + Option::dir_sep + file)) {
- localFile = (*it).local() + Option::dir_sep + file;
+ for (QList<QMakeLocalFileName>::Iterator dit = depdirs.begin();
+ dit != depdirs.end(); ++dit) {
+ if (exists((*dit).real() + Option::dir_sep + file)) {
+ localFile = (*dit).local() + Option::dir_sep + file;
break;
}
}
- file = localFile;
+ if (localFile.isEmpty()) {
+ if (exists(file))
+ warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
+ " prints paths relative to source directory",
+ (*it).toLatin1().constData());
+ else
+ file.clear();
+ } else {
+ file = localFile;
+ }
}
if(!file.isEmpty())
file = fileFixify(file);
@@ -2738,12 +2762,8 @@ QString
MakefileGenerator::unescapeFilePath(const QString &path) const
{
QString ret = path;
- if(!ret.isEmpty()) {
- if(ret.contains(QLatin1String("\\ ")))
- ret.replace(QLatin1String("\\ "), QLatin1String(" "));
- if(ret.contains(QLatin1Char('\"')))
- ret.remove(QLatin1Char('\"'));
- }
+ ret.replace(QLatin1String("\\ "), QLatin1String(" "));
+ ret.remove(QLatin1Char('\"'));
return ret;
}