From 8bb7562f1a4e75fa5cd00f4ebd868d1494b63e7a Mon Sep 17 00:00:00 2001 From: Tushar Maheshwari Date: Thu, 27 Dec 2018 20:59:51 +0530 Subject: Help: Add documentation for file(CREATE_LINK) subcommand --- Help/command/file.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Help/command/file.rst b/Help/command/file.rst index 6e2a6dd..db4d6fc 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -27,6 +27,7 @@ Synopsis file({`COPY`_ | `INSTALL`_} ... DESTINATION [...]) file(`SIZE`_ ) file(`READ_SYMLINK`_ ) + file(`CREATE_LINK`_ [...]) `Path Conversion`_ file(`RELATIVE_PATH`_ ) @@ -368,6 +369,28 @@ could do something like this: set(result "${dir}/${result}") endif() +.. _CREATE_LINK: + +.. code-block:: cmake + + file(CREATE_LINK + [RESULT ] [COPY_ON_ERROR] [SYMBOLIC]) + +Create a link to ```` at ````. + +It is a hard link by default. This can be changed to symbolic links by +using ``SYMBOLIC``. The original file needs to exist for hard links. + +The ```` variable, if specified, gets the status of the operation. +It is set to ``0`` in case of success. Otherwise, it contains the error +generated. In case of failures, if ``RESULT`` is not specified, a fatal error +is emitted. + +Specifying ``COPY_ON_ERROR`` enables copying the file as a fallback if +creating the link fails. + +Overwrites the ```` if it exists. + Path Conversion ^^^^^^^^^^^^^^^ -- cgit v0.12