MantisBT - CMake
View Issue Details
0013370CMakeCMakepublic2012-07-02 17:352016-06-10 14:31
LordJZ 
Kitware Robot 
normalfeaturealways
closedmoved 
Windows
CMake 2.8.8 
 
0013370: Visual Studio filter tree as source directory tree (with patch)
Currently, CMake groups the source files into 'Header Files', 'Source Files', etc. When there are quite a lot of files, it becomes hard to navigate through this mess.

A lot of other IDEs make the same solution tree as directory tree. Netbeans in particular.

I have created a rough patch to implement this feature for Visual Studio.

Links:
My CMake fork with this feature: https://github.com/LordJZ/CMake/commits/master [^]
Direct patch file: https://dl.dropbox.com/u/9241118/cmake.patch [^] (also attached)
An example of the resulting tree: https://dl.dropbox.com/u/9241118/cmake-file-tree-respect-trinitycore.png [^]
Compiled binaries for Windows: https://github.com/downloads/LordJZ/CMake/cmake-file-tree-respect.7z [^] (no dependencies)

There are some issues of the patch:
1) Works for Visual Studio 10 (2010 pre-release), Visual Studio 2010, Visual Studio 11 (2012 pre-release), and Visual Studio 2012.
2) My changes are not yet fixed to fit CMake coding style.
3) The patch eliminates in-Studio view of source groups (though they are not seen in other IDEs). Seems to deprecate bug 0011229.
4) Is possibly still affected by bug 0007921.

RFC.
No tags attached.
patch cmake.patch (7,449) 2012-07-02 17:35
https://public.kitware.com/Bug/file/4375/cmake.patch
Issue History
2012-07-02 17:35LordJZNew Issue
2012-07-02 17:35LordJZFile Added: cmake.patch
2012-07-02 17:44LordJZNote Added: 0029886
2012-07-02 17:45LordJZNote Edited: 0029886bug_revision_view_page.php?bugnote_id=29886#r721
2012-07-02 17:45LordJZNote Edited: 0029886bug_revision_view_page.php?bugnote_id=29886#r722
2012-07-02 17:46LordJZNote Edited: 0029886bug_revision_view_page.php?bugnote_id=29886#r723
2012-07-02 17:47LordJZNote Edited: 0029886bug_revision_view_page.php?bugnote_id=29886#r724
2012-07-02 17:53LordJZNote Edited: 0029886bug_revision_view_page.php?bugnote_id=29886#r725
2012-07-09 09:53Brad KingNote Added: 0030003
2016-06-10 14:28Kitware RobotNote Added: 0042077
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0029886)
LordJZ   
2012-07-02 17:44   
(edited on: 2012-07-02 17:53)
Related:
0002665
http://www.cmake.org/pipermail/cmake/2009-May/029340.html [^]
www.mail-archive.com/cmake@cmake.org/msg19509.html ( no copy-paste url: http://bit.ly/M1ndsg [^] )
http://www.cmake.org/Wiki/CMake_FAQ#How_To_Put_Files_in_Folders_in_Visual_Studio_Projects [^]
http://www.cmake.org/Wiki/CMake_User_Contributed_Macros#Visual_Studio_generator_helpers [^]

Related, but not affected:
0010555, 0009863, 0010154

(0030003)
Brad King   
2012-07-09 09:53   
This will be a nice feature. I think it should be enabled explicitly for two reasons:

(a) It will preserve behavior for existing projects
(b) It gives us a place to explicitly specify the common base path

The latter is especially important because adding/removing one source in a sibling directory to the previously-highest common path will change the entire structure.

Something like:

 set_property(TARGET myexe PROPERTY VS_GROUP_BY_DIR ${CMAKE_CURRENT_SOURCE_DIR})

To avoid setting it explicitly on every target we can add a SetPropertyDefault call in cmTarget to initialize the property from a "CMAKE_VS_GROUP_BY_DIR" variable.
(0042077)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.