From 27b03281e2028d8239c3f7e43ea67f30a70dc42b Mon Sep 17 00:00:00 2001 From: Rahul Gottipati Date: Thu, 25 Jun 2020 19:06:25 +0530 Subject: configure_file: Add option to control file permissions transfer to copy Issue: #20866 --- Help/command/configure_file.rst | 6 ++++++ Help/release/dev/configure_file-permission-control.rst | 5 +++++ Source/CPack/cmCPackGenerator.cxx | 2 +- Source/cmConfigureFileCommand.cxx | 6 +++++- Source/cmCreateTestSourceList.cxx | 2 +- Source/cmLocalGenerator.cxx | 4 ++-- Source/cmMakefile.cxx | 17 ++++++++++++++++- Source/cmMakefile.h | 1 + Source/cmVisualStudio10TargetGenerator.cxx | 2 +- Tests/RunCMake/configure_file/NoSourcePermissions.cmake | 10 ++++++++++ Tests/RunCMake/configure_file/NoSourcePermissions.sh | 3 +++ Tests/RunCMake/configure_file/RunCMakeTest.cmake | 1 + 12 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 Help/release/dev/configure_file-permission-control.rst create mode 100644 Tests/RunCMake/configure_file/NoSourcePermissions.cmake create mode 100755 Tests/RunCMake/configure_file/NoSourcePermissions.sh diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst index 29e85bd..46d1a05 100644 --- a/Help/command/configure_file.rst +++ b/Help/command/configure_file.rst @@ -7,6 +7,7 @@ Copy a file to another location and modify its contents. configure_file( [COPYONLY] [ESCAPE_QUOTES] [@ONLY] + [NO_SOURCE_PERMISSIONS] [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ]) Copies an ```` file to an ```` file and substitutes @@ -82,6 +83,11 @@ The arguments are: Restrict variable replacement to references of the form ``@VAR@``. This is useful for configuring scripts that use ``${VAR}`` syntax. + ``NO_SOURCE_PERMISSIONS`` + Does not transfer the file permissions of the original file to the copy. + The copied file permissions default to the standard 644 value + (-rw-r--r--). + ``NEWLINE_STYLE