CMP0058

CMP0058

Ninja requires custom command byproducts to be explicit.

When an intermediate file generated during the build is consumed by an expensive operation or a large tree of dependents, one may reduce the work needed for an incremental rebuild by updating the file timestamp only when its content changes. With this approach the generation rule must have a separate output file that is always updated with a new timestamp that is newer than any dependencies of the rule so that the build tool re-runs the rule only when the input changes. We refer to the separate output file as a rule’s witness and the generated file as a rule’s byproduct.

Byproducts may not be listed as outputs because their timestamps are allowed to be older than the inputs. No build tools (like make) that existed when CMake was designed have a way to express byproducts. Therefore CMake versions prior to 3.2 had no way to specify the