diff options
author | Rahul Gottipati <rahul.blr97@gmail.com> | 2020-06-25 13:36:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-06-30 15:20:41 (GMT) |
commit | 27b03281e2028d8239c3f7e43ea67f30a70dc42b (patch) | |
tree | 932b13ea34f2256e7d3400d5264cbf39b28f7096 /Source/cmConfigureFileCommand.cxx | |
parent | f2b84d24cfccf49b6332cf3f2ca164fd71ae023e (diff) | |
download | CMake-27b03281e2028d8239c3f7e43ea67f30a70dc42b.zip CMake-27b03281e2028d8239c3f7e43ea67f30a70dc42b.tar.gz CMake-27b03281e2028d8239c3f7e43ea67f30a70dc42b.tar.bz2 |
configure_file: Add option to control file permissions transfer to copy
Issue: #20866
Diffstat (limited to 'Source/cmConfigureFileCommand.cxx')
-rw-r--r-- | Source/cmConfigureFileCommand.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index 5b3045d..68322cc 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -60,6 +60,7 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args, } bool copyOnly = false; bool escapeQuotes = false; + bool use_source_permissions = true; static std::set<cm::string_view> noopOptions = { /* Legacy. */ @@ -87,6 +88,8 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args, escapeQuotes = true; } else if (args[i] == "@ONLY") { atOnly = true; + } else if (args[i] == "NO_SOURCE_PERMISSIONS") { + use_source_permissions = false; } else if (noopOptions.find(args[i]) != noopOptions.end()) { /* Ignore no-op options. */ } else { @@ -102,7 +105,8 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args, } if (!status.GetMakefile().ConfigureFile( - inputFile, outputFile, copyOnly, atOnly, escapeQuotes, newLineStyle)) { + inputFile, outputFile, copyOnly, atOnly, escapeQuotes, + use_source_permissions, newLineStyle)) { status.SetError("Problem configuring file"); return false; } |