summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-10-23 14:53:28 (GMT)
committerBrad King <brad.king@kitware.com>2023-10-23 14:53:28 (GMT)
commit8bb949fc30677ea7a5c71b91f176dbbb12f15d5c (patch)
treedf49d3756117f4b29fbdb09eec2794274ddb2d04
parent34c51a385bd0d3583f39444830012ed00b99a353 (diff)
downloadCMake-8bb949fc30677ea7a5c71b91f176dbbb12f15d5c.zip
CMake-8bb949fc30677ea7a5c71b91f176dbbb12f15d5c.tar.gz
CMake-8bb949fc30677ea7a5c71b91f176dbbb12f15d5c.tar.bz2
source_group: Restore behavior of TREE with empty FILES
Since commit d85238a2f2 (source_group: Fix TREE without FILES, 2023-06-29, v3.28.0-rc1~399^2~1) we incorrectly treat a FILES argument with no values as if it were not given at all. Fixes: #25353
-rw-r--r--Source/cmSourceGroupCommand.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx
index 4b1685f..bb92856 100644
--- a/Source/cmSourceGroupCommand.cxx
+++ b/Source/cmSourceGroupCommand.cxx
@@ -280,8 +280,11 @@ static bool processTree(cmMakefile& mf, ParsedArguments& parsedArguments,
? ""
: parsedArguments[kPrefixOptionName].front();
- std::vector<std::string> files = parsedArguments[kFilesOptionName];
- if (files.empty()) {
+ std::vector<std::string> files;
+ auto filesArgIt = parsedArguments.find(kFilesOptionName);
+ if (filesArgIt != parsedArguments.end()) {
+ files = filesArgIt->second;
+ } else {
const std::vector<std::unique_ptr<cmSourceFile>>& srcFiles =
mf.GetSourceFiles();
for (const auto& srcFile : srcFiles) {