diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2019-05-18 08:25:16 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-18 08:25:39 (GMT) |
commit | 3bd8ed22e8017e5490b8e758f486433b005ace30 (patch) | |
tree | 345287512179b56dc428b5a8b688dc95d5b75947 /Help | |
parent | 8ada05980f1a12a2673f78f4ea7bab9df6b9d987 (diff) | |
parent | e3ff7ced630808e2e74f0853a720bc90d3f35abb (diff) | |
download | CMake-3bd8ed22e8017e5490b8e758f486433b005ace30.zip CMake-3bd8ed22e8017e5490b8e758f486433b005ace30.tar.gz CMake-3bd8ed22e8017e5490b8e758f486433b005ace30.tar.bz2 |
Merge topic 'file-install-follow-symlink-chain'
e3ff7ced63 file(INSTALL): Add FOLLOW_SYMLINK_CHAIN argument
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !3332
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/file.rst | 27 | ||||
-rw-r--r-- | Help/release/dev/file-install-follow-symlink-chain.rst | 6 |
2 files changed, 33 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 diff --git a/Help/release/dev/file-install-follow-symlink-chain.rst b/Help/release/dev/file-install-follow-symlink-chain.rst new file mode 100644 index 0000000..8d22512 --- /dev/null +++ b/Help/release/dev/file-install-follow-symlink-chain.rst @@ -0,0 +1,6 @@ +file-install-follow-symlink-chain +--------------------------------- + +* The :command:`file(INSTALL)` command learned a new argument, + ``FOLLOW_SYMLINK_CHAIN``, which can be used to recursively resolve and + install symlinks. |