summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-17 12:06:38 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-03-17 12:06:57 (GMT)
commitbee0100396d4b0dad7204125606e6baf26b79e38 (patch)
tree81d864ae072a4d0f13384047e5027932996c6f52 /Help
parent97562a202325093a88910c6cd2615a0ef77ce715 (diff)
parentc7e1198a237f3a6562ffc57806fdeb730c20356b (diff)
downloadCMake-bee0100396d4b0dad7204125606e6baf26b79e38.zip
CMake-bee0100396d4b0dad7204125606e6baf26b79e38.tar.gz
CMake-bee0100396d4b0dad7204125606e6baf26b79e38.tar.bz2
Merge topic 'file-archive'
c7e1198a23 file: Add ARCHIVE_{CREATE|EXTRACT} subcommands Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4475
Diffstat (limited to 'Help')
-rw-r--r--Help/command/file.rst63
-rw-r--r--Help/release/dev/file_archive.rst7
2 files changed, 70 insertions, 0 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst
index 5a479d9..92cb2ed 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -42,6 +42,10 @@ Synopsis
`Locking`_
file(`LOCK`_ <path> [...])
+ `Archiving`_
+ file(`ARCHIVE_CREATE`_ OUTPUT <archive> FILES <files> [...])
+ file(`ARCHIVE_EXTRACT`_ INPUT <archive> DESTINATION <dir> [...])
+
Reading
^^^^^^^
@@ -888,3 +892,62 @@ child directory or file.
Trying to lock file twice is not allowed. Any intermediate directories and
file itself will be created if they not exist. ``GUARD`` and ``TIMEOUT``
options ignored on ``RELEASE`` operation.
+
+Archiving
+^^^^^^^^^
+
+.. _ARCHIVE_CREATE:
+
+.. code-block:: cmake
+
+ file(ARCHIVE_CREATE OUTPUT <archive>
+ [FILES <files>]
+ [DIRECTORY <dirs>]
+ [FORMAT <format>]
+ [TYPE <type>]
+ [MTIME <mtime>]
+ [VERBOSE])
+
+Creates an archive specifed by ``OUTPUT`` with the content of ``FILES`` and
+``DIRECTORY``.
+
+To specify the format of the archive set the ``FORMAT`` option.
+Supported formats are: ``7zip``, ``gnutar``, ``pax``, ``paxr``, ``raw``,
+(restricted pax, default), and ``zip``.
+
+To specify the type of compression set the ``TYPE`` option.
+Supported compression types are: ``None``, ``BZip2``, ``GZip``, ``XZ``,
+and ``Zstd``.
+
+.. note::
+ With ``FORMAT`` set to ``raw`` only one file will be compressed with the
+ compression type specified by ``TYPE``.
+
+With ``VERBOSE`` the command will produce verbose output.
+
+To specify the modification time recorded in tarball entries use
+the ``MTIME`` option.
+
+.. _ARCHIVE_EXTRACT:
+
+.. code-block:: cmake
+
+ file(ARCHIVE_EXTRACT INPUT <archive>
+ [FILES <files>]
+ [DIRECTORY <dirs>]
+ [DESTINATION <dir>]
+ [LIST_ONLY]
+ [VERBOSE])
+
+Extracts or lists the content of an archive specified by ``INPUT``.
+
+The directory where the content of the archive will be extracted can
+be specified via ``DESTINATION``. If the directory does not exit, it
+will be created.
+
+To select which files and directories will be extracted or listed
+use ``FILES`` and ``DIRECTORY`` options.
+
+``LIST_ONLY`` will only list the files in the archive.
+
+With ``VERBOSE`` the command will produce verbose output.
diff --git a/Help/release/dev/file_archive.rst b/Help/release/dev/file_archive.rst
new file mode 100644
index 0000000..e79529c
--- /dev/null
+++ b/Help/release/dev/file_archive.rst
@@ -0,0 +1,7 @@
+file_archive
+------------
+
+* The :command:`file` command gained the ``ARCHIVE_{CREATE|EXTRACT}`` subcommands.
+
+ These subcommands will replicate the :manual:`cmake(1)` ``-E tar`` functionality in
+ CMake scripting code.