diff options
author | Brad King <brad.king@kitware.com> | 2022-03-04 14:09:26 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-03-04 14:09:31 (GMT) |
commit | 65da32c924e97ad1e0e0ed0ea59644f87f770c34 (patch) | |
tree | a4d16152d59b4e08fb0d97b1bb88b0ba3c8f294a /Source/cmTargetSourcesCommand.cxx | |
parent | 31743aaf5d131b326fc05d07632cdb2844f26121 (diff) | |
parent | b357d334fc0c2f47ebc6a3a2b0ceba25d4818bb0 (diff) | |
download | CMake-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.cxx | 7 |
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; } } |