use configure_file rather than custom_command
paths_replace and purge it.