Ryan Prichard | f6283ab | 2022-01-13 17:30:19 -0800 | [diff] [blame] | 1 | CMP0118 |
| 2 | ------- |
| 3 | |
| 4 | .. versionadded:: 3.20 |
| 5 | |
| 6 | The :prop_sf:`GENERATED` source file property is now visible in all directories. |
| 7 | |
| 8 | Whether or not a source file is generated is an all-or-nothing global |
| 9 | property of the source. Consequently, the associated ``GENERATED`` |
| 10 | property is now visible from any directory scope, not only from the scope |
| 11 | for which it was set. |
| 12 | |
| 13 | Additionally, the ``GENERATED`` property may now be set only to boolean |
| 14 | values, and may not be turned off once turned on. |
| 15 | |
| 16 | The ``OLD`` behavior of this policy is to only allow ``GENERATED`` to be |
| 17 | visible from the directory scope for which it was set. The ``NEW`` |
| 18 | behavior on the other hand allows it to be visible from any scope. |
| 19 | |
| 20 | This policy was introduced in CMake version 3.20. Use the |
| 21 | :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. |
| 22 | Unlike many policies, CMake version |release| does *not* warn |
| 23 | when this policy is not set and simply uses ``OLD`` behavior with regard |
| 24 | to visibility of the ``GENERATED`` property. However, CMake does warn |
| 25 | about setting the ``GENERATED`` property to a non-boolean value. |