View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012943CMakeCMakepublic2012-02-07 17:282013-07-01 09:37
ReporterMichael Pechner 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformappleOSosxOS Version10.6
Product VersionCMake 2.8.4 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0012943: Make code groups in xcode match visual studio
DescriptionWe have a product where 2 of the platforms are windown and osx. The groupings of files in xcode should match visual studio.

I am submitting this in behalf of another engineer that left the company. I am submitting this myself because it is the only way to contribute changes back. OY!

Here is his explanation:


So the source group change fixed a problem specific to Xcode. It's possible to specify a "\\" delimited directory structure as a group name. So you can do the following:

source_group( foo foo.c)
source_group( foo\\bar bar.c)

In the VS generator that makes a group foo that contains a group bar and the file foo.c. The group bar contains the file bar.c This behavior is documented.

Those same lines in the the xcode generator create two groups. One is called foo and contains foo.c. The other is called "foo/bar" and contains bar.c. This behavior is not documented

The change corrects the xcode generator behavior to match that of the visual studio generator/documentation.

If memory serves... The code that was added iterates over the platform-independent source_group data structure the right way (which preserves nesting in a recursive fashion) rather than just enumerating every possible group and adding them without nesting. The diff should be helpful here, because I believe I checked the whole thing in as a single change.
Additional InformationI'll include a diff of when we did for both cmGlobalXCodeGenerator.cxx and cmGlobalXCodeGenerator.h
The diff is between 2.8.4 and 2.8.7.

Here is the .h file diff:

89,91d88
< cmXCodeObject* CreateSourceGroup(cmSourceGroup& sg,
< cmTarget& cmtarget,
< bool child_group);
93,94c90,92
< cmSourceGroup* sg,
< bool target_child);
---
> cmSourceGroup* sg);
> cmXCodeObject* CreatePBXGroup(cmXCodeObject *parent,
> cmStdString name);
127a126,127
> std::string GetOrCreateId(const char* name, const char* id);
>
197,198c197,198
< virtual const char* GetInstallTargetName() { return "install"; }
< virtual const char* GetPackageTargetName() { return "package"; }
---
> virtual const char* GetInstallTargetName() const { return "install"; }
> virtual const char* GetPackageTargetName() const { return "package"; }
201a202
> std::set<cmStdString> XCodeObjectIDs;
204a206,208
> void addObject(cmXCodeObject *obj);
> std::string PostBuildMakeTarget(std::string const& tName,
> std::string const& configName);
TagsNo tags attached.
Attached Filestxt file icon cmGlobalXCodeGenerator_cxx.txt [^] (23,950 bytes) 2012-02-07 17:28 [Show Content]
patch file icon 0001-Fixed-nested-source-group-handling-in-Xcode-generato.patch [^] (907 bytes) 2012-09-28 16:06 [Show Content]

 Relationships

  Notes
(0030359)
David Cole (manager)
2012-08-11 21:09

Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0031110)
Mad Fish (reporter)
2012-09-28 16:07

Attached a trivial patch that solves the problem.
(0032332)
Brad King (manager)
2013-02-18 11:12

Patch 0001-Fixed-nested-source-group-handling-in-Xcode-generato.patch applied here:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0816caec [^]
(0032333)
Brad King (manager)
2013-02-18 11:13

Resolving as fixed. Please re-open if there are additional differences this does not address.
(0033428)
Robert Maynard (manager)
2013-07-01 09:37

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-02-07 17:28 Michael Pechner New Issue
2012-02-07 17:28 Michael Pechner File Added: cmGlobalXCodeGenerator_cxx.txt
2012-08-11 21:09 David Cole Status new => backlog
2012-08-11 21:09 David Cole Note Added: 0030359
2012-09-28 16:06 Mad Fish File Added: 0001-Fixed-nested-source-group-handling-in-Xcode-generato.patch
2012-09-28 16:07 Mad Fish Note Added: 0031110
2013-02-18 11:12 Brad King Note Added: 0032332
2013-02-18 11:13 Brad King Note Added: 0032333
2013-02-18 11:13 Brad King Status backlog => resolved
2013-02-18 11:13 Brad King Resolution open => fixed
2013-02-18 11:13 Brad King Fixed in Version => CMake 2.8.11
2013-02-18 11:13 Brad King Target Version => CMake 2.8.11
2013-07-01 09:37 Robert Maynard Note Added: 0033428
2013-07-01 09:37 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team