diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-05-16 19:23:14 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-05-16 19:25:33 (GMT) |
commit | e3ff7ced630808e2e74f0853a720bc90d3f35abb (patch) | |
tree | f286583c27907518bf65c930cfe883fc88556673 /Help/command/file.rst | |
parent | 64a7f491ef8ab6f70a77f89c91d1e7e9d549333e (diff) | |
download | CMake-e3ff7ced630808e2e74f0853a720bc90d3f35abb.zip CMake-e3ff7ced630808e2e74f0853a720bc90d3f35abb.tar.gz CMake-e3ff7ced630808e2e74f0853a720bc90d3f35abb.tar.bz2 |
file(INSTALL): Add FOLLOW_SYMLINK_CHAIN argument
Diffstat (limited to 'Help/command/file.rst')
-rw-r--r-- | Help/command/file.rst | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst index 465e567..0664e7c 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -311,6 +311,7 @@ Create the given directories and their parents as needed. [FILE_PERMISSIONS <permissions>...] [DIRECTORY_PERMISSIONS <permissions>...] [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS] + [FOLLOW_SYMLINK_CHAIN] [FILES_MATCHING] [[PATTERN <pattern> | REGEX <regex>] [EXCLUDE] [PERMISSIONS <permissions>...]] [...]) @@ -324,6 +325,32 @@ at the destination with the same timestamp. Copying preserves input permissions unless explicit permissions or ``NO_SOURCE_PERMISSIONS`` are given (default is ``USE_SOURCE_PERMISSIONS``). +If ``FOLLOW_SYMLINK_CHAIN`` is specified, ``COPY`` will recursively resolve +the symlinks at the paths given until a real file is found, and install +a corresponding symlink in the destination for each symlink encountered. For +each symlink that is installed, the resolution is stripped of the directory, +leaving only the filename, meaning that the new symlink points to a file in +the same directory as the symlink. This feature is useful on some Unix systems, +where libraries are installed as a chain of symlinks with version numbers, with +less specific versions pointing to more specific versions. +``FOLLOW_SYMLINK_CHAIN`` will install all of these symlinks and the library +itself into the destination directory. For example, if you have the following +directory structure: + +* ``/opt/foo/lib/libfoo.so.1.2.3`` +* ``/opt/foo/lib/libfoo.so.1.2 -> libfoo.so.1.2.3`` +* ``/opt/foo/lib/libfoo.so.1 -> libfoo.so.1.2`` +* ``/opt/foo/lib/libfoo.so -> libfoo.so.1`` + +and you do: + +.. code-block:: cmake + + file(COPY /opt/foo/lib/libfoo.so DESTINATION lib FOLLOW_SYMLINK_CHAIN) + +This will install all of the symlinks and ``libfoo.so.1.2.3`` itself into +``lib``. + See the :command:`install(DIRECTORY)` command for documentation of permissions, ``FILES_MATCHING``, ``PATTERN``, ``REGEX``, and ``EXCLUDE`` options. Copying directories preserves the structure |