Extend the `file()` command with a new `CONFIGURE` subcommand that behaves the same as `string(CONFIGURE)` except that it writes the resulting output immediately to a file. Fixes: #20388