File: CMP0163.rst

package info (click to toggle)
cmake 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 158,704 kB
  • sloc: ansic: 406,077; cpp: 309,512; sh: 4,233; python: 3,696; yacc: 3,109; lex: 1,279; f90: 538; asm: 471; lisp: 375; java: 310; cs: 270; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 110; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22; sed: 2
file content (37 lines) | stat: -rw-r--r-- 1,743 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
CMP0163
-------

.. versionadded:: 3.30

The :prop_sf:`GENERATED` source file property is now visible in all directories.

In CMake 3.29 and below, the :prop_sf:`GENERATED` source file property,
like other source file properties, was scoped in every directory separately.
Although policy :policy:`CMP0118` allowed sources marked ``GENERATED`` in one
directory to be used in other directories without manually marking them as
``GENERATED`` again, the ``GENERATED`` property was still not visible to
:command:`get_property` and :command:`get_source_file_property` calls.

Whether or not a source file is generated is an all-or-nothing global
property of the source: a source is either generated or it is not.
CMake 3.30 and above prefer to treat the :prop_sf:`GENERATED` source file
property as globally scoped.  Once it is set in one directory, it is
immediately visible to :command:`get_property` and
:command:`get_source_file_property` calls in other directories.
This policy provides compatibility for projects that have not been
updated for this behavior.

The ``OLD`` behavior of this policy is for the ``GENERATED`` source file
property to be visible only in the directories in which it is set.  The
``NEW`` behavior of this policy is to allow the ``GENERATED`` source file
property to be visible in all directories once set in any directory.
Furthermore, the ``NEW`` behavior of this policy implies the ``NEW``
behavior of policy :policy:`CMP0118`: the ``GENERATED`` property may
be set only to boolean values, and may not be turned off once turned on.

.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
.. |WARNS_OR_DOES_NOT_WARN| replace::
   does *not* warn
.. include:: include/STANDARD_ADVICE.rst

.. include:: include/DEPRECATED.rst