source_group and target_sources with file_set headers conflict
In one of my projects I have a cmake file, containing:
target_sources(exampleproject
PUBLIC FILE_SET HEADERS FILES
ExampleHeader.h
PUBLIC FILE_SET examplelib TYPE HEADERS BASE_DIRS examplelib/include FILES
${headers_examplelib}
)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/examplelib/include PREFIX "Header Files/examplelib" FILES ${headers_examplelib})
However, if I generate a Visual Studio solution (cmake -G "Visual Studio 17 2022" -A x64 ..
), the subgroup is not created under Header Files
(every file will be added to the root of Header Files
).
When I change Header Files
to an other value (including it will work. When adding non-header files to another subdirectory of a default source group (like Source Files
)Source Files
) will also work.
My belief is that the fileset generated by target_sources somehow conflict with the settings inside source_group?
Edited by Bert de Vreugd