MantisBT - CMake
View Issue Details
0004637CMakeCMakepublic2007-03-20 06:232007-08-24 11:03
Christopher Lux 
Alex Neundorf 
urgentmajoralways
closedduplicate 
 
 
0004637: problem with SOURCE_GROUPS and non code files
the example below demonstrates the bug. i get all files in subdirectories and assign them source groups for use in visual studio. with code files this works great but with non directly code related files this is broken. for example here the .glsl files. i assign the two groups to two subdirectories but in the final project all files show up in the first group only and the second one is not created.

thanks
-chris

FILE(GLOB SHADER_FILES_VOLUME_RENDERER ${SRC_DIR}/volume_renderer/shader/*.glsl)

FILE(GLOB SHADER_FILES ${SRC_DIR}/shader/*.glsl)

# define source groups for visual studio project files
SET(SOURCE_GROUP_DELIMITER "/")

SOURCE_GROUP(source_files FILES ${SOURCE_FILES} ${HEADER_FILES} ${INLINE_FILES})
SOURCE_GROUP(source_files/shader FILES ${SHADER_FILES})
SOURCE_GROUP(source_files/volume_renderer/shader FILES ${SHADER_FILES_VOLUME_RENDERER})

# combine source file lists
SET(SOURCE_FILES
    ${SOURCE_FILES}
    ...
)

SET(HEADER_FILES
    ${HEADER_FILES}
    ...
)

SET(INLINE_FILES
    ${INLINE_FILES}
    ...
)

SET(SHADER_FILES
    ${SHADER_FILES}
    ${SHADER_FILES_VOLUME_RENDERER}
)

# include header and inline files in source files for visual studio projects
IF (WIN32)
    IF (MSVC)
        SET (SOURCE_FILES ${SOURCE_FILES} ${HEADER_FILES} ${INLINE_FILES} ${SHADER_FILES})
    ENDIF (MSVC)
ENDIF (WIN32)
No tags attached.
patch CMake_recursive_source_groups.patch (4,908) 1969-12-31 19:00
https://public.kitware.com/Bug/file/1004/CMake_recursive_source_groups.patch
Issue History
2007-08-24 11:03Alex NeundorfNote Added: 0008650
2007-08-24 11:03Alex NeundorfStatusassigned => closed
2007-08-24 11:03Alex NeundorfResolutionopen => duplicate

Notes
(0007633)
Christopher Lux   
2007-05-14 08:17   
i just noticed that this also happens with code files. so if you want to create two source groups a/b and c/b than c/b will not be created and all files will be added to a/b. this is very annoying behavior. please look into it...

-chris
(0007666)
Christopher Lux   
2007-05-16 18:16   
ok ,i created a patch for the bugs introduced by the patch to bug #1964 [1]

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

i hope this will get reviewed and fixed in the cvs, i can not believe that this is not getting any attention for years!
(0007667)
Christopher Lux   
2007-05-17 03:42   
sorry i mean the patch submitted to bug 0001965...
(0008650)
Alex Neundorf   
2007-08-24 11:03   
Duplicate of 0004057, more comments please over there.