diff options
Diffstat (limited to 'Help/command/configure_file.rst')
-rw-r--r-- | Help/command/configure_file.rst | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst index c59995a..63ea84d 100644 --- a/Help/command/configure_file.rst +++ b/Help/command/configure_file.rst @@ -6,8 +6,9 @@ Copy a file to another location and modify its contents. .. code-block:: cmake configure_file(<input> <output> + [FILE_PERMISSIONS <permissions>...] [COPYONLY] [ESCAPE_QUOTES] [@ONLY] - [NO_SOURCE_PERMISSIONS] + [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS] [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ]) Copies an ``<input>`` file to an ``<output>`` file and substitutes @@ -37,22 +38,24 @@ a false constant by the :command:`if` command. The "..." content on the line after the variable name, if any, is processed as above. Input file lines of the form ``#cmakedefine01 VAR`` will be replaced with either ``#define VAR 1`` or ``#define VAR 0`` similarly. -The result lines (with the exception of the ``#undef`` comments) can be -indented using spaces and/or tabs between the ``#`` character -and the ``cmakedefine`` or ``cmakedefine01`` words. This whitespace -indentation will be preserved in the output lines: -.. code-block:: c +.. versionadded:: 3.10 + The result lines (with the exception of the ``#undef`` comments) can be + indented using spaces and/or tabs between the ``#`` character + and the ``cmakedefine`` or ``cmakedefine01`` words. This whitespace + indentation will be preserved in the output lines: - # cmakedefine VAR - # cmakedefine01 VAR + .. code-block:: c -will be replaced, if ``VAR`` is defined, with + # cmakedefine VAR + # cmakedefine01 VAR -.. code-block:: c + will be replaced, if ``VAR`` is defined, with - # define VAR - # define VAR 1 + .. code-block:: c + + # define VAR + # define VAR 1 If the input file is modified the build system will re-run CMake to re-configure the file and generate the build system again. @@ -72,6 +75,9 @@ The arguments are: If the path names an existing directory the output file is placed in that directory with the same file name as the input file. +``FILE_PERMISSIONS <permissions>...`` + Use user provided permissions for the output file. + ``COPYONLY`` Copy the file without replacing any variable references or other content. This option may not be used with ``NEWLINE_STYLE``. @@ -84,10 +90,17 @@ The arguments are: This is useful for configuring scripts that use ``${VAR}`` syntax. ``NO_SOURCE_PERMISSIONS`` + .. versionadded:: 3.19 + 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--). +``USE_SOURCE_PERMISSIONS`` + .. versionadded:: 3.20 + + Transfer the file permissions of the original file to the output file. + ``NEWLINE_STYLE <style>`` Specify the newline style for the output file. Specify ``UNIX`` or ``LF`` for ``\n`` newlines, or specify |