[CMake] Bug in SOURCE_GROUP command?

Tal Blum tblum at bbn.com
Wed Aug 22 21:33:58 EDT 2007


When I execute the following MACRO with a list of files I get a strange
behavior creating a MSVS solution.

 

# create hierarchical source groups

MACRO ( GENERATE_PROJECT ProjectDir ProjectSources )  

   SET ( DirSources ${ProjectSources} )

   FOREACH ( Source ${DirSources} )

     STRING ( REGEX REPLACE "${ProjectDir}" "" RelativePath "${Source}" )

     STRING ( REGEX REPLACE "[\\\\/][^\\\\/]*$" "" RelativePath
"${RelativePath}" )

     STRING ( REGEX REPLACE "^[\\\\/]" "" RelativePath "${RelativePath}" )

     STRING ( REGEX REPLACE "/" "\\\\\\\\" RelativePath "${RelativePath}" )

     SOURCE_GROUP ( "${RelativePath}" FILES ${Source} )

   ENDFOREACH ( Source )

ENDMACRO ( GENERATE_PROJECT )

 

When the list of files is:

aaa/reader/file1.cpp

bbb/reader/file2.cpp

 

The bug is that both files are mapped into the same directory in the MSVS
project (bbb/reader).

When I change one of the directories into a different name (e.g. reader2) it
works fine and the files are mapped into 2 different directories. Is this a
bug or am I doing something wrong? If so, when can it be fixed?

 

Thanks, Tal

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070822/2e1207d5/attachment.html


More information about the CMake mailing list