From 9651738f2d53c70fcb96cc7baa8a8c9dceb64562 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 12 Jul 2012 12:08:42 +0200 Subject: [PATCH] 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 --- mkspecs/features/win32/embed_manifest_dll.prf | 2 +- mkspecs/features/win32/embed_manifest_exe.prf | 2 +- qmake/generators/makefile.cpp | 13 +++++++++++-- qmake/generators/makefile.h | 1 + qmake/generators/win32/winmakefile.cpp | 5 +++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/win32/embed_manifest_dll.prf b/mkspecs/features/win32/embed_manifest_dll.prf index cf96ee7017..5baa5a4114 100644 --- a/mkspecs/features/win32/embed_manifest_dll.prf +++ b/mkspecs/features/win32/embed_manifest_dll.prf @@ -8,5 +8,5 @@ QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") !isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2)$$QMAKE_POST_LINK - QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" + QMAKE_CLEAN += $$MANIFEST_DIR/$${NOPATH_TARGET}.intermediate.manifest } diff --git a/mkspecs/features/win32/embed_manifest_exe.prf b/mkspecs/features/win32/embed_manifest_exe.prf index 9bc77029ff..3f57d9d0c2 100644 --- a/mkspecs/features/win32/embed_manifest_exe.prf +++ b/mkspecs/features/win32/embed_manifest_exe.prf @@ -8,5 +8,5 @@ if(win32-msvc2005*|win32-msvc2008*|win32-msvc2010*):equals(TEMPLATE, "app") { QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") !isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1)$$QMAKE_POST_LINK - QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" + QMAKE_CLEAN += $$MANIFEST_DIR/$${NOPATH_TARGET}.intermediate.manifest } 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 @@ -1435,6 +1435,15 @@ MakefileGenerator::varGlue(const QString &var, const QString &before, const QStr return valGlue(project->values(var), before, glue, after); } +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) { @@ -2595,12 +2604,12 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListisActiveConfig("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;