diff options
Diffstat (limited to 'Help/command')
-rw-r--r-- | Help/command/FIND_XXX.txt | 5 | ||||
-rw-r--r-- | Help/command/find_package.rst | 5 | ||||
-rw-r--r-- | Help/command/if.rst | 3 | ||||
-rw-r--r-- | Help/command/string.rst | 52 |
4 files changed, 42 insertions, 23 deletions
diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt index bd4d295..2f27764 100644 --- a/Help/command/FIND_XXX.txt +++ b/Help/command/FIND_XXX.txt @@ -73,6 +73,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: 1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a ``-DVAR=value``. + The values are interpreted as :ref:`;-lists <CMake Language Lists>`. This can be skipped if ``NO_CMAKE_PATH`` is passed. * |CMAKE_PREFIX_PATH_XXX| @@ -80,7 +81,9 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: * |CMAKE_XXX_MAC_PATH| 2. Search paths specified in cmake-specific environment variables. - These are intended to be set in the user's shell configuration. + These are intended to be set in the user's shell configuration, + and therefore use the host's native path separator + (``;`` on Windows and ``:`` on UNIX). This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed. * |CMAKE_PREFIX_PATH_XXX| diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst index 2cb1e5f..60a77b8 100644 --- a/Help/command/find_package.rst +++ b/Help/command/find_package.rst @@ -251,6 +251,7 @@ enabled. 1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a ``-DVAR=value``. + The values are interpreted as :ref:`;-lists <CMake Language Lists>`. This can be skipped if ``NO_CMAKE_PATH`` is passed:: CMAKE_PREFIX_PATH @@ -258,7 +259,9 @@ enabled. CMAKE_APPBUNDLE_PATH 2. Search paths specified in cmake-specific environment variables. - These are intended to be set in the user's shell configuration. + These are intended to be set in the user's shell configuration, + and therefore use the host's native path separator + (``;`` on Windows and ``:`` on UNIX). This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed:: <package>_DIR diff --git a/Help/command/if.rst b/Help/command/if.rst index 2a087d0..edd343d 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -103,7 +103,8 @@ Possible expressions are: ``if(<variable|string> MATCHES regex)`` True if the given string or variable's value matches the given regular - expression. + expression. See :ref:`Regex Specification` for regex format. + ``()`` groups are captured in :variable:`CMAKE_MATCH_<n>` variables. ``if(<variable|string> LESS <variable|string>)`` True if the given string or variable's value is a valid number and less diff --git a/Help/command/string.rst b/Help/command/string.rst index 698a91d..4f0c45c 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -77,31 +77,43 @@ The replace expression may refer to paren-delimited subexpressions of the match using ``\1``, ``\2``, ..., ``\9``. Note that two backslashes (``\\1``) are required in CMake code to get a backslash through argument parsing. +.. _`Regex Specification`: + Regex Specification """"""""""""""""""" The following characters have special meaning in regular expressions: -:: - - ^ Matches at beginning of input - $ Matches at end of input - . Matches any single character - [ ] Matches any character(s) inside the brackets - [^ ] Matches any character(s) not inside the brackets - - Inside brackets, specifies an inclusive range between - characters on either side e.g. [a-f] is [abcdef] - To match a literal - using brackets, make it the first - or the last character e.g. [+*/-] matches basic - mathematical operators. - * Matches preceding pattern zero or more times - + Matches preceding pattern one or more times - ? Matches preceding pattern zero or once only - | Matches a pattern on either side of the | - () Saves a matched subexpression, which can be referenced - in the REGEX REPLACE operation. Additionally it is saved - by all regular expression-related commands, including - e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9). +``^`` + Matches at beginning of input +``$`` + Matches at end of input +``.`` + Matches any single character +``[ ]`` + Matches any character(s) inside the brackets +``[^ ]`` + Matches any character(s) not inside the brackets +``-`` + Inside brackets, specifies an inclusive range between + characters on either side e.g. ``[a-f]`` is ``[abcdef]`` + To match a literal ``-`` using brackets, make it the first + or the last character e.g. ``[+*/-]`` matches basic + mathematical operators. +``*`` + Matches preceding pattern zero or more times +``+`` + Matches preceding pattern one or more times +``?`` + Matches preceding pattern zero or once only +``|`` + Matches a pattern on either side of the ``|`` +``()`` + Saves a matched subexpression, which can be referenced + in the ``REGEX REPLACE`` operation. Additionally it is saved + by all regular expression-related commands, including + e.g. :command:`if(MATCHES)`, in the variables + :variable:`CMAKE_MATCH_<n>` for ``<n>`` 0..9. ``*``, ``+`` and ``?`` have higher precedence than concatenation. ``|`` has lower precedence than concatenation. This means that the regular |