From d089ecb711afcd13a32e24103e270ba000cdc68c Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Fri, 11 Jan 2013 00:30:41 +0100 Subject: consolidate generation of metafile install targets Metafiles such as .prl and .pc files contain paths that have to be adjusted during installation. The same code is used for unix and windows so move it into the base class. Change-Id: I82db89ec83820a4fa0214ba15e7cd63438f6dc91 Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'qmake/generators/unix/unixmake.cpp') diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 7a9239c28df..da0da53e058 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -868,32 +868,15 @@ UnixMakefileGenerator::defaultInstall(const QString &t) if(!uninst.isEmpty()) uninst.append("\n\t"); uninst.append("-$(DEL_FILE) \"" + dst_meta + "\""); - const ProKey replace_rule("QMAKE_" + type.toUpper() + "_INSTALL_REPLACE"); const QString dst_meta_dir = fileInfo(dst_meta).path(); if(!dst_meta_dir.isEmpty()) { if(!ret.isEmpty()) ret += "\n\t"; ret += mkdir_p_asstring(dst_meta_dir, true); } - QString install_meta = "$(INSTALL_FILE) \"" + src_meta + "\" \"" + dst_meta + "\""; - if(project->isEmpty(replace_rule) || project->isActiveConfig("no_sed_meta_install")) { - if(!ret.isEmpty()) - ret += "\n\t"; - ret += "-" + install_meta; - } else { - if(!ret.isEmpty()) - ret += "\n\t"; - ret += "-$(SED)"; - const ProStringList &replace_rules = project->values(replace_rule); - for(int r = 0; r < replace_rules.size(); ++r) { - const ProString &match = project->first(ProKey(replace_rules.at(r) + ".match")), - &replace = project->first(ProKey(replace_rules.at(r) + ".replace")); - if(!match.isEmpty() /*&& match != replace*/) - ret += " -e \"s," + match + "," + replace + ",g\""; - } - ret += " \"" + src_meta + "\" >\"" + dst_meta + "\""; - //ret += " || " + install_meta; - } + if (!ret.isEmpty()) + ret += "\n\t"; + ret += installMetaFile(ProKey("QMAKE_" + type.toUpper() + "_INSTALL_REPLACE"), src_meta, dst_meta); } } } -- cgit v1.2.3