path: root/qmake/main.cpp
diff options
authorSimon Hausmann <>2017-04-27 13:44:23 +0200
committerSimon Hausmann <>2017-04-28 13:46:44 +0000
commit0942f44454f3d81fde436eb40012888e94e36d09 (patch)
tree7b2f1222086499a5fcbd1a9d4d61641e4aa678dc /qmake/main.cpp
parent63b94c57725c23c91598535cd325553bd57e8e66 (diff)
Fix make install to be deterministic
The result of "make install" should be the same regardless of whether it has been run multiple times and the destination exists already. This is done by making the file installation calls always take canonical source and target paths and not look at the target directory. Task-number: QTBUG-60370 Change-Id: I83a584c0dbc4fd10c79976d4169bf6bc051884a1 Reviewed-by: Oswald Buddenhagen <>
Diffstat (limited to 'qmake/main.cpp')
1 files changed, 2 insertions, 8 deletions
diff --git a/qmake/main.cpp b/qmake/main.cpp
index 2bdb5370df..cc72645b59 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -236,17 +236,11 @@ static int doLink(int argc, char **argv)
-static int installFile(const QString &source, const QString &targetFileOrDirectory, bool exe = false)
+static int installFile(const QString &source, const QString &target, bool exe = false)
QFile sourceFile(source);
- QString target(targetFileOrDirectory);
- if (QFileInfo(target).isDir())
- target += QDir::separator() + QFileInfo(sourceFile.fileName()).fileName();
- if (QFile::exists(target))
- QFile::remove(target);
+ QFile::remove(target);
if (!sourceFile.copy(target)) {