Xcode: Add XCODE_FILE_ATTRIBUTES source file property

This adds values to the ATTRIBUTES list in PBXBuildFile settings.
This commit is contained in:
James Touton
2016-06-03 18:51:18 -07:00
committed by Brad King
parent ef494edf76
commit 811f6c8252
3 changed files with 26 additions and 0 deletions
+14
View File
@@ -714,6 +714,20 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile(
}
}
// Add user-specified file attributes.
const char* extraFileAttributes = sf->GetProperty("XCODE_FILE_ATTRIBUTES");
if (extraFileAttributes) {
// Expand the list of attributes.
std::vector<std::string> attributes;
cmSystemTools::ExpandListArgument(extraFileAttributes, attributes);
// Store the attributes.
for (std::vector<std::string>::const_iterator ai = attributes.begin();
ai != attributes.end(); ++ai) {
attrs->AddObject(this->CreateString(*ai));
}
}
settings->AddAttributeIfNotEmpty("ATTRIBUTES", attrs);
// Add the fileRef to the top level Resources group/folder if it is not