MantisBT - CMake
View Issue Details
0010039CMakeCMakepublic2009-12-11 17:432013-05-10 10:55
Glenn Hughes 
Brad King 
normalminoralways
closedfixed 
CMake-2-8 
CMake 2.8.5CMake 2.8.5 
0010039: Xcode gen only creates one level of group nesting
I'm trying to use the source_group command with XCode, and its marginally working, but in a flaky sorta way.

The behavior I'm seeing is:
Groups in the form

 source_group( Name FILES ${source} )

Work OK, they add a top-level group to the current target's file list (i.e. Sources/Target/Name)

 source_group( Name/SubName FILES ${source} )

XCode treats this as a single name, in other words I get groups named
"Name/SubName"

 source_group( Name\SubName FILES ${source} )
and
 source_group( Name\\SubName FILES ${source} )

have the same behavior: The parent group name is dropped. I simply get
groups named SubName.

(Note in these examples I'm talking about the resulting text string, not the string literal in my CMakeLists file, which requires more backslashes to produce the same result, i.e. in CMake src Name\\\\SubName produces Name\\SubName)

In short, the most nested group you can create is
Source/Target/Group
You can not create
Source/Target/Group/SubGroup
No tags attached.
related to 0014133closed Brad King CMake creates duplicate target subfolders in Xcode project files 
patch 0001-Cmake-Xcode-Support-multiple-level-nesting-of-XCode-.patch (5,020) 2011-02-15 08:37
https://public.kitware.com/Bug/file/3696/0001-Cmake-Xcode-Support-multiple-level-nesting-of-XCode-.patch
patch 2-Cmake-Xcode-Support-multiple-level-nesting-of-XCode-.patch (7,722) 2011-02-15 09:33
https://public.kitware.com/Bug/file/3698/2-Cmake-Xcode-Support-multiple-level-nesting-of-XCode-.patch
patch 3-code-Support-multiple-level-nesting-of-XCode-.patch (8,446) 2011-02-15 13:34
https://public.kitware.com/Bug/file/3703/3-code-Support-multiple-level-nesting-of-XCode-.patch
patch 0002-XCode-Support-target-folders-on-XCode.patch (2,579) 2011-02-20 09:12
https://public.kitware.com/Bug/file/3711/0002-XCode-Support-target-folders-on-XCode.patch
Issue History
2009-12-11 17:43Glenn HughesNew Issue
2010-12-14 17:36David ColeAssigned To => David Cole
2010-12-14 17:36David ColeStatusnew => assigned
2011-02-15 08:37Johan BjörkFile Added: 0001-Cmake-Xcode-Support-multiple-level-nesting-of-XCode-.patch
2011-02-15 08:37Johan BjörkNote Added: 0025431
2011-02-15 09:33Johan BjörkFile Added: 2-Cmake-Xcode-Support-multiple-level-nesting-of-XCode-.patch
2011-02-15 09:33Johan BjörkNote Added: 0025434
2011-02-15 13:34Johan BjörkFile Added: 3-code-Support-multiple-level-nesting-of-XCode-.patch
2011-02-15 13:34Johan BjörkNote Added: 0025442
2011-02-20 09:12Johan BjörkFile Added: 0002-XCode-Support-target-folders-on-XCode.patch
2011-02-20 09:12Johan BjörkNote Added: 0025526
2011-04-14 14:29David ColeTarget Version => CMake 2.8.5
2011-06-07 11:35Brad KingAssigned ToDavid Cole => Brad King
2011-06-07 11:41Brad KingNote Added: 0026741
2011-06-08 15:45Brad KingStatusassigned => resolved
2011-06-08 15:45Brad KingFixed in Version => CMake 2.8.5
2011-06-08 15:45Brad KingResolutionopen => fixed
2011-11-11 10:45David ColeNote Added: 0027764
2011-11-11 10:45David ColeStatusresolved => closed
2013-05-10 10:55Brad KingRelationship addedrelated to 0014133

Notes
(0025431)
Johan Björk   
2011-02-15 08:37   
Hi everyone,

Attached a patch which solves the issue. I don't know where a good place for tokenize() is, in the patch, the code was copied from cmSourceGroupCommand.cxx.

David, if you tell me where a good place for tokenize() is I can move both copies there.

/Johan
(0025434)
Johan Björk   
2011-02-15 09:33   
Moved it to cmSystemTools.cxx.
(0025442)
Johan Björk   
2011-02-15 13:34   
Latest patch just removes some codeduplication.
(0025526)
Johan Björk   
2011-02-20 09:12   
While working on this, I noticed it would be trivial to add target Folder support. Attached patch is based of the previous patch and adds support for USE_FOLDERS.
(0026741)
Brad King   
2011-06-07 11:41   
I've applied Johan's patches. I split the first one into two commits:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d0a403fd [^]
  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59ed84e0 [^]
  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eeeeca10 [^]
(0027764)
David Cole   
2011-11-11 10:45   
Closing resolved issues that have not been updated in more than 4 months.