fix (un-)installation for TEMPLATE = aux

don't try to install the primary target, as it obviously doesn't exist.
however, we must not disarm bundle installation.

Change-Id: I3074150f749220d77c1210a4978e71aff9c9a3a9
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Oswald Buddenhagen 2015-05-05 19:01:14 +02:00
parent 9b2ee419b4
commit 82449d7251
2 changed files with 15 additions and 11 deletions

View File

@ -699,6 +699,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
return QString(); return QString();
enum { NoBundle, SolidBundle, SlicedBundle } bundle = NoBundle; enum { NoBundle, SolidBundle, SlicedBundle } bundle = NoBundle;
bool isAux = (project->first("TEMPLATE") == "aux");
const QString root = "$(INSTALL_ROOT)"; const QString root = "$(INSTALL_ROOT)";
ProStringList &uninst = project->values(ProKey(t + ".uninstall")); ProStringList &uninst = project->values(ProKey(t + ".uninstall"));
QString ret, destdir = project->first("DESTDIR").toQString(); QString ret, destdir = project->first("DESTDIR").toQString();
@ -773,21 +774,21 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
} }
src_targ = escapeFilePath(src_targ); src_targ = escapeFilePath(src_targ);
dst_targ = escapeFilePath(dst_targ); dst_targ = escapeFilePath(dst_targ);
if(!ret.isEmpty())
ret += "\n\t";
QString copy_cmd("-"); QString copy_cmd;
if (bundle == SolidBundle) { if (bundle == SolidBundle) {
copy_cmd += "$(INSTALL_DIR) " + src_targ + ' ' + plain_targ; copy_cmd += "-$(INSTALL_DIR) " + src_targ + ' ' + plain_targ;
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) { } else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
copy_cmd += "$(INSTALL_FILE) " + src_targ + ' ' + dst_targ; copy_cmd += "-$(INSTALL_FILE) " + src_targ + ' ' + dst_targ;
} else { } else if (!isAux) {
if (bundle == SlicedBundle) if (bundle == SlicedBundle)
ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false) + "\n\t"; ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false) + "\n\t";
copy_cmd += "$(INSTALL_PROGRAM) " + src_targ + ' ' + dst_targ; copy_cmd += "-$(INSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
} }
if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib")
&& project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) { && project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) {
if (!ret.isEmpty())
ret += "\n\t";
if(!project->isEmpty("QMAKE_FIX_RPATH")) { if(!project->isEmpty("QMAKE_FIX_RPATH")) {
ret += copy_cmd; ret += copy_cmd;
ret += "\n\t-" + var("QMAKE_FIX_RPATH") + ' ' + dst_targ + ' ' + dst_targ; ret += "\n\t-" + var("QMAKE_FIX_RPATH") + ' ' + dst_targ + ' ' + dst_targ;
@ -797,11 +798,14 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
} else { } else {
ret += copy_cmd; ret += copy_cmd;
} }
} else { } else if (!copy_cmd.isEmpty()) {
if (!ret.isEmpty())
ret += "\n\t";
ret += copy_cmd; ret += copy_cmd;
} }
if(project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) { if (isAux) {
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
if(!project->isEmpty("QMAKE_RANLIB")) if(!project->isEmpty("QMAKE_RANLIB"))
ret += QString("\n\t$(RANLIB) ") + dst_targ; ret += QString("\n\t$(RANLIB) ") + dst_targ;
} else if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") } else if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip")
@ -820,7 +824,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
uninst.append("\n\t"); uninst.append("\n\t");
if (bundle == SolidBundle) if (bundle == SolidBundle)
uninst.append("-$(DEL_FILE) -r " + plain_targ); uninst.append("-$(DEL_FILE) -r " + plain_targ);
else else if (!isAux)
uninst.append("-$(DEL_FILE) " + dst_targ); uninst.append("-$(DEL_FILE) " + dst_targ);
if (bundle == SlicedBundle) { if (bundle == SlicedBundle) {
int dstlen = project->first("DESTDIR").length(); int dstlen = project->first("DESTDIR").length();

View File

@ -784,7 +784,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
{ {
if((t != "target" && t != "dlltarget") || if((t != "target" && t != "dlltarget") ||
(t == "dlltarget" && (project->first("TEMPLATE") != "lib" || !project->isActiveConfig("shared"))) || (t == "dlltarget" && (project->first("TEMPLATE") != "lib" || !project->isActiveConfig("shared"))) ||
project->first("TEMPLATE") == "subdirs") project->first("TEMPLATE") == "subdirs" || project->first("TEMPLATE") == "aux")
return QString(); return QString();
const QString root = "$(INSTALL_ROOT)"; const QString root = "$(INSTALL_ROOT)";