diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-07-12 12:08:42 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-16 01:06:51 +0200 |
commit | 9651738f2d53c70fcb96cc7baa8a8c9dceb64562 (patch) | |
tree | ed96ebe60bfdd7bf383c495048cbba6552f976b8 /qmake/generators | |
parent | 4499a911c4c5f73fe9556f918766e6f377411b73 (diff) |
automatically fix separators in QMAKE_{DIST,}CLEAN
it's a tad insane to expect the user to do that
Change-Id: I75c68f2a28656c9ba2e3fabcc79718b899b29ce7
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'qmake/generators')
-rw-r--r-- | qmake/generators/makefile.cpp | 13 | ||||
-rw-r--r-- | qmake/generators/makefile.h | 1 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 5 |
3 files changed, 15 insertions, 4 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 3a29c5588d..c961528a5c 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1436,6 +1436,15 @@ MakefileGenerator::varGlue(const QString &var, const QString &before, const QStr } QString +MakefileGenerator::fileVarGlue(const QString &var, const QString &before, const QString &glue, const QString &after) +{ + QStringList varList; + foreach (const QString &val, project->values(var)) + varList << escapeFilePath(Option::fixPathToTargetOS(val)); + return valGlue(varList, before, glue, after); +} + +QString MakefileGenerator::valGlue(const QStringList &varList, const QString &before, const QString &glue, const QString &after) { QString ret; @@ -2595,12 +2604,12 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT t << " FORCE"; t << endl; if(suffix == "clean") { - t << varGlue("QMAKE_CLEAN","\t-$(DEL_FILE) ","\n\t-$(DEL_FILE) ", "\n"); + t << fileVarGlue("QMAKE_CLEAN", "\t-$(DEL_FILE) ", "\n\t-$(DEL_FILE) ", "\n"); } else if(suffix == "distclean") { QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); if(!ofile.isEmpty()) t << "\t-$(DEL_FILE) " << ofile << endl; - t << varGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n"); + t << fileVarGlue("QMAKE_DISTCLEAN", "\t-$(DEL_FILE) ", " ", "\n"); } else if(project->isActiveConfig("no_empty_targets")) { t << "\t" << "@cd ." << endl; } diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index dc6714dd64..af5a3eb321 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -223,6 +223,7 @@ protected: //for retrieving values and lists of values virtual QString var(const QString &var); QString varGlue(const QString &var, const QString &before, const QString &glue, const QString &after); + QString fileVarGlue(const QString &var, const QString &before, const QString &glue, const QString &after); QString varList(const QString &var); QString val(const QStringList &varList); QString valGlue(const QStringList &varList, const QString &before, const QString &glue, const QString &after); diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 319cd68338..8be2fcf7e0 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -593,12 +593,13 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t) const QString del_statement("-$(DEL_FILE)"); if(project->isActiveConfig("no_delete_multiple_files")) { for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) - t << "\n\t" << del_statement << " " << escapeFilePath((*it)); + t << "\n\t" << del_statement << " " + << escapeFilePath(Option::fixPathToTargetOS(*it)); } else { QString files, file; const int commandlineLimit = 2047; // NT limit, expanded for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { - file = " " + escapeFilePath((*it)); + file = " " + escapeFilePath(Option::fixPathToTargetOS(*it)); if(del_statement.length() + files.length() + qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) { t << "\n\t" << del_statement << files; |