diff options
author | Wouter Klouwen <wouter.klouwen@youview.com> | 2018-11-20 10:17:33 (GMT) |
---|---|---|
committer | Wouter Klouwen <wouter.klouwen@youview.com> | 2018-11-27 08:50:36 (GMT) |
commit | 12b471e828e4462cce4354c87bb4fe18aeb600e3 (patch) | |
tree | ac94c73bfff84d0f6af70104ec4ab686e81a27b3 /Help/command/file.rst | |
parent | d851a8b457251a577f10055d9fb277b75a82da6c (diff) | |
download | CMake-12b471e828e4462cce4354c87bb4fe18aeb600e3.zip CMake-12b471e828e4462cce4354c87bb4fe18aeb600e3.tar.gz CMake-12b471e828e4462cce4354c87bb4fe18aeb600e3.tar.bz2 |
file: add SIZE option
This commit adds the SIZE option to file(). It returns the file size of
the given path if it exists and produces an error if not.
Diffstat (limited to 'Help/command/file.rst')
-rw-r--r-- | Help/command/file.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst index f5279c0..26a9ae2 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -25,6 +25,7 @@ Synopsis file({`REMOVE`_ | `REMOVE_RECURSE`_ } [<files>...]) file(`MAKE_DIRECTORY`_ [<dir>...]) file({`COPY`_ | `INSTALL`_} <file>... DESTINATION <dir> [...]) + file(`SIZE`_ <filename> <out-var>) `Path Conversion`_ file(`RELATIVE_PATH`_ <out-var> <directory> <file>) @@ -333,6 +334,16 @@ and ``NO_SOURCE_PERMISSIONS`` is default. Installation scripts generated by the :command:`install` command use this signature (with some undocumented options for internal use). +.. _SIZE: + +.. code-block:: cmake + + file(SIZE <filename> <variable>) + +Determine the file size of the ``<filename>`` and put the result in +``<variable>`` variable. Requires that ``<filename>`` is a valid path +pointing to a file and is readable. + Path Conversion ^^^^^^^^^^^^^^^ |