2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2005-09-03 00:29:32 +04:00
|
|
|
#include "cmXCode21Object.h"
|
2016-04-29 16:40:20 +03:00
|
|
|
|
2005-11-16 21:13:39 +03:00
|
|
|
#include "cmSystemTools.h"
|
2005-09-03 00:29:32 +04:00
|
|
|
|
|
|
|
cmXCode21Object::cmXCode21Object(PBXType ptype, Type type)
|
2016-05-16 17:34:04 +03:00
|
|
|
: cmXCodeObject(ptype, type)
|
2005-09-03 00:29:32 +04:00
|
|
|
{
|
2006-03-15 19:02:08 +03:00
|
|
|
this->Version = 21;
|
2005-09-03 00:29:32 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void cmXCode21Object::PrintComment(std::ostream& out)
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
if (this->Comment.empty()) {
|
2005-11-16 21:13:39 +03:00
|
|
|
cmXCodeObject* n = this->GetObject("name");
|
2016-05-16 17:34:04 +03:00
|
|
|
if (n) {
|
2006-03-15 19:02:08 +03:00
|
|
|
this->Comment = n->GetString();
|
|
|
|
cmSystemTools::ReplaceString(this->Comment, "\"", "");
|
2005-11-16 21:13:39 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
|
|
|
if (this->Comment.empty()) {
|
2015-04-09 11:48:33 +03:00
|
|
|
return;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-04-09 11:14:47 +03:00
|
|
|
out << " /* ";
|
2006-03-15 19:02:08 +03:00
|
|
|
out << this->Comment;
|
2005-11-16 21:13:39 +03:00
|
|
|
out << " */";
|
2005-09-03 00:29:32 +04:00
|
|
|
}
|
|
|
|
|
2006-03-10 21:54:57 +03:00
|
|
|
void cmXCode21Object::PrintList(std::vector<cmXCodeObject*> const& v,
|
|
|
|
std::ostream& out, PBXType t)
|
2005-09-03 00:29:32 +04:00
|
|
|
{
|
|
|
|
bool hasOne = false;
|
2016-05-16 17:34:04 +03:00
|
|
|
for (std::vector<cmXCodeObject*>::const_iterator i = v.begin(); i != v.end();
|
|
|
|
++i) {
|
2005-09-03 00:29:32 +04:00
|
|
|
cmXCodeObject* obj = *i;
|
2016-05-16 17:34:04 +03:00
|
|
|
if (obj->GetType() == OBJECT && obj->GetIsA() == t) {
|
2005-09-03 00:29:32 +04:00
|
|
|
hasOne = true;
|
|
|
|
break;
|
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
|
|
|
if (!hasOne) {
|
2005-09-03 00:29:32 +04:00
|
|
|
return;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
|
|
|
out << "\n/* Begin " << PBXTypeNames[t] << " section */\n";
|
|
|
|
for (std::vector<cmXCodeObject*>::const_iterator i = v.begin(); i != v.end();
|
|
|
|
++i) {
|
2005-09-03 00:29:32 +04:00
|
|
|
cmXCodeObject* obj = *i;
|
2016-05-16 17:34:04 +03:00
|
|
|
if (obj->GetType() == OBJECT && obj->GetIsA() == t) {
|
|
|
|
obj->Print(out);
|
2005-09-03 00:29:32 +04:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
|
|
|
out << "/* End " << PBXTypeNames[t] << " section */\n";
|
2005-09-03 00:29:32 +04:00
|
|
|
}
|
|
|
|
|
2006-03-10 21:54:57 +03:00
|
|
|
void cmXCode21Object::PrintList(std::vector<cmXCodeObject*> const& v,
|
|
|
|
std::ostream& out)
|
2005-09-03 00:29:32 +04:00
|
|
|
{
|
|
|
|
cmXCodeObject::Indent(1, out);
|
|
|
|
out << "objects = {\n";
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXAggregateTarget);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXBuildFile);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXBuildStyle);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXContainerItemProxy);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXFileReference);
|
2016-05-16 17:34:04 +03:00
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXFrameworksBuildPhase);
|
2005-09-03 00:29:32 +04:00
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXGroup);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXHeadersBuildPhase);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXNativeTarget);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXProject);
|
2012-08-13 21:42:58 +04:00
|
|
|
cmXCode21Object::PrintList(v, out,
|
2006-03-10 21:54:57 +03:00
|
|
|
cmXCode21Object::PBXShellScriptBuildPhase);
|
2005-09-03 00:29:32 +04:00
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXResourcesBuildPhase);
|
2005-11-16 21:13:39 +03:00
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXSourcesBuildPhase);
|
2006-03-30 01:21:22 +04:00
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXCopyFilesBuildPhase);
|
2016-05-16 17:34:04 +03:00
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXApplicationReference);
|
2012-08-13 21:42:58 +04:00
|
|
|
cmXCode21Object::PrintList(v, out,
|
2006-03-10 21:54:57 +03:00
|
|
|
cmXCode21Object::PBXExecutableFileReference);
|
2005-09-03 00:29:32 +04:00
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXLibraryReference);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXToolTarget);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXLibraryTarget);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXTargetDependency);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::XCBuildConfiguration);
|
|
|
|
cmXCode21Object::PrintList(v, out, cmXCode21Object::XCConfigurationList);
|
|
|
|
cmXCodeObject::Indent(1, out);
|
|
|
|
out << "};\n";
|
|
|
|
}
|