summaryrefslogtreecommitdiffstats
path: root/qmake/project.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-04-18 16:31:19 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-04-18 16:31:19 (GMT)
commitfda9cc1d8a0e49817d1c6192c52d18dffcecf327 (patch)
treeaa9a3209339af6882eb496ab827f5ac297452d66 /qmake/project.cpp
parent6814998ab4d9c6b0990b0bf01119ace69363ce3e (diff)
parentc8aafe9a63b13a4af3049c43fcd5e8cce27db829 (diff)
downloadQt-fda9cc1d8a0e49817d1c6192c52d18dffcecf327.zip
Qt-fda9cc1d8a0e49817d1c6192c52d18dffcecf327.tar.gz
Qt-fda9cc1d8a0e49817d1c6192c52d18dffcecf327.tar.bz2
Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7
Conflicts: qmake/generators/makefile.cpp qmake/generators/win32/msbuild_objectmodel.cpp qmake/generators/win32/msvc_vcxproj.cpp src/corelib/global/qnamespace.h src/gui/text/qtextcontrol.cpp
Diffstat (limited to 'qmake/project.cpp')
-rw-r--r--qmake/project.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 815f210..d4fa786 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -1342,10 +1342,10 @@ QMakeProject::read(uchar cmd)
}
if(QDir::isRelativePath(qmakespec)) {
- if (QFile::exists(qmakespec+"/qmake.conf")) {
- Option::mkfile::qmakespec = QFileInfo(Option::mkfile::qmakespec).absoluteFilePath();
- } else if (QFile::exists(Option::output_dir+"/"+qmakespec+"/qmake.conf")) {
+ if (QFile::exists(Option::output_dir+"/"+qmakespec+"/qmake.conf")) {
qmakespec = Option::mkfile::qmakespec = QFileInfo(Option::output_dir+"/"+qmakespec).absoluteFilePath();
+ } else if (QFile::exists(qmakespec+"/qmake.conf")) {
+ Option::mkfile::qmakespec = QFileInfo(Option::mkfile::qmakespec).absoluteFilePath();
} else {
bool found_mkspec = false;
for(QStringList::ConstIterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) {
@@ -2770,6 +2770,20 @@ QMakeProject::expand(const QString &str)
return QStringList();
}
+QString
+QMakeProject::expand(const QString &str, const QString &file, int line)
+{
+ bool ok;
+ parser_info pi = parser;
+ parser.file = file;
+ parser.line_no = line;
+ parser.from_file = false;
+ QMap<QString, QStringList> tmp = vars;
+ const QStringList ret = doVariableReplaceExpand(str, tmp, &ok);
+ parser = pi;
+ return ok ? ret.join(QString(Option::field_sep)) : QString();
+}
+
QStringList
QMakeProject::expand(const QString &func, const QList<QStringList> &args)
{
@@ -3025,17 +3039,17 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList
if(!Option::user_template.isEmpty()) {
var = ".BUILTIN.USER." + var;
place[var] = QStringList(Option::user_template);
- } else if(!place[var].isEmpty()) {
- QString orig_template = place["TEMPLATE"].first(), real_template;
+ } else {
+ QString orig_template, real_template;
+ if(!place[var].isEmpty())
+ orig_template = place[var].first();
+ real_template = orig_template.isEmpty() ? "app" : orig_template;
if(!Option::user_template_prefix.isEmpty() && !orig_template.startsWith(Option::user_template_prefix))
- real_template = Option::user_template_prefix + orig_template;
- if(!real_template.isEmpty()) {
+ real_template.prepend(Option::user_template_prefix);
+ if(real_template != orig_template) {
var = ".BUILTIN." + var;
place[var] = QStringList(real_template);
}
- } else {
- var = ".BUILTIN." + var;
- place[var] = QStringList("app");
}
} else if(var.startsWith(QLatin1String("QMAKE_HOST."))) {
QString ret, type = var.mid(11);