mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-23 14:48:19 -05:00
CMP0118: Revise documentation to describe actual behavior
The policy was originally intended to make the `GENERATED` source file property globally visible, but the implementation didn't fully achieve that goal. Revise the documentation to describe what it actually does. Issue: #25437
This commit is contained in:
@@ -171,7 +171,7 @@ Policies Introduced by CMake 3.20
|
||||
|
||||
CMP0120: The WriteCompilerDetectionHeader module is removed. </policy/CMP0120>
|
||||
CMP0119: LANGUAGE source file property explicitly compiles as language. </policy/CMP0119>
|
||||
CMP0118: The GENERATED source file property is now visible in all directories. </policy/CMP0118>
|
||||
CMP0118: GENERATED sources may be used across directories without manual marking. </policy/CMP0118>
|
||||
CMP0117: MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default. </policy/CMP0117>
|
||||
CMP0116: Ninja generators transform DEPFILEs from add_custom_command(). </policy/CMP0116>
|
||||
CMP0115: Source file extensions must be explicit. </policy/CMP0115>
|
||||
|
||||
+17
-12
@@ -3,25 +3,30 @@ CMP0118
|
||||
|
||||
.. versionadded:: 3.20
|
||||
|
||||
The :prop_sf:`GENERATED` source file property is now visible in all directories.
|
||||
:prop_sf:`GENERATED` sources may be used across directories without manual marking.
|
||||
|
||||
In CMake 3.19 and below, the :prop_sf:`GENERATED` source file property,
|
||||
like other source file properties, was scoped in every directory separately.
|
||||
If a source file was generated in one directory, projects had to manually
|
||||
set the ``GENERATED`` property in another directory in order to use the file.
|
||||
|
||||
Whether or not a source file is generated is an all-or-nothing global
|
||||
property of the source. Consequently, the associated ``GENERATED``
|
||||
property is now visible from any directory scope, not only from the scope
|
||||
for which it was set.
|
||||
|
||||
property of the source: a source is either generated or it is not.
|
||||
CMake 3.20 and above prefer to allow source files generated in one directory
|
||||
to be used in other directories without manually marking them as ``GENERATED``.
|
||||
Additionally, the ``GENERATED`` property may now be set only to boolean
|
||||
values, and may not be turned off once turned on.
|
||||
values, and may not be turned off once turned on. This policy provides
|
||||
compatibility for projects that have not been updated for this behavior.
|
||||
|
||||
The ``OLD`` behavior of this policy is to only allow ``GENERATED`` to be
|
||||
visible from the directory scope for which it was set. The ``NEW``
|
||||
behavior on the other hand allows it to be visible from any scope.
|
||||
The ``OLD`` behavior of this policy is to allow generated files to be used
|
||||
only in directories in which their ``GENERATED`` property has been turned on.
|
||||
The ``NEW`` behavior of this policy is to allow generated files to be used
|
||||
in other directories without explicitly turning on the ``GENERATED`` property
|
||||
for those directories.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
|
||||
.. |WARNS_OR_DOES_NOT_WARN| replace::
|
||||
does *not* warn with regard to visibility of the ``GENERATED``
|
||||
property, but does warn about setting the ``GENERATED`` property
|
||||
to a non-boolean value,
|
||||
warns about setting the ``GENERATED`` property to a non-boolean value
|
||||
.. include:: STANDARD_ADVICE.txt
|
||||
|
||||
.. include:: DEPRECATED.txt
|
||||
|
||||
@@ -4,7 +4,11 @@ GENERATED
|
||||
Is this source file generated as part of the build or CMake process.
|
||||
|
||||
.. versionchanged:: 3.20
|
||||
The GENERATED source file property is now visible in all directories.
|
||||
Turning on the ``GENERATED`` source file property in one directory allows
|
||||
the associated source file to be used across directories without the need
|
||||
to manually setting that property for other directory scopes, too.
|
||||
Additionally, it may now be set only to boolean values, and may not be
|
||||
turned off once turned on. See policy :policy:`CMP0118`.
|
||||
|
||||
Tells the internal CMake engine that a source file is generated by an outside
|
||||
process such as another build step, or the execution of CMake itself.
|
||||
@@ -38,11 +42,3 @@ be shown. For the special case of sources generated by CMake's :prop_tgt:`AUTOMO
|
||||
:prop_gbl:`AUTORCC_SOURCE_GROUP` and :prop_gbl:`AUTOUIC_SOURCE_GROUP` target
|
||||
properties may influence where the generated sources are grouped in the project's
|
||||
file lists.
|
||||
|
||||
.. note::
|
||||
|
||||
Starting with CMake 3.20 the ``GENERATED`` source file property can be set
|
||||
and retrieved from any directory scope. It is an all-or-nothing property.
|
||||
It also can no longer be removed or unset if it was set to ``TRUE``. Policy
|
||||
:policy:`CMP0118` was introduced to allow supporting the ``OLD`` behavior
|
||||
for some time.
|
||||
|
||||
@@ -147,8 +147,9 @@ Properties
|
||||
for the associated :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` variable
|
||||
to allow for configuration of exporting compile commands per target.
|
||||
|
||||
* The :prop_sf:`GENERATED` source-file property is now visible
|
||||
from any directory scope, regardless of the scope in which it is set.
|
||||
* Generated sources may be used across directories without manual marking.
|
||||
Additionally, the :prop_sf:`GENERATED` source file property can no longer be
|
||||
turned off once turned on, nor can it be set to other than boolean values.
|
||||
See policy :policy:`CMP0118`.
|
||||
|
||||
* The :prop_tgt:`UNITY_BUILD_UNIQUE_ID` target property
|
||||
|
||||
Reference in New Issue
Block a user