Skip to content

CMP0163: Make GENERATED source file property globally visible

This was originally attempted by policy CMP0118, but its implementation did not cover all intended use cases. !9358 (merged) revised its documentation to cover what it actually did.

Add new policy CMP0163 to cover the remaining use cases. In particular, make the GENERATED property visible to get_property calls in other directories. In order to capture the original intention of CMP0118, define CMP0163's NEW behavior to also imply CMP0118's NEW behavior.

Original Description

Policy CMP0118 did not have the desired effect, because the original attempt to make the GENERATED property of a source file visible from every directory scope was faulty.

Now, policy CMP0118 was extended by policy CMP0163 and if this new policy is set to NEW the GENERATED property of a source file is now really visible from every directory scope.

Additionally, the GENERATED property is now also set when file(CONFIGURE) is used. If file(GENERATE) is used it will only be set if the output path given to file(GENERATE) does not contain any generator-expressions.

Fixes: #25437 (closed)
Fixes: #25058 (closed)
Topic-rename: prop-GENERATED-visibility

Edited by Brad King

Merge request reports