summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefile.cpp
diff options
context:
space:
mode:
authorMark Brand <mabrand@mabrand.nl>2013-01-11 00:30:41 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-25 23:30:50 +0100
commitd089ecb711afcd13a32e24103e270ba000cdc68c (patch)
tree9bea9b79d5dd730e9c5f26bf6226b86d92233250 /qmake/generators/makefile.cpp
parentf210a8593450049fc366098cab040daea10ca758 (diff)
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 <oswald.buddenhagen@digia.com>
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r--qmake/generators/makefile.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index abf0f60f8f..444556d467 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3285,4 +3285,25 @@ MakefileGenerator::writePkgConfigFile()
t << endl;
}
+QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst)
+{
+ QString ret;
+ if (project->isEmpty(replace_rule)
+ || project->isActiveConfig("no_sed_meta_install")
+ || project->isEmpty("QMAKE_STREAM_EDITOR")) {
+ ret += "-$(INSTALL_FILE) \"" + src + "\" \"" + dst + "\"";
+ } else {
+ 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 + "\" >\"" + dst + "\"";
+ }
+ return ret;
+}
+
QT_END_NAMESPACE