MantisBT - CMake
View Issue Details
0002331CMakeCMakepublic2005-10-05 19:322016-06-10 14:30
Andrew Maclean 
Bill Hoffman 
urgentmajoralways
closedmoved 
 
 
0002331: Empty Source Group are not created
1) Subdirectories are not created if the parent is empty.
2) CMake seems to only perform a partial match on source group directories.

Details are below:


This code fragment seems to work OK:
#---------------------------------------------------------------------------
--
  # Source Groups.
 
#---------------------------------------------------------------------------
--
  SET( SOURCE_GROUP_NAME "GPSLib" )
  SET( SOURCE_GROUP_NAME_INC "${SOURCE_GROUP_NAME}/Includes" )
  SET( SOURCE_GROUP_NAME_SRC "${SOURCE_GROUP_NAME}/Sources" )

  IF ( WIN32 )
    STRING( REGEX REPLACE "/" "\\\\" SOURCE_GROUP_NAME_INC ${SOURCE_GROUP_NAME_INC} )
    STRING( REGEX REPLACE "/" "\\\\" SOURCE_GROUP_NAME_SRC ${SOURCE_GROUP_NAME_SRC} )
  ENDIF ( WIN32 )

  SOURCE_GROUP ( ${SOURCE_GROUP_NAME_INC} FILES ${GPS_INCS} )
  SOURCE_GROUP ( ${SOURCE_GROUP_NAME} FILES ${GPS_SRCS} )

We get in the Visual Studio solution explorer GPsLib full of .cpp files and a subdirectory Include full of *.h files.

If I substitute SOURCE_GROUP_NAME_SRC for SOURCE_GROUP_NAME in the last line above, I expect to get an empty GPSLib directory and two subdirectories Source and Include. However GPSLib is not created at all in this case. It seems that CMake will not create an empty directory in this case. Even though the subdirectories are not empty. I can do this manually in Visual Studio so I don't think it is a Visual Studio issue.


CMake seems to only do a partial match on the names for source groups. E.g If we have a source group X/Y and another source group Z/Y then files which we intend to go into Z/Y will in fact go into X/Y and Z/Y is never created even though Z exists.
No tags attached.
Issue History
2007-08-24 14:23Alex NeundorfNote Added: 0008659
2007-08-24 14:23Alex NeundorfStatusnew => assigned
2007-08-24 14:23Alex NeundorfSummarySource Group Problem => Empty Source Group are not created
2016-06-10 14:27Kitware RobotNote Added: 0041300
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionreopened => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0004117)
Michael Rans   
2006-05-23 12:10   
Please fix this outstanding bug.
(0004151)
Brad King   
2006-05-30 11:22   
It looks like this bug was created by the patch submitted for bug 0001965.
(0005166)
Bill Hoffman   
2006-10-04 14:21   
IS this still broken in CVS?
(0005217)
Andrew Maclean   
2006-10-04 19:39   
I am pretty sure it is fixed - noone here is complaining.
(0007649)
Christopher Lux   
2007-05-15 03:22   
i do not know why it has not come up yet. this bug is still open and was introduced by the said patch!

here the followup bugs:

http://www.cmake.org/Bug/bug.php?op=show&bugid=4637&pos=1 [^]

i sent an email to bill hoffman with the locations of the bug, i hope he will fix it...
(0008659)
Alex Neundorf   
2007-08-24 14:23   
Issue 2) is fixed now in cvs.
(0041300)
Kitware Robot   
2016-06-10 14:27   
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.