summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceGroup.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-08-24 18:14:09 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2022-08-24 20:07:24 (GMT)
commit970052feddcb49f52b49e04a9edd7cb5e9085859 (patch)
treee57a8c955889ef220b6fd9cec1904d19256fa41e /Source/cmSourceGroup.cxx
parentbcc396581387582acec736dcfac577f477f60821 (diff)
downloadCMake-970052feddcb49f52b49e04a9edd7cb5e9085859.zip
CMake-970052feddcb49f52b49e04a9edd7cb5e9085859.tar.gz
CMake-970052feddcb49f52b49e04a9edd7cb5e9085859.tar.bz2
FILE_SET: Fix source group detection
Call MatchChildrenFiles() instead of MatchesFiles() in order to account for files being in subgroups of source groups. Fixes: #23880
Diffstat (limited to 'Source/cmSourceGroup.cxx')
-rw-r--r--Source/cmSourceGroup.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx
index 155068cb..6019de1 100644
--- a/Source/cmSourceGroup.cxx
+++ b/Source/cmSourceGroup.cxx
@@ -124,6 +124,21 @@ cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const std::string& name)
return nullptr;
}
+const cmSourceGroup* cmSourceGroup::MatchChildrenFiles(
+ const std::string& name) const
+{
+ if (this->MatchesFiles(name)) {
+ return this;
+ }
+ for (const cmSourceGroup& group : this->Internal->GroupChildren) {
+ const cmSourceGroup* result = group.MatchChildrenFiles(name);
+ if (result) {
+ return result;
+ }
+ }
+ return nullptr;
+}
+
cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const std::string& name)
{
for (cmSourceGroup& group : this->Internal->GroupChildren) {