Merge topic 'fix-cmp0211-doc'

228795753f FILE_SET: Fix CMP0211-related documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12119
This commit is contained in:
Brad King
2026-06-02 09:19:40 -04:00
committed by Kitware Robot
5 changed files with 16 additions and 13 deletions
+2 -2
View File
@@ -80,8 +80,8 @@ have zero or more named file sets. Each file set has a name, a type, a scope of
files within those directories.
.. versionchanged:: 4.4
A file may only belong to at most one file set in a target. See policy
:policy:`CMP0211`.
A file may belong to at most one non-``HEADERS`` file set in a target.
See policy :policy:`CMP0211`.
The acceptable types include:
+1 -1
View File
@@ -108,7 +108,7 @@ Policies Introduced by CMake 4.4
CMP0214: Honor CMAKE_EXE_LINKER_FLAGS for Swift executable targets. </policy/CMP0214>
CMP0213: file(ARCHIVE_{CREATE,EXTRACT}) encode archive paths as UTF-8 by default. </policy/CMP0213>
CMP0212: add_custom_command DEPENDS does not strip .exe suffixes. </policy/CMP0212>
CMP0211: A file may belong to at most one file set in a target. </policy/CMP0211>
CMP0211: A file may belong to at most one non-HEADERS file set in a target. </policy/CMP0211>
Policies Introduced by CMake 4.3
--------------------------------
+2 -2
View File
@@ -3,8 +3,8 @@ CMP0211
.. versionadded:: 4.4
A file may belong to at most one :ref:`file set <file sets>` in a target except
for the ``HEADERS`` file set type.
A file may belong to at most one non-``HEADERS`` :ref:`file set <file sets>`
in a target.
In CMake 4.3 and below, it was possible to specify the same file
in multiple file sets in a target. In CMake 4.4 and above, a file
+3 -2
View File
@@ -631,8 +631,9 @@ class cmMakefile;
"CMAKE_<LANG>_LINK_FLAGS adds link flags to all target types.", 4, \
3, 0, WARN) \
SELECT(POLICY, CMP0211, \
"A file may belong to at most one file set in a target.", 4, 4, 0, \
WARN) \
"A file may belong to at most one non-HEADERS file set in a " \
"target.", \
4, 4, 0, WARN) \
SELECT(POLICY, CMP0212, \
"add_custom_command DEPENDS does not strip .exe suffixes.", 4, 4, 0, \
WARN) \
@@ -1,7 +1,8 @@
CMake Warning \(policy\) in CMakeLists\.txt:
Policy CMP0211 is not set: A file may belong to at most one file set in a
target\. Run "cmake --help-policy CMP0211" for policy details\. Use the
cmake_policy command to set the policy and suppress this warning\.
Policy CMP0211 is not set: A file may belong to at most one non-HEADERS
file set in a target\. Run "cmake --help-policy CMP0211" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
In target "foo1" the file
@@ -12,9 +13,10 @@ This warning is for project developers\. Use -Wno-author or -Wno-policy to
suppress it\.
CMake Warning \(policy\) in CMakeLists\.txt:
Policy CMP0211 is not set: A file may belong to at most one file set in a
target\. Run "cmake --help-policy CMP0211" for policy details\. Use the
cmake_policy command to set the policy and suppress this warning\.
Policy CMP0211 is not set: A file may belong to at most one non-HEADERS
file set in a target\. Run "cmake --help-policy CMP0211" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
In target "foo2" the file