Skip to content

source_group: make TREE work without FILES

According to the documentation of source_group() the FILES parameter is optional, but that was actually not the case. When using

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR})

cmake did not automatically create the source tree, but recognized it as the old syntax. With this patch, cmake recognizes it as TREE syntax if the first argument is TREE followed by a directory. Then, if no files are given, it defaults to all files in the directory. PREFIX works too. So basically this patch makes cmake work as already documented.

Fixes: #24590 (closed)
Topic-rename: source_group-TREE-no-FILES

Edited by Brad King

Merge request reports