MantisBT - CMake
View Issue Details
0013611CMakeCMakepublic2012-10-27 05:282013-04-17 08:54
tzeH 
David Cole 
normalminoralways
closedfixed 
 
CMake 2.8.11CMake 2.8.11 
0013611: SOURCE_GROUP doesn't use last match
I use a main CMake file and an include with source_group commands.

Using the SOURCE_GROUP commands like this:

SOURCE_GROUP( Tests\\Project REGULAR_EXPRESSION tests/Project/.* )
SOURCE_GROUP( Tests\\Project\\GUI REGULAR_EXPRESSION tests/Project/GUI/.* )
SOURCE_GROUP( Tests\\Project\\DSP REGULAR_EXPRESSION tests/Project/DSP/.* )
SOURCE_GROUP( Tests\\Project\\math REGULAR_EXPRESSION tests/Project/math/.* )

does not create three sub-folders as it should according to the documentation: "If no group explicitly lists the file, the LAST group whose regular expression matches the file will be favored."
Removing the first entry gives me three subfolders, but I want the files in tests/Project to be in a folder and not in "Source Files".

I found this with the Visual Studio 2010 generators.
No tags attached.
related to 0004395closed David Cole SOURCE_GROUP override broken with recursive groups 
related to 0008711closed David Cole SOURCE_GROUP priorities not working 
patch 0001-Source_groups-needed-to-check-their-own-regex-after-.patch (1,075) 2012-10-28 04:56
https://public.kitware.com/Bug/file/4548/0001-Source_groups-needed-to-check-their-own-regex-after-.patch
Issue History
2012-10-27 05:28tzeHNew Issue
2012-10-27 08:53David ColeNote Added: 0031346
2012-10-28 04:56tzeHFile Added: 0001-Source_groups-needed-to-check-their-own-regex-after-.patch
2012-10-28 04:58tzeHNote Added: 0031348
2012-10-28 04:59tzeHNote Edited: 0031348bug_revision_view_page.php?bugnote_id=31348#r885
2012-10-28 09:16David ColeAssigned To => David Cole
2012-10-28 09:16David ColeStatusnew => assigned
2012-10-28 09:16David ColeTarget Version => CMake 2.8.11
2012-10-28 09:22David ColeRelationship addedrelated to 0004395
2012-10-28 09:22David ColeRelationship addedrelated to 0008711
2012-11-23 11:28David ColeNote Added: 0031682
2012-11-23 11:28David ColeStatusassigned => resolved
2012-11-23 11:28David ColeFixed in Version => CMake 2.8.11
2012-11-23 11:28David ColeResolutionopen => fixed
2012-11-23 11:28David ColeNote Added: 0031683
2013-04-17 08:54Robert MaynardNote Added: 0032878
2013-04-17 08:54Robert MaynardStatusresolved => closed

Notes
(0031346)
David Cole   
2012-10-27 08:53   
Searching for SOURCE_GROUP in the bug database, I see 26 other bugs that are related to SOURCE_GROUP... I think one of them probably already reports a problem substantially similar/related to this one, but no CMake developers have given the SOURCE_GROUP problems attention yet.

If you can attach a "git format-patch -1" file to fix the problem, we'll consider it.

Thx
(0031348)
tzeH   
2012-10-28 04:58   
(edited on: 2012-10-28 04:59)
Hi David, I attached a fix for this problem that works for me.

The problem was, that cmSourceGroup::MatchChildrenRegex checked it's own regex before trying it's children's.

This should also fix 0004395 and 0008711 (of which this is a duplicate).

(0031682)
David Cole   
2012-11-23 11:28   
Fix pushed and merged to CMake 'next' branch:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00e96808aa3729a6b385818643249ea2130cbef1 [^]
(0031683)
David Cole   
2012-11-23 11:28   
I verified (manually) that the fix works with Visual Studio 10 and Xcode generators.
(0032878)
Robert Maynard   
2013-04-17 08:54   
Closing resolved issues that have not been updated in more than 4 months.