string: Add new HEX sub-command

This commit is contained in:
Kyle Edwards
2020-02-18 10:49:02 -05:00
parent 952945813c
commit 5395bf05eb
11 changed files with 74 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ Synopsis
`Generation`_
string(`ASCII`_ <number>... <out-var>)
string(`HEX`_ <string> <out-var>)
string(`CONFIGURE`_ <string> <out-var> [...])
string(`MAKE_C_IDENTIFIER`_ <string> <out-var>)
string(`RANDOM`_ [<option>...] <out-var>)
@@ -355,6 +356,16 @@ Generation
Convert all numbers into corresponding ASCII characters.
.. _HEX:
.. code-block:: cmake
string(HEX <string> <output_variable>)
Convert each byte in the input ``<string>`` to its hexadecimal representation
and store the concatenated hex digits in the ``<output_variable>``. Letters in
the output (``a`` through ``f``) are in lowercase.
.. _CONFIGURE:
.. code-block:: cmake