From 3d6f1ebf1dbdefc443aa4f8e7d18755383794156 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Wed, 10 Mar 2010 16:35:59 +0100 Subject: qmake: fix to create proper install target in Makefile at first run Previously when qmake was executed the first time, or when no previously compiled binary target was available for some reason, qmake just created an empty install target in the Makefile. So in fact for a target to be installed properly you needed to run something like "qmake && make && qmake && make install". This should now be fixed with this patch. Reviewed-by: Marius Storm-Olsen Task-number:QTBUG-5558 --- qmake/generators/makefile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index b9d2445..29a2422 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1245,7 +1245,8 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n } if(!dirstr.endsWith(Option::dir_sep)) dirstr += Option::dir_sep; - if(exists(wild)) { //real file + bool is_target = (wild == fileFixify(var("TARGET"), FileFixifyAbsolute)); + if(is_target || exists(wild)) { //real file or target QString file = wild; QFileInfo fi(fileInfo(wild)); if(!target.isEmpty()) @@ -1259,7 +1260,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n QString cmd; if (fi.isDir()) cmd = "-$(INSTALL_DIR)"; - else if (fi.isExecutable()) + else if (is_target || fi.isExecutable()) cmd = "-$(INSTALL_PROGRAM)"; else cmd = "-$(INSTALL_FILE)"; -- cgit v0.12