Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Jazeix
CMake
Commits
8d1944c6
Commit
8d1944c6
authored
3 years ago
by
Craig Scott
Browse files
Options
Downloads
Patches
Plain Diff
Help: Expand details for file(COPY_FILE)
parent
c8ea8861
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Help/command/file.rst
+18
-2
18 additions, 2 deletions
Help/command/file.rst
with
18 additions
and
2 deletions
Help/command/file.rst
+
18
−
2
View file @
8d1944c6
...
...
@@ -751,6 +751,8 @@ The options are:
[RESULT <result>]
[ONLY_IF_DIFFERENT])
.. versionadded:: 3.21
Copy a file from ``<oldname>`` to ``<newname>``. Directories are not
supported. Symlinks are ignored and ``<oldfile>``'s content is read and
written to ``<newname>`` as a new file.
...
...
@@ -762,8 +764,17 @@ The options are:
If ``RESULT`` is not specified and the operation fails, an error is emitted.
``ONLY_IF_DIFFERENT``
If the ``<newname>`` path already exists, do not replace it if it is the
same as ``<oldname>``. Otherwise, an error is emitted.
If the ``<newname>`` path already exists, do not replace it if the file's
contents are already the same as ``<oldname>`` (this avoids updating
``<newname>``'s timestamp).
This sub-command has some similarities to :command:`configure_file` with the
``COPYONLY`` option. An important difference is that :command:`configure_file`
creates a dependency on the source file, so CMake will be re-run if it changes.
The ``file(COPY_FILE)`` sub-command does not create such a dependency.
See also the ``file(COPY)`` sub-command just below which provides
further file-copying capabilities.
.. _COPY:
.. _INSTALL:
...
...
@@ -779,6 +790,11 @@ The options are:
[[PATTERN <pattern> | REGEX <regex>]
[EXCLUDE] [PERMISSIONS <permissions>...]] [...])
.. note::
For a simple file copying operation, the ``file(COPY_FILE)`` sub-command
just above may be easier to use.
The ``COPY`` signature copies files, directories, and symlinks to a
destination folder. Relative input paths are evaluated with respect
to the current source directory, and a relative destination is
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment