mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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.
This commit is contained in:
@@ -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
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user