This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 5ec42eaf96b0088cd5b3e989e7458b73b65e5951 (commit) via b3ba006100b776351c62d8e2b53beadff771bf13 (commit) via 1dffee9afe54314b9522f8cfcf72bb48baad6fbc (commit) via 8d4ed32eff88dddddfb708a3e403641c28eedd42 (commit) via 91a77cfaa78364affc99562cfdc357a70f972ca9 (commit) via 2a942b6eab0521bd22e8841a52b3c7f22d069059 (commit) from f6355822b1bb2874cf6130dbd0f8bd10654bb9d3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ec42eaf96b0088cd5b3e989e7458b73b65e5951 commit 5ec42eaf96b0088cd5b3e989e7458b73b65e5951 Merge: f635582 b3ba006 Author: Gregor Jasny <gja...@googlemail.com> AuthorDate: Mon Jun 13 12:22:04 2016 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Mon Jun 13 12:22:04 2016 -0400 Merge topic 'xcode-mig-support' into next b3ba0061 Xcode: Add support for mig files 1dffee9a Xcode: Add XCODE_FILE_ATTRIBUTES source file property 8d4ed32e Xcode: Don't emit empty settings blocks. 91a77cfa Xcode: Add function to conditionally add Xcode Attributes 2a942b6e Xcode: Add const qualifiers https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b3ba006100b776351c62d8e2b53beadff771bf13 commit b3ba006100b776351c62d8e2b53beadff771bf13 Author: James Touton <bek...@gmail.com> AuthorDate: Fri Jun 3 18:27:39 2016 -0700 Commit: Gregor Jasny <gja...@googlemail.com> CommitDate: Sun Jun 12 22:20:22 2016 +0200 Xcode: Add support for mig files diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 8eefb19..d30830a 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -787,6 +787,8 @@ std::string GetSourcecodeValueFromFileExtension(const std::string& _ext, sourcecode += ".asm"; } else if (ext == "metal") { sourcecode += ".metal"; + } else if (ext == "mig") { + sourcecode += ".mig"; } // else // { https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1dffee9afe54314b9522f8cfcf72bb48baad6fbc commit 1dffee9afe54314b9522f8cfcf72bb48baad6fbc Author: James Touton <bek...@gmail.com> AuthorDate: Fri Jun 3 18:51:18 2016 -0700 Commit: Gregor Jasny <gja...@googlemail.com> CommitDate: Sun Jun 12 22:20:22 2016 +0200 Xcode: Add XCODE_FILE_ATTRIBUTES source file property This adds values to the ATTRIBUTES list in PBXBuildFile settings. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 3403dcd..1c64d63 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -344,6 +344,7 @@ Properties on Source Files /prop_sf/VS_XAML_TYPE /prop_sf/WRAP_EXCLUDE /prop_sf/XCODE_EXPLICIT_FILE_TYPE + /prop_sf/XCODE_FILE_ATTRIBUTES /prop_sf/XCODE_LAST_KNOWN_FILE_TYPE .. _`Cache Entry Properties`: diff --git a/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst b/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst new file mode 100644 index 0000000..39e6966 --- /dev/null +++ b/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst @@ -0,0 +1,11 @@ +XCODE_FILE_ATTRIBUTES +--------------------- + +Add values to the Xcode ``ATTRIBUTES`` setting on its reference to a +source file. Among other things, this can be used to set the role on +a mig file:: + + set_source_files_properties(defs.mig + PROPERTIES + XCODE_FILE_ATTRIBUTES "Client;Server" + ) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index b439018..8eefb19 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -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 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8d4ed32eff88dddddfb708a3e403641c28eedd42 commit 8d4ed32eff88dddddfb708a3e403641c28eedd42 Author: James Touton <bek...@gmail.com> AuthorDate: Fri Jun 3 18:32:38 2016 -0700 Commit: Gregor Jasny <gja...@googlemail.com> CommitDate: Sun Jun 12 22:20:21 2016 +0200 Xcode: Don't emit empty settings blocks. diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 4d778ee..b439018 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -689,7 +689,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( cmXCodeObject* fileRef = buildFile->GetObject("fileRef")->GetObject(); cmXCodeObject* settings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); - settings->AddAttribute("COMPILER_FLAGS", this->CreateString(flags)); + settings->AddAttributeIfNotEmpty("COMPILER_FLAGS", + this->CreateString(flags)); // Is this a resource file in this target? Add it to the resources group... // @@ -698,23 +699,23 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( gtgt->GetTargetSourceFileFlags(sf); bool isResource = tsFlags.Type == cmGeneratorTarget::SourceFileTypeResource; + cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST); + // Is this a "private" or "public" framework header file? // Set the ATTRIBUTES attribute appropriately... // if (gtgt->IsFrameworkOnApple()) { if (tsFlags.Type == cmGeneratorTarget::SourceFileTypePrivateHeader) { - cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST); attrs->AddObject(this->CreateString("Private")); - settings->AddAttribute("ATTRIBUTES", attrs); isResource = true; } else if (tsFlags.Type == cmGeneratorTarget::SourceFileTypePublicHeader) { - cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST); attrs->AddObject(this->CreateString("Public")); - settings->AddAttribute("ATTRIBUTES", attrs); isResource = true; } } + settings->AddAttributeIfNotEmpty("ATTRIBUTES", attrs); + // Add the fileRef to the top level Resources group/folder if it is not // already there. // @@ -723,7 +724,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( this->ResourcesGroupChildren->AddObject(fileRef); } - buildFile->AddAttribute("settings", settings); + buildFile->AddAttributeIfNotEmpty("settings", settings); return buildFile; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91a77cfaa78364affc99562cfdc357a70f972ca9 commit 91a77cfaa78364affc99562cfdc357a70f972ca9 Author: Gregor Jasny <gja...@googlemail.com> AuthorDate: Sun Jun 12 21:39:16 2016 +0200 Commit: Gregor Jasny <gja...@googlemail.com> CommitDate: Sun Jun 12 22:20:21 2016 +0200 Xcode: Add function to conditionally add Xcode Attributes diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 3d31343..919f8c9 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -83,6 +83,21 @@ cmXCodeObject::cmXCodeObject(PBXType ptype, Type type) } } +bool cmXCodeObject::IsEmpty() const +{ + switch (this->TypeValue) { + case OBJECT_LIST: + return this->List.empty(); + case STRING: + return this->String.empty(); + case ATTRIBUTE_GROUP: + return this->ObjectAttributes.empty(); + case OBJECT_REF: + case OBJECT: + return this->Object == 0; + } +} + void cmXCodeObject::Indent(int level, std::ostream& out) { while (level) { diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h index 35011c6..9a17ae4 100644 --- a/Source/cmXCodeObject.h +++ b/Source/cmXCodeObject.h @@ -62,6 +62,8 @@ public: Type GetType() const { return this->TypeValue; } PBXType GetIsA() const { return this->IsA; } + bool IsEmpty() const; + void SetString(const std::string& s); const std::string& GetString() const { return this->String; } @@ -70,6 +72,13 @@ public: this->ObjectAttributes[name] = value; } + void AddAttributeIfNotEmpty(const std::string& name, cmXCodeObject* value) + { + if (value && !value->IsEmpty()) { + AddAttribute(name, value); + } + } + void SetObject(cmXCodeObject* value) { this->Object = value; } cmXCodeObject* GetObject() { return this->Object; } void AddObject(cmXCodeObject* value) { this->List.push_back(value); } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2a942b6eab0521bd22e8841a52b3c7f22d069059 commit 2a942b6eab0521bd22e8841a52b3c7f22d069059 Author: James Touton <bek...@gmail.com> AuthorDate: Fri Jun 3 16:38:52 2016 -0700 Commit: Gregor Jasny <gja...@googlemail.com> CommitDate: Sun Jun 12 22:20:12 2016 +0200 Xcode: Add const qualifiers diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h index d2f7cb7..35011c6 100644 --- a/Source/cmXCodeObject.h +++ b/Source/cmXCodeObject.h @@ -59,11 +59,11 @@ public: static const char* PBXTypeNames[]; virtual ~cmXCodeObject(); cmXCodeObject(PBXType ptype, Type type); - Type GetType() { return this->TypeValue; } - PBXType GetIsA() { return this->IsA; } + Type GetType() const { return this->TypeValue; } + PBXType GetIsA() const { return this->IsA; } void SetString(const std::string& s); - const std::string& GetString() { return this->String; } + const std::string& GetString() const { return this->String; } void AddAttribute(const std::string& name, cmXCodeObject* value) { @@ -73,7 +73,7 @@ public: void SetObject(cmXCodeObject* value) { this->Object = value; } cmXCodeObject* GetObject() { return this->Object; } void AddObject(cmXCodeObject* value) { this->List.push_back(value); } - bool HasObject(cmXCodeObject* o) + bool HasObject(cmXCodeObject* o) const { return !(std::find(this->List.begin(), this->List.end(), o) == this->List.end()); @@ -94,23 +94,25 @@ public: virtual void PrintComment(std::ostream&) {} static void PrintList(std::vector<cmXCodeObject*> const&, std::ostream& out); - const std::string& GetId() { return this->Id; } + const std::string& GetId() const { return this->Id; } void SetId(const std::string& id) { this->Id = id; } - cmGeneratorTarget* GetTarget() { return this->Target; } + cmGeneratorTarget* GetTarget() const { return this->Target; } void SetTarget(cmGeneratorTarget* t) { this->Target = t; } - const std::string& GetComment() { return this->Comment; } - bool HasComment() { return (!this->Comment.empty()); } - cmXCodeObject* GetObject(const char* name) + const std::string& GetComment() const { return this->Comment; } + bool HasComment() const { return (!this->Comment.empty()); } + cmXCodeObject* GetObject(const char* name) const { - if (this->ObjectAttributes.count(name)) { - return this->ObjectAttributes[name]; + std::map<std::string, cmXCodeObject*>::const_iterator i = + this->ObjectAttributes.find(name); + if (i != this->ObjectAttributes.end()) { + return i->second; } return 0; } // search the attribute list for an object of the specified type - cmXCodeObject* GetObject(cmXCodeObject::PBXType t) + cmXCodeObject* GetObject(cmXCodeObject::PBXType t) const { - for (std::vector<cmXCodeObject*>::iterator i = this->List.begin(); + for (std::vector<cmXCodeObject*>::const_iterator i = this->List.begin(); i != this->List.end(); ++i) { cmXCodeObject* o = *i; if (o->IsA == t) { @@ -126,7 +128,7 @@ public: { this->DependLibraries[configName].push_back(l); } - std::map<std::string, StringVec> const& GetDependLibraries() + std::map<std::string, StringVec> const& GetDependLibraries() const { return this->DependLibraries; } @@ -134,11 +136,11 @@ public: { this->DependTargets[configName].push_back(tName); } - std::map<std::string, StringVec> const& GetDependTargets() + std::map<std::string, StringVec> const& GetDependTargets() const { return this->DependTargets; } - std::vector<cmXCodeObject*> const& GetObjectList() { return this->List; } + std::vector<cmXCodeObject*> const& GetObjectList() const { return this->List; } void SetComment(const std::string& c) { this->Comment = c; } static void PrintString(std::ostream& os, std::string String); ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 1 + Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst | 11 ++++++++ Source/cmGlobalXCodeGenerator.cxx | 29 ++++++++++++++++----- Source/cmXCodeObject.cxx | 15 +++++++++++ Source/cmXCodeObject.h | 43 ++++++++++++++++++++------------ 5 files changed, 77 insertions(+), 22 deletions(-) create mode 100644 Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits