summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetSourcesCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-04 14:09:26 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-04 14:09:31 (GMT)
commit65da32c924e97ad1e0e0ed0ea59644f87f770c34 (patch)
treea4d16152d59b4e08fb0d97b1bb88b0ba3c8f294a /Source/cmTargetSourcesCommand.cxx
parent31743aaf5d131b326fc05d07632cdb2844f26121 (diff)
parentb357d334fc0c2f47ebc6a3a2b0ceba25d4818bb0 (diff)
downloadCMake-65da32c924e97ad1e0e0ed0ea59644f87f770c34.zip
CMake-65da32c924e97ad1e0e0ed0ea59644f87f770c34.tar.gz
CMake-65da32c924e97ad1e0e0ed0ea59644f87f770c34.tar.bz2
Merge topic 'file-set-name-requirements' into release-3.23
b357d334fc target_sources(): Enforce stricter requirements for FILE_SET name Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7037
Diffstat (limited to 'Source/cmTargetSourcesCommand.cxx')
-rw-r--r--Source/cmTargetSourcesCommand.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx
index 17af789..43a9b3a 100644
--- a/Source/cmTargetSourcesCommand.cxx
+++ b/Source/cmTargetSourcesCommand.cxx
@@ -238,9 +238,10 @@ bool TargetSourcesImpl::HandleOneFileSet(
auto fileSet = this->Target->GetOrCreateFileSet(args.FileSet, type);
if (fileSet.second) {
if (!isDefault) {
- if (args.FileSet[0] >= 'A' && args.FileSet[0] <= 'Z') {
- this->SetError(
- "Non-default file set name must not start with a capital letter");
+ if (!cmFileSet::IsValidName(args.FileSet)) {
+ this->SetError("Non-default file set name must contain only letters, "
+ "numbers, and underscores, and must not start with a "
+ "capital letter or underscore");
return false;
}
}