file(GENERATE): Support options to manipulate file permissions

Fixes: #15653
This commit is contained in:
Asit Dhal
2020-10-28 11:07:57 +01:00
parent c89514a6a4
commit c3385dd8bd
29 changed files with 339 additions and 18 deletions

View File

@@ -479,7 +479,9 @@ modified.
file(GENERATE OUTPUT output-file
<INPUT input-file|CONTENT content>
[CONDITION expression] [TARGET target])
[CONDITION expression] [TARGET target]
[FILE_PERMISSIONS <permissions>...]
[NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS])
Generate an output file for each build configuration supported by the current
:manual:`CMake Generator <cmake-generators(7)>`. Evaluate
@@ -520,6 +522,17 @@ from the input content to produce the output content. The options are:
require a target for evaluation (e.g. ``$<COMPILE_FEATURES:...>``,
``$<TARGET_PROPERTY:prop>``).
``FILE_PERMISSIONS <permissions>...``
Use user provided permissions for the generated file.
``NO_SOURCE_PERMISSIONS``
The generated file permissions default to the standard 644 value
(-rw-r--r--).
``USE_SOURCE_PERMISSIONS``
Transfer the file permissions of the original file to the generated file.
This option expects INPUT option.
Exactly one ``CONTENT`` or ``INPUT`` option must be given. A specific
``OUTPUT`` file may be named by at most one invocation of ``file(GENERATE)``.
Generated files are modified and their timestamp updated on subsequent cmake