summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2012-09-24 10:04:21 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-18 00:31:22 (GMT)
commit53a450d45e344bfe66f401886f31d6749bc5dcd7 (patch)
tree7c46e07db9aa88d2215c65ac129ea94abbf843f4 /qmake/generators
parentd23ee1a4b519a625c1978ebd78df416fc6fb3374 (diff)
downloadQt-53a450d45e344bfe66f401886f31d6749bc5dcd7.zip
Qt-53a450d45e344bfe66f401886f31d6749bc5dcd7.tar.gz
Qt-53a450d45e344bfe66f401886f31d6749bc5dcd7.tar.bz2
Fix XCode generator for qmake when generating for XCode 4.5 and later
This is a partial cherry pick from Qt 5 just to include the specific changes needed to get qmake generated XCode projects working with XCode 4.5 or later. Change-Id: I879ca5684435289a61d8db248f2c3f64f6866a60 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> (cherry picked from qtbase/f6bd02317db7beadda1237df7feddd4a780415cb)
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp17
-rw-r--r--qmake/generators/mac/pbuilder_pbx.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index d403d58..343f0fa 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -296,6 +296,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
<< "\t\t\t" << writeSettings("children", grp_it.value(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", escapeFilePath(grp_it.key().section(Option::dir_sep, -1))) << ";" << "\n"
<< "\t\t\t" << writeSettings("refType", "4", SettingsNoQuote) << ";" << "\n"
+ << "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";" << "\n"
<< "\t\t" << "};" << "\n";
}
@@ -645,7 +646,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", escapeFilePath(name)) << ";" << "\n"
<< "\t\t\t" << writeSettings("path", escapeFilePath(file)) << ";" << "\n"
- << "\t\t\t" << writeSettings("refType", QString::number(reftypeForFile(file)), SettingsNoQuote) << ";" << "\n";
+ << "\t\t\t" << writeSettings("refType", QString::number(reftypeForFile(file)), SettingsNoQuote) << ";" << "\n"
+ << "\t\t\t" << writeSettings("sourceTree", sourceTreeForFile(file)) << ";" << "\n";
if(pbVersion >= 38) {
QString filetype;
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit) {
@@ -689,6 +691,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("children", grp_it.value(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", escapeFilePath(grp_it.key().section(Option::dir_sep, -1))) << ";" << "\n"
<< "\t\t\t" << writeSettings("refType", "4", SettingsNoQuote) << ";" << "\n"
+ << "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";" << "\n"
<< "\t\t" << "};" << "\n";
}
@@ -921,6 +924,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("name", escapeFilePath(name)) << ";" << "\n"
<< "\t\t\t" << writeSettings("path", escapeFilePath(library)) << ";" << "\n"
<< "\t\t\t" << writeSettings("refType", QString::number(reftypeForFile(library)), SettingsNoQuote) << ";" << "\n"
+ << "\t\t\t" << writeSettings("sourceTree", sourceTreeForFile(library)) << ";" << "\n"
<< "\t\t" << "};" << "\n";
project->values("QMAKE_PBX_LIBRARIES").append(key);
QString build_key = keyFor(library + ".BUILDABLE");
@@ -989,6 +993,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";" << "\n"
<< "\t\t\t" << writeSettings("path", QStringList()) << ";" << "\n"
<< "\t\t\t" << writeSettings("refType", "4", SettingsNoQuote) << ";" << "\n"
+ << "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";" << "\n"
<< "\t\t" << "};" << "\n";
}
}
@@ -1089,6 +1094,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("name", "Source [bundle data]") << ";" << "\n"
<< "\t\t\t" << writeSettings("path", QStringList()) << ";" << "\n"
<< "\t\t\t" << writeSettings("refType", "4", SettingsNoQuote) << ";" << "\n"
+ << "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";" << "\n"
<< "\t\t" << "};" << "\n";
}
@@ -1136,6 +1142,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("name", escapeFilePath(project->first("QMAKE_ORIG_TARGET"))) << ";" << "\n"
<< "\t\t\t" << writeSettings("path", QStringList()) << ";" << "\n"
<< "\t\t\t" << writeSettings("refType", "4", SettingsNoQuote) << ";" << "\n"
+ << "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";" << "\n"
<< "\t\t" << "};" << "\n";
//REFERENCE
project->values("QMAKE_PBX_PRODUCTS").append(keyFor(pbx_dir + "QMAKE_PBX_REFERENCE"));
@@ -1885,6 +1892,14 @@ ProjectBuilderMakefileGenerator::reftypeForFile(const QString &where)
return ret;
}
+QString ProjectBuilderMakefileGenerator::sourceTreeForFile(const QString &where)
+{
+ QString ret = "<absolute>";
+ if (QDir::isRelativePath(unescapeFilePath(where)))
+ ret = "SOURCE_ROOT"; //relative
+ return ret;
+}
+
QString
ProjectBuilderMakefileGenerator::projectSuffix() const
{
diff --git a/qmake/generators/mac/pbuilder_pbx.h b/qmake/generators/mac/pbuilder_pbx.h
index 15fef2f8..876099b 100644
--- a/qmake/generators/mac/pbuilder_pbx.h
+++ b/qmake/generators/mac/pbuilder_pbx.h
@@ -62,6 +62,7 @@ class ProjectBuilderMakefileGenerator : public UnixMakefileGenerator
QString fixForOutput(const QString &file);
QStringList fixListForOutput(const QString &where);
int reftypeForFile(const QString &where);
+ QString sourceTreeForFile(const QString &where);
QString projectSuffix() const;
enum { SettingsAsList=0x01, SettingsNoQuote=0x02 };
inline QString writeSettings(QString var, QString val, int flags=0, int indent_level=0)