Add support of generator expressions for source_group()
Generator expressions are not working for source_group command(as least for Visual Studio). I have to write following text to add app.rc into "Resource Files" group.
set(Resource_Files
"app.rc"
)
source_group("Resource Files" FILES ${Resource_Files})
set(ALL_FILES
${Header_Files}
$<$<BOOL:${WIN32}>:${Resource_Files}>
${Source_Files}
)
add_executable(${PROJECT_NAME} ${ALL_FILES})
I would like to write like following snippet:
set(Resource_Files
"$<$<BOOL:${WIN32}>:app.rc>"
)
source_group("Resource Files" FILES ${Resource_Files})
set(ALL_FILES
${Header_Files}
${Resource_Files}
${Source_Files}
)
add_executable(${PROJECT_NAME} ${ALL_FILES})
This approach is more flexible and allows to handle other files of this group at one place depending on conditions.
Current behaviour is that file placed into root source group(name of the group is ignored).
I'm using CMake 3.13.4