summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceGroupCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSourceGroupCommand.cxx')
-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) {