configure_file: Add options to control permissions
file(COPY|INSTALL)
allows the user to specify how they'd like the source file permissions to transfer to the destination file via NO_SOURCE_PERMISSIONS
and USE_SOURCE_PERMISSIONS
. configure_file()
does not and it duplicates the source file permissions for the generated file.
This can be troublesome if the source file is submitted to source control (e.g. Perforce, which uses the read-only attribute to mark files that are not checked out), but the generated file lives in the CMake build directory. Custom scripts may complain or require user input to confirm the deletion of read-only files.
Please add file permission control similar to file(COPY|INSTALL)
's to configure_file()
.
Edited by Brad King