mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 21:59:54 -06:00
Source_Group: Allow an empty prefix with the TREE syntax.
When calling
source_group(TREE <root> PREFIX "" FILES ...)
the files located at the root directory were not assigned
to the correct source group: they were put in a default
group (e.g. "Source Files" in Visual Studio).
Fixes: #17608
This commit is contained in:
@@ -101,9 +101,13 @@ bool addFilesToItsSourceGroups(const std::string& root,
|
||||
tokenizedPath = tokenizePath(sgFilesPath);
|
||||
}
|
||||
|
||||
if (tokenizedPath.size() > 1) {
|
||||
if (!tokenizedPath.empty()) {
|
||||
tokenizedPath.pop_back();
|
||||
|
||||
if (tokenizedPath.empty()) {
|
||||
tokenizedPath.push_back("");
|
||||
}
|
||||
|
||||
sg = makefile.GetOrCreateSourceGroup(tokenizedPath);
|
||||
|
||||
if (!sg) {
|
||||
|
||||
Reference in New Issue
Block a user