summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-05-16 19:23:14 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2019-05-16 19:25:33 (GMT)
commite3ff7ced630808e2e74f0853a720bc90d3f35abb (patch)
treef286583c27907518bf65c930cfe883fc88556673 /Help
parent64a7f491ef8ab6f70a77f89c91d1e7e9d549333e (diff)
downloadCMake-e3ff7ced630808e2e74f0853a720bc90d3f35abb.zip
CMake-e3ff7ced630808e2e74f0853a720bc90d3f35abb.tar.gz
CMake-e3ff7ced630808e2e74f0853a720bc90d3f35abb.tar.bz2
file(INSTALL): Add FOLLOW_SYMLINK_CHAIN argument
Diffstat (limited to 'Help')
-rw-r--r--Help/command/file.rst27
-rw-r--r--Help/release/dev/file-install-follow-symlink-chain.rst6
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.