[CMake] SOURCE_GROUP does not function in Visual Studio 8

Bill Hoffman bill.hoffman at kitware.com
Sat Feb 17 11:41:21 EST 2007


Matthieu Brucher wrote:
> Hi,
>
> I tried to group sources in my app, but the sources and headers were 
> grouped together, and not in the correct folders.
>
> Example :
>
> SOURCE_GROUP(Source\ Files\\Base FILES ${SFML_BASE_SRCS})
> SOURCE_GROUP(Source\ Files\\Fonts FILES ${SFML_FONTS_SRCS})
> SOURCE_GROUP(Source\ Files\\Graphics FILES ${SFML_GRAPHICS_SRCS})
>
> SOURCE_GROUP(Header\ Files\\Base FILES ${SFML_BASE_HEADERS})
> SOURCE_GROUP(Header\ Files\\Fonts FILES ${SFML_FONTS_HEADERS})
> SOURCE_GROUP(Header\ Files\\Graphics FILES ${SFML_GRAPHICS_HEADERS})
>
>
> The Fonts files were in "Header Files\\Fonts", Base files in "Source 
> Files\\Base" and Graphics in "Source Files\\Graphics".
> Not really what I expected... I tried to find in the bug tracker if 
> something like this was already reported, but did not find...
Try this:
SOURCE_GROUP("Source Files/Base" FILES ${SFML_BASE_SRCS})
Also, add some message(${SFML_....} ) calls to make sure the variables 
have what you expect them to.
If you still have problems, please post a complete example that can be 
tested.

-Bill




More information about the CMake mailing list