diff options
author | Brad King <brad.king@kitware.com> | 2018-02-14 14:36:19 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-02-14 14:36:59 (GMT) |
commit | 34d35cd592da862085733761bfbecff8ebc7662a (patch) | |
tree | f8f297de64b0ff334fe369acc705d23313ed302f | |
parent | 7593c9ce8c86ab280870ba10ba158cfbde92c017 (diff) | |
parent | a71ab3be0e668731885740a11d29d378069d9677 (diff) | |
download | CMake-34d35cd592da862085733761bfbecff8ebc7662a.zip CMake-34d35cd592da862085733761bfbecff8ebc7662a.tar.gz CMake-34d35cd592da862085733761bfbecff8ebc7662a.tar.bz2 |
Merge topic 'help_string_MAKE_C_IDENTIFIER'
a71ab3be Help: Expand string(MAKE_C_IDENTIFIER) docs
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1760
-rw-r--r-- | Help/command/string.rst | 19 | ||||
-rw-r--r-- | Help/manual/cmake-generator-expressions.7.rst | 3 |
2 files changed, 14 insertions, 8 deletions
diff --git a/Help/command/string.rst b/Help/command/string.rst index fb3893f..d8da7be 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -282,6 +282,18 @@ CONFIGURE Transform a string like :command:`configure_file` transforms a file. +MAKE_C_IDENTIFIER +""""""""""""""""" + +:: + + string(MAKE_C_IDENTIFIER <input string> <output variable>) + +Convert each non-alphanumeric character in the ``<input string>`` to an +underscore and store the result in the ``<output variable>``. If the first +character of the string is a digit, an underscore will also be prepended to +the result. + RANDOM """""" @@ -346,13 +358,6 @@ If no explicit ``<format string>`` is given it will default to: %Y-%m-%dT%H:%M:%S for local time. %Y-%m-%dT%H:%M:%SZ for UTC. - -:: - - string(MAKE_C_IDENTIFIER <input string> <output variable>) - -Write a string which can be used as an identifier in C. - .. note:: If the ``SOURCE_DATE_EPOCH`` environment variable is set, diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 0f6d4cf..13948d3 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -289,7 +289,8 @@ Available output expressions are: ``$<UPPER_CASE:...>`` Content of ``...`` converted to upper case. ``$<MAKE_C_IDENTIFIER:...>`` - Content of ``...`` converted to a C identifier. + Content of ``...`` converted to a C identifier. The conversion follows the + same behavior as :command:`string(MAKE_C_IDENTIFIER)`. ``$<TARGET_OBJECTS:objLib>`` List of objects resulting from build of ``objLib``. ``objLib`` must be an object of type ``OBJECT_LIBRARY``. |