This explicitly states the scope of add_custom_command rules in the documentation of add_custom_command and add_custom_target. See issue #8815.