From 95bfacb8bbea931e52d30d1703186487214eed21 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 6 Mar 2023 14:09:32 -0500 Subject: Help: Indent 'if' command docs more consistently --- Help/command/if.rst | 204 ++++++++++++++++++++++++++-------------------------- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/Help/command/if.rst b/Help/command/if.rst index 684c113..ed62695 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -58,30 +58,30 @@ Basic Expressions """"""""""""""""" ``if()`` - True if the constant is ``1``, ``ON``, ``YES``, ``TRUE``, ``Y``, - or a non-zero number (including floating point numbers). - False if the constant is ``0``, ``OFF``, - ``NO``, ``FALSE``, ``N``, ``IGNORE``, ``NOTFOUND``, the empty string, - or ends in the suffix ``-NOTFOUND``. Named boolean constants are - case-insensitive. If the argument is not one of these specific - constants, it is treated as a variable or string (see `Variable Expansion`_ - further below) and one of the following two forms applies. + True if the constant is ``1``, ``ON``, ``YES``, ``TRUE``, ``Y``, + or a non-zero number (including floating point numbers). + False if the constant is ``0``, ``OFF``, + ``NO``, ``FALSE``, ``N``, ``IGNORE``, ``NOTFOUND``, the empty string, + or ends in the suffix ``-NOTFOUND``. Named boolean constants are + case-insensitive. If the argument is not one of these specific + constants, it is treated as a variable or string (see `Variable Expansion`_ + further below) and one of the following two forms applies. ``if()`` - True if given a variable that is defined to a value that is not a false - constant. False otherwise, including if the variable is undefined. - Note that macro arguments are not variables. - :ref:`Environment Variables ` also - cannot be tested this way, e.g. ``if(ENV{some_var})`` will always evaluate - to false. + True if given a variable that is defined to a value that is not a false + constant. False otherwise, including if the variable is undefined. + Note that macro arguments are not variables. + :ref:`Environment Variables ` also + cannot be tested this way, e.g. ``if(ENV{some_var})`` will always evaluate + to false. ``if()`` - A quoted string always evaluates to false unless: + A quoted string always evaluates to false unless: - * The string's value is one of the true constants, or - * Policy :policy:`CMP0054` is not set to ``NEW`` and the string's value - happens to be a variable name that is affected by :policy:`CMP0054`'s - behavior. + * The string's value is one of the true constants, or + * Policy :policy:`CMP0054` is not set to ``NEW`` and the string's value + happens to be a variable name that is affected by :policy:`CMP0054`'s + behavior. Logic Operators """"""""""""""" @@ -89,23 +89,23 @@ Logic Operators .. _NOT: ``if(NOT )`` - True if the condition is not true. + True if the condition is not true. .. _AND: ``if( AND )`` - True if both conditions would be considered true individually. + True if both conditions would be considered true individually. .. _OR: ``if( OR )`` - True if either condition would be considered true individually. + True if either condition would be considered true individually. ``if((condition) AND (condition OR (condition)))`` - The conditions inside the parenthesis are evaluated first and then - the remaining condition is evaluated as in the other examples. - Where there are nested parenthesis the innermost are evaluated as part - of evaluating the condition that contains them. + The conditions inside the parenthesis are evaluated first and then + the remaining condition is evaluated as in the other examples. + Where there are nested parenthesis the innermost are evaluated as part + of evaluating the condition that contains them. Existence Checks """""""""""""""" @@ -113,17 +113,17 @@ Existence Checks .. _COMMAND: ``if(COMMAND command-name)`` - True if the given name is a command, macro or function that can be - invoked. + True if the given name is a command, macro or function that can be + invoked. ``if(POLICY policy-id)`` - True if the given name is an existing policy (of the form ``CMP``). + True if the given name is an existing policy (of the form ``CMP``). ``if(TARGET target-name)`` - True if the given name is an existing logical target name created - by a call to the :command:`add_executable`, :command:`add_library`, - or :command:`add_custom_target` command that has already been invoked - (in any directory). + True if the given name is an existing logical target name created + by a call to the :command:`add_executable`, :command:`add_library`, + or :command:`add_custom_target` command that has already been invoked + (in any directory). ``if(TEST test-name)`` .. versionadded:: 3.3 @@ -133,21 +133,21 @@ Existence Checks .. _DEFINED: ``if(DEFINED |CACHE{}|ENV{})`` - True if a variable, cache variable or environment variable - with given ```` is defined. The value of the variable - does not matter. Note the following caveats: - - * Macro arguments are not variables. - * It is not possible to test directly whether a `` is a non-cache - variable. The expression ``if(DEFINED someName)`` will evaluate to true - if either a cache or non-cache variable ``someName`` exists. In - comparison, the expression ``if(DEFINED CACHE{someName})`` will only - evaluate to true if a cache variable ``someName`` exists. Both expressions - need to be tested if you need to know whether a non-cache variable exists: - ``if(DEFINED someName AND NOT DEFINED CACHE{someName})``. - - .. versionadded:: 3.14 - Added support for ``CACHE{}`` variables. + True if a variable, cache variable or environment variable + with given ```` is defined. The value of the variable + does not matter. Note the following caveats: + + * Macro arguments are not variables. + * It is not possible to test directly whether a `` is a non-cache + variable. The expression ``if(DEFINED someName)`` will evaluate to true + if either a cache or non-cache variable ``someName`` exists. In + comparison, the expression ``if(DEFINED CACHE{someName})`` will only + evaluate to true if a cache variable ``someName`` exists. Both expressions + need to be tested if you need to know whether a non-cache variable exists: + ``if(DEFINED someName AND NOT DEFINED CACHE{someName})``. + + .. versionadded:: 3.14 + Added support for ``CACHE{}`` variables. ``if( IN_LIST )`` .. versionadded:: 3.3 @@ -159,43 +159,43 @@ File Operations .. _EXISTS: ``if(EXISTS path-to-file-or-directory)`` - True if the named file or directory exists. Behavior is well-defined - only for explicit full paths (a leading ``~/`` is not expanded as - a home directory and is considered a relative path). - Resolves symbolic links, i.e. if the named file or directory is a - symbolic link, returns true if the target of the symbolic link exists. + True if the named file or directory exists. Behavior is well-defined + only for explicit full paths (a leading ``~/`` is not expanded as + a home directory and is considered a relative path). + Resolves symbolic links, i.e. if the named file or directory is a + symbolic link, returns true if the target of the symbolic link exists. - False if the given path is an empty string. + False if the given path is an empty string. ``if(file1 IS_NEWER_THAN file2)`` - True if ``file1`` is newer than ``file2`` or if one of the two files doesn't - exist. Behavior is well-defined only for full paths. If the file - time stamps are exactly the same, an ``IS_NEWER_THAN`` comparison returns - true, so that any dependent build operations will occur in the event - of a tie. This includes the case of passing the same file name for - both file1 and file2. + True if ``file1`` is newer than ``file2`` or if one of the two files doesn't + exist. Behavior is well-defined only for full paths. If the file + time stamps are exactly the same, an ``IS_NEWER_THAN`` comparison returns + true, so that any dependent build operations will occur in the event + of a tie. This includes the case of passing the same file name for + both file1 and file2. ``if(IS_DIRECTORY path)`` - True if ``path`` is a directory. Behavior is well-defined only - for full paths. + True if ``path`` is a directory. Behavior is well-defined only + for full paths. - False if the given path is an empty string. + False if the given path is an empty string. ``if(IS_SYMLINK file-name)`` - True if the given name is a symbolic link. Behavior is well-defined - only for full paths. + True if the given name is a symbolic link. Behavior is well-defined + only for full paths. ``if(IS_ABSOLUTE path)`` - True if the given path is an absolute path. Note the following special - cases: + True if the given path is an absolute path. Note the following special + cases: - * An empty ``path`` evaluates to false. - * On Windows hosts, any ``path`` that begins with a drive letter and colon - (e.g. ``C:``), a forward slash or a backslash will evaluate to true. - This means a path like ``C:no\base\dir`` will evaluate to true, even - though the non-drive part of the path is relative. - * On non-Windows hosts, any ``path`` that begins with a tilde (``~``) - evaluates to true. + * An empty ``path`` evaluates to false. + * On Windows hosts, any ``path`` that begins with a drive letter and colon + (e.g. ``C:``), a forward slash or a backslash will evaluate to true. + This means a path like ``C:no\base\dir`` will evaluate to true, even + though the non-drive part of the path is relative. + * On non-Windows hosts, any ``path`` that begins with a tilde (``~``) + evaluates to true. Comparisons """"""""""" @@ -203,29 +203,29 @@ Comparisons .. _MATCHES: ``if( MATCHES regex)`` - True if the given string or variable's value matches the given regular - expression. See :ref:`Regex Specification` for regex format. + True if the given string or variable's value matches the given regular + expression. See :ref:`Regex Specification` for regex format. - .. versionadded:: 3.9 - ``()`` groups are captured in :variable:`CMAKE_MATCH_` variables. + .. versionadded:: 3.9 + ``()`` groups are captured in :variable:`CMAKE_MATCH_` variables. .. _LESS: ``if( LESS )`` - True if the given string or variable's value is a valid number and less - than that on the right. + True if the given string or variable's value is a valid number and less + than that on the right. .. _GREATER: ``if( GREATER )`` - True if the given string or variable's value is a valid number and greater - than that on the right. + True if the given string or variable's value is a valid number and greater + than that on the right. .. _EQUAL: ``if( EQUAL )`` - True if the given string or variable's value is a valid number and equal - to that on the right. + True if the given string or variable's value is a valid number and equal + to that on the right. .. _LESS_EQUAL: @@ -244,20 +244,20 @@ Comparisons .. _STRLESS: ``if( STRLESS )`` - True if the given string or variable's value is lexicographically less - than the string or variable on the right. + True if the given string or variable's value is lexicographically less + than the string or variable on the right. .. _STRGREATER: ``if( STRGREATER )`` - True if the given string or variable's value is lexicographically greater - than the string or variable on the right. + True if the given string or variable's value is lexicographically greater + than the string or variable on the right. .. _STREQUAL: ``if( STREQUAL )`` - True if the given string or variable's value is lexicographically equal - to the string or variable on the right. + True if the given string or variable's value is lexicographically equal + to the string or variable on the right. .. _STRLESS_EQUAL: @@ -279,26 +279,26 @@ Version Comparisons .. _VERSION_LESS: ``if( VERSION_LESS )`` - Component-wise integer version number comparison (version format is - ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). - Any non-integer version component or non-integer trailing part of a version - component effectively truncates the string at that point. + Component-wise integer version number comparison (version format is + ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). + Any non-integer version component or non-integer trailing part of a version + component effectively truncates the string at that point. .. _VERSION_GREATER: ``if( VERSION_GREATER )`` - Component-wise integer version number comparison (version format is - ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). - Any non-integer version component or non-integer trailing part of a version - component effectively truncates the string at that point. + Component-wise integer version number comparison (version format is + ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). + Any non-integer version component or non-integer trailing part of a version + component effectively truncates the string at that point. .. _VERSION_EQUAL: ``if( VERSION_EQUAL )`` - Component-wise integer version number comparison (version format is - ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). - Any non-integer version component or non-integer trailing part of a version - component effectively truncates the string at that point. + Component-wise integer version number comparison (version format is + ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). + Any non-integer version component or non-integer trailing part of a version + component effectively truncates the string at that point. .. _VERSION_LESS_EQUAL: -- cgit v0.12 From ae7c4a5ff4cd28402fcb0519d0d8f30a4e84b59e Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 6 Mar 2023 14:18:11 -0500 Subject: Help: Add internal cross-references to 'if' command docs --- Help/command/if.rst | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Help/command/if.rst b/Help/command/if.rst index ed62695..6780ad8 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -39,7 +39,7 @@ the ``if``, ``elseif`` and :command:`while` clauses. Compound conditions are evaluated in the following order of precedence: -1. Parentheses. +1. `Parentheses`_. 2. Unary tests such as `EXISTS`_, `COMMAND`_, and `DEFINED`_. @@ -101,6 +101,8 @@ Logic Operators ``if( OR )`` True if either condition would be considered true individually. +.. _parentheses: + ``if((condition) AND (condition OR (condition)))`` The conditions inside the parenthesis are evaluated first and then the remaining condition is evaluated as in the other examples. @@ -386,34 +388,34 @@ constant. Automatic evaluation applies in the other cases whenever the above-documented condition syntax accepts ````: -* The left hand argument to ``MATCHES`` is first checked to see if it is +* The left hand argument to `MATCHES`_ is first checked to see if it is a defined variable, if so the variable's value is used, otherwise the original value is used. -* If the left hand argument to ``MATCHES`` is missing it returns false +* If the left hand argument to `MATCHES`_ is missing it returns false without error -* Both left and right hand arguments to ``LESS``, ``GREATER``, ``EQUAL``, - ``LESS_EQUAL``, and ``GREATER_EQUAL``, are independently tested to see if +* Both left and right hand arguments to `LESS`_, `GREATER`_, `EQUAL`_, + `LESS_EQUAL`_, and `GREATER_EQUAL`_, are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used. -* Both left and right hand arguments to ``STRLESS``, ``STRGREATER``, - ``STREQUAL``, ``STRLESS_EQUAL``, and ``STRGREATER_EQUAL`` are independently +* Both left and right hand arguments to `STRLESS`_, `STRGREATER`_, + `STREQUAL`_, `STRLESS_EQUAL`_, and `STRGREATER_EQUAL`_ are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used. -* Both left and right hand arguments to ``VERSION_LESS``, - ``VERSION_GREATER``, ``VERSION_EQUAL``, ``VERSION_LESS_EQUAL``, and - ``VERSION_GREATER_EQUAL`` are independently tested to see if they are defined +* Both left and right hand arguments to `VERSION_LESS`_, + `VERSION_GREATER`_, `VERSION_EQUAL`_, `VERSION_LESS_EQUAL`_, and + `VERSION_GREATER_EQUAL`_ are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used. -* The right hand argument to ``NOT`` is tested to see if it is a boolean +* The right hand argument to `NOT`_ is tested to see if it is a boolean constant, if so the value is used, otherwise it is assumed to be a variable and it is dereferenced. -* The left and right hand arguments to ``AND`` and ``OR`` are independently +* The left and right hand arguments to `AND`_ and `OR`_ are independently tested to see if they are boolean constants, if so they are used as such, otherwise they are assumed to be variables and are dereferenced. -- cgit v0.12 From bedd62d52c67f44200c45fec404220d8c69e5c23 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 7 Mar 2023 13:35:02 -0500 Subject: Help: Improve sentence structure around "if so" --- Help/command/if.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Help/command/if.rst b/Help/command/if.rst index 6780ad8..dc0ceaf 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -389,7 +389,7 @@ Automatic evaluation applies in the other cases whenever the above-documented condition syntax accepts ````: * The left hand argument to `MATCHES`_ is first checked to see if it is - a defined variable, if so the variable's value is used, otherwise the + a defined variable. If so, the variable's value is used, otherwise the original value is used. * If the left hand argument to `MATCHES`_ is missing it returns false @@ -397,26 +397,26 @@ above-documented condition syntax accepts ````: * Both left and right hand arguments to `LESS`_, `GREATER`_, `EQUAL`_, `LESS_EQUAL`_, and `GREATER_EQUAL`_, are independently tested to see if - they are defined variables, if so their defined values are used otherwise + they are defined variables. If so, their defined values are used otherwise the original value is used. * Both left and right hand arguments to `STRLESS`_, `STRGREATER`_, `STREQUAL`_, `STRLESS_EQUAL`_, and `STRGREATER_EQUAL`_ are independently - tested to see if they are defined variables, if so their defined values are + tested to see if they are defined variables. If so, their defined values are used otherwise the original value is used. * Both left and right hand arguments to `VERSION_LESS`_, `VERSION_GREATER`_, `VERSION_EQUAL`_, `VERSION_LESS_EQUAL`_, and `VERSION_GREATER_EQUAL`_ are independently tested to see if they are defined - variables, if so their defined values are used otherwise the original value + variables. If so, their defined values are used otherwise the original value is used. * The right hand argument to `NOT`_ is tested to see if it is a boolean - constant, if so the value is used, otherwise it is assumed to be a + constant. If so, the value is used, otherwise it is assumed to be a variable and it is dereferenced. * The left and right hand arguments to `AND`_ and `OR`_ are independently - tested to see if they are boolean constants, if so they are used as + tested to see if they are boolean constants. If so, they are used as such, otherwise they are assumed to be variables and are dereferenced. .. versionchanged:: 3.1 -- cgit v0.12 From 3600be4e318faca509bc45b1df33c697baebe111 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 6 Mar 2023 14:10:12 -0500 Subject: Help: Use signature directive for 'if' command --- Help/command/if.rst | 160 +++++++++++++++++++++++++++++----------------------- 1 file changed, 90 insertions(+), 70 deletions(-) diff --git a/Help/command/if.rst b/Help/command/if.rst index dc0ceaf..be855e1 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -57,7 +57,9 @@ Compound conditions are evaluated in the following order of precedence: Basic Expressions """"""""""""""""" -``if()`` +.. signature:: if() + :target: constant + True if the constant is ``1``, ``ON``, ``YES``, ``TRUE``, ``Y``, or a non-zero number (including floating point numbers). False if the constant is ``0``, ``OFF``, @@ -67,7 +69,9 @@ Basic Expressions constants, it is treated as a variable or string (see `Variable Expansion`_ further below) and one of the following two forms applies. -``if()`` +.. signature:: if() + :target: variable + True if given a variable that is defined to a value that is not a false constant. False otherwise, including if the variable is undefined. Note that macro arguments are not variables. @@ -75,7 +79,9 @@ Basic Expressions cannot be tested this way, e.g. ``if(ENV{some_var})`` will always evaluate to false. -``if()`` +.. signature:: if() + :target: string + A quoted string always evaluates to false unless: * The string's value is one of the true constants, or @@ -86,24 +92,23 @@ Basic Expressions Logic Operators """"""""""""""" -.. _NOT: +.. signature:: if(NOT ) -``if(NOT )`` True if the condition is not true. -.. _AND: +.. signature:: if( AND ) + :target: AND -``if( AND )`` True if both conditions would be considered true individually. -.. _OR: +.. signature:: if( OR ) + :target: OR -``if( OR )`` True if either condition would be considered true individually. -.. _parentheses: +.. signature:: if((condition) AND (condition OR (condition))) + :target: parentheses -``if((condition) AND (condition OR (condition)))`` The conditions inside the parenthesis are evaluated first and then the remaining condition is evaluated as in the other examples. Where there are nested parenthesis the innermost are evaluated as part @@ -112,29 +117,31 @@ Logic Operators Existence Checks """""""""""""""" -.. _COMMAND: +.. signature:: if(COMMAND ) -``if(COMMAND command-name)`` True if the given name is a command, macro or function that can be invoked. -``if(POLICY policy-id)`` +.. signature:: if(POLICY ) + True if the given name is an existing policy (of the form ``CMP``). -``if(TARGET target-name)`` +.. signature:: if(TARGET ) + True if the given name is an existing logical target name created by a call to the :command:`add_executable`, :command:`add_library`, or :command:`add_custom_target` command that has already been invoked (in any directory). -``if(TEST test-name)`` - .. versionadded:: 3.3 +.. signature:: if(TEST ) + + .. versionadded:: 3.3 + True if the given name is an existing test name created by the :command:`add_test` command. -.. _DEFINED: +.. signature:: if(DEFINED |CACHE{}|ENV{}) -``if(DEFINED |CACHE{}|ENV{})`` True if a variable, cache variable or environment variable with given ```` is defined. The value of the variable does not matter. Note the following caveats: @@ -148,19 +155,21 @@ Existence Checks need to be tested if you need to know whether a non-cache variable exists: ``if(DEFINED someName AND NOT DEFINED CACHE{someName})``. - .. versionadded:: 3.14 - Added support for ``CACHE{}`` variables. + .. versionadded:: 3.14 + Added support for ``CACHE{}`` variables. + +.. signature:: if( IN_LIST ) + :target: IN_LIST + + .. versionadded:: 3.3 -``if( IN_LIST )`` - .. versionadded:: 3.3 True if the given element is contained in the named list variable. File Operations """"""""""""""" -.. _EXISTS: +.. signature:: if(EXISTS ) -``if(EXISTS path-to-file-or-directory)`` True if the named file or directory exists. Behavior is well-defined only for explicit full paths (a leading ``~/`` is not expanded as a home directory and is considered a relative path). @@ -169,7 +178,9 @@ File Operations False if the given path is an empty string. -``if(file1 IS_NEWER_THAN file2)`` +.. signature:: if( IS_NEWER_THAN ) + :target: IS_NEWER_THAN + True if ``file1`` is newer than ``file2`` or if one of the two files doesn't exist. Behavior is well-defined only for full paths. If the file time stamps are exactly the same, an ``IS_NEWER_THAN`` comparison returns @@ -177,17 +188,20 @@ File Operations of a tie. This includes the case of passing the same file name for both file1 and file2. -``if(IS_DIRECTORY path)`` +.. signature:: if(IS_DIRECTORY ) + True if ``path`` is a directory. Behavior is well-defined only for full paths. False if the given path is an empty string. -``if(IS_SYMLINK file-name)`` - True if the given name is a symbolic link. Behavior is well-defined +.. signature:: if(IS_SYMLINK ) + + True if the given path is a symbolic link. Behavior is well-defined only for full paths. -``if(IS_ABSOLUTE path)`` +.. signature:: if(IS_ABSOLUTE ) + True if the given path is an absolute path. Note the following special cases: @@ -202,119 +216,125 @@ File Operations Comparisons """"""""""" -.. _MATCHES: +.. signature:: if( MATCHES ) + :target: MATCHES -``if( MATCHES regex)`` True if the given string or variable's value matches the given regular expression. See :ref:`Regex Specification` for regex format. .. versionadded:: 3.9 ``()`` groups are captured in :variable:`CMAKE_MATCH_` variables. -.. _LESS: +.. signature:: if( LESS ) + :target: LESS -``if( LESS )`` True if the given string or variable's value is a valid number and less than that on the right. -.. _GREATER: +.. signature:: if( GREATER ) + :target: GREATER -``if( GREATER )`` True if the given string or variable's value is a valid number and greater than that on the right. -.. _EQUAL: +.. signature:: if( EQUAL ) + :target: EQUAL -``if( EQUAL )`` True if the given string or variable's value is a valid number and equal to that on the right. -.. _LESS_EQUAL: +.. signature:: if( LESS_EQUAL ) + :target: LESS_EQUAL + + .. versionadded:: 3.7 -``if( LESS_EQUAL )`` - .. versionadded:: 3.7 True if the given string or variable's value is a valid number and less than or equal to that on the right. -.. _GREATER_EQUAL: +.. signature:: if( GREATER_EQUAL ) + :target: GREATER_EQUAL + + .. versionadded:: 3.7 -``if( GREATER_EQUAL )`` - .. versionadded:: 3.7 True if the given string or variable's value is a valid number and greater than or equal to that on the right. -.. _STRLESS: +.. signature:: if( STRLESS ) + :target: STRLESS -``if( STRLESS )`` True if the given string or variable's value is lexicographically less than the string or variable on the right. -.. _STRGREATER: +.. signature:: if( STRGREATER ) + :target: STRGREATER -``if( STRGREATER )`` True if the given string or variable's value is lexicographically greater than the string or variable on the right. -.. _STREQUAL: +.. signature:: if( STREQUAL ) + :target: STREQUAL -``if( STREQUAL )`` True if the given string or variable's value is lexicographically equal to the string or variable on the right. -.. _STRLESS_EQUAL: +.. signature:: if( STRLESS_EQUAL ) + :target: STRLESS_EQUAL + + .. versionadded:: 3.7 -``if( STRLESS_EQUAL )`` - .. versionadded:: 3.7 True if the given string or variable's value is lexicographically less than or equal to the string or variable on the right. -.. _STRGREATER_EQUAL: +.. signature:: if( STRGREATER_EQUAL ) + :target: STRGREATER_EQUAL + + .. versionadded:: 3.7 -``if( STRGREATER_EQUAL )`` - .. versionadded:: 3.7 True if the given string or variable's value is lexicographically greater than or equal to the string or variable on the right. Version Comparisons """"""""""""""""""" -.. _VERSION_LESS: +.. signature:: if( VERSION_LESS ) + :target: VERSION_LESS -``if( VERSION_LESS )`` Component-wise integer version number comparison (version format is ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). Any non-integer version component or non-integer trailing part of a version component effectively truncates the string at that point. -.. _VERSION_GREATER: +.. signature:: if( VERSION_GREATER ) + :target: VERSION_GREATER -``if( VERSION_GREATER )`` Component-wise integer version number comparison (version format is ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). Any non-integer version component or non-integer trailing part of a version component effectively truncates the string at that point. -.. _VERSION_EQUAL: +.. signature:: if( VERSION_EQUAL ) + :target: VERSION_EQUAL -``if( VERSION_EQUAL )`` Component-wise integer version number comparison (version format is ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). Any non-integer version component or non-integer trailing part of a version component effectively truncates the string at that point. -.. _VERSION_LESS_EQUAL: +.. signature:: if( VERSION_LESS_EQUAL ) + :target: VERSION_LESS_EQUAL + + .. versionadded:: 3.7 -``if( VERSION_LESS_EQUAL )`` - .. versionadded:: 3.7 Component-wise integer version number comparison (version format is ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). Any non-integer version component or non-integer trailing part of a version component effectively truncates the string at that point. -.. _VERSION_GREATER_EQUAL: +.. signature:: if( VERSION_GREATER_EQUAL ) + :target: VERSION_GREATER_EQUAL + + .. versionadded:: 3.7 -``if( VERSION_GREATER_EQUAL )`` - .. versionadded:: 3.7 Component-wise integer version number comparison (version format is ``major[.minor[.patch[.tweak]]]``, omitted components are treated as zero). Any non-integer version component or non-integer trailing part of a version @@ -323,9 +343,9 @@ Version Comparisons Path Comparisons """""""""""""""" -.. _PATH_EQUAL: +.. signature:: if( PATH_EQUAL ) + :target: PATH_EQUAL -``if( PATH_EQUAL )`` .. versionadded:: 3.24 Compares the two paths component-by-component. Only if every component of -- cgit v0.12