summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2019-05-10 10:50:19 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2019-05-16 11:36:36 +0000
commit0e71db3c8eb7f98bccbe0fae48ba324b3ebfd301 (patch)
tree5fe0a6b3a1066c5e2678104760d88a4f6776dfd8 /qmake
parent43a66453c5b04d5ee877ef80dca15f90c697e536 (diff)
Deduplicate initialization code for default variables
Use the writeDefaultVariables method also for the Win32MakeFileGenerator. Remove the initializations that are already done in Makefile::writeDefaultVariables. Change-Id: I590cc5d7031de67dd830e6113849ab080dbf2325 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/win32/winmakefile.cpp38
-rw-r--r--qmake/generators/win32/winmakefile.h1
2 files changed, 16 insertions, 23 deletions
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 2c4766584a..8e0c62e13f 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -533,29 +533,7 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
writeIncPart(t);
writeLibsPart(t);
-
- t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
- t << "IDC = " << (project->isEmpty("QMAKE_IDC") ? QString("idc") : var("QMAKE_IDC"))
- << Qt::endl;
- t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL"))
- << Qt::endl;
- t << "ZIP = " << var("QMAKE_ZIP") << Qt::endl;
- t << "DEF_FILE = " << fileVar("DEF_FILE") << Qt::endl;
- t << "RES_FILE = " << fileVar("RES_FILE") << Qt::endl; // Not on mingw, can't see why not though...
- t << "COPY = " << var("QMAKE_COPY") << Qt::endl;
- t << "SED = " << var("QMAKE_STREAM_EDITOR") << Qt::endl;
- t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << Qt::endl;
- t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << Qt::endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
- t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << Qt::endl;
- t << "MOVE = " << var("QMAKE_MOVE") << Qt::endl;
- t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << Qt::endl;
- t << "MKDIR = " << var("QMAKE_MKDIR") << Qt::endl;
- t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << Qt::endl;
- t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << Qt::endl;
- t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << Qt::endl;
- t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << Qt::endl;
- t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << Qt::endl;
+ writeDefaultVariables(t);
t << Qt::endl;
t << "####### Output directory\n\n";
@@ -785,6 +763,20 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
return ret;
}
+void Win32MakefileGenerator::writeDefaultVariables(QTextStream &t)
+{
+ MakefileGenerator::writeDefaultVariables(t);
+ t << "IDC = " << (project->isEmpty("QMAKE_IDC") ? QString("idc") : var("QMAKE_IDC"))
+ << Qt::endl;
+ t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL"))
+ << Qt::endl;
+ t << "ZIP = " << var("QMAKE_ZIP") << Qt::endl;
+ t << "DEF_FILE = " << fileVar("DEF_FILE") << Qt::endl;
+ t << "RES_FILE = " << fileVar("RES_FILE") << Qt::endl; // Not on mingw, can't see why not though...
+ t << "SED = " << var("QMAKE_STREAM_EDITOR") << Qt::endl;
+ t << "MOVE = " << var("QMAKE_MOVE") << Qt::endl;
+}
+
QString Win32MakefileGenerator::escapeFilePath(const QString &path) const
{
QString ret = path;
diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h
index 33af195965..8eb633fdfa 100644
--- a/qmake/generators/win32/winmakefile.h
+++ b/qmake/generators/win32/winmakefile.h
@@ -37,6 +37,7 @@ class Win32MakefileGenerator : public MakefileGenerator
{
protected:
QString defaultInstall(const QString &) override;
+ void writeDefaultVariables(QTextStream &t) override;
virtual void writeCleanParts(QTextStream &t);
virtual void writeStandardParts(QTextStream &t);
virtual void writeIncPart(QTextStream &t);