diff options
author | Brad King <brad.king@kitware.com> | 2023-10-24 12:27:06 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-10-24 12:27:20 (GMT) |
commit | b93e602e28f9efa3f8e4518cdd685a140a90d4a0 (patch) | |
tree | 1d8d3f7ad59c33de894d933f83645543b3361267 | |
parent | b99e99e1aa3125eca923221c976b3bc6ad8d6b09 (diff) | |
parent | 8bb949fc30677ea7a5c71b91f176dbbb12f15d5c (diff) | |
download | CMake-b93e602e28f9efa3f8e4518cdd685a140a90d4a0.zip CMake-b93e602e28f9efa3f8e4518cdd685a140a90d4a0.tar.gz CMake-b93e602e28f9efa3f8e4518cdd685a140a90d4a0.tar.bz2 |
Merge topic 'source_group-TREE-no-FILES' into release-3.28
8bb949fc30 source_group: Restore behavior of TREE with empty FILES
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8910
-rw-r--r-- | Source/cmSourceGroupCommand.cxx | 7 |
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) { |