summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefile.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-05-02 14:44:44 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-05-04 09:40:48 +0000
commit50acc8680490319c8fe45615c8d6521f0101728b (patch)
tree6d99ba428dbc28e11adc22ed4795a3ba9fa894b6 /qmake/generators/makefile.cpp
parent877ef0594d94f48bf063446b1f8a4b5e1941a8cd (diff)
Simplify built-in qmake install command
As the directory installation command also works with files as a source we can unify the external commands, resulting in simpler command lines. Change-Id: I65013626eedbdb3ce1c77ed230d46edd1603b986 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r--qmake/generators/makefile.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index c76708285a..d3221b7a25 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1287,12 +1287,10 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
dst_file += Option::dir_sep;
dst_file += fi.fileName();
QString cmd;
- if (fi.isDir())
- cmd = "-$(QINSTALL_DIR)";
- else if (is_target || fi.isExecutable())
- cmd = "-$(QINSTALL_PROGRAM)";
+ if (is_target || (!fi.isDir() && fi.isExecutable()))
+ cmd = QLatin1String("-$(QINSTALL_PROGRAM)");
else
- cmd = "-$(QINSTALL_FILE)";
+ cmd = QLatin1String("-$(QINSTALL)");
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
@@ -1307,17 +1305,14 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
QDir::NoDotAndDotDot | QDir::AllEntries);
if (installConfigValues.contains("no_check_exist") && files.isEmpty()) {
QString dst_file = filePrefixRoot(root, dst_dir);
- QString cmd;
if (!dst_file.endsWith(Option::dir_sep))
dst_file += Option::dir_sep;
dst_file += filestr;
- if (installConfigValues.contains("directory")) {
- cmd = QLatin1String("-$(QINSTALL_DIR)");
- } else if (installConfigValues.contains("executable")) {
+ QString cmd;
+ if (installConfigValues.contains("executable"))
cmd = QLatin1String("-$(QINSTALL_PROGRAM)");
- } else {
- cmd = QLatin1String("-$(QINSTALL_FILE)");
- }
+ else
+ cmd = QLatin1String("-$(QINSTALL)");
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + filestr, FileFixifyAbsolute, false))));
@@ -1330,7 +1325,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
if (!dst_file.endsWith(Option::dir_sep))
dst_file += Option::dir_sep;
dst_file += fi.fileName();
- QString cmd = QString(fi.isDir() ? "-$(QINSTALL_DIR)" : "-$(QINSTALL_FILE)") + " " +
+ QString cmd = QLatin1String("-$(QINSTALL) ") +
escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file);
inst << cmd;
if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
@@ -2242,9 +2237,8 @@ MakefileGenerator::writeDefaultVariables(QTextStream &t)
t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
- t << "QINSTALL_FILE = " << var("QMAKE_QMAKE") << " -install qinstall file" << endl;
- t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall program" << endl;
- t << "QINSTALL_DIR = " << var("QMAKE_QMAKE") << " -install qinstall directory" << endl;
+ t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << endl;
+ t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;