summaryrefslogtreecommitdiffstats
path: root/Help/command/if.rst
Commit message (Collapse)AuthorAgeFilesLines
* Help: Clarify precedence of AND and OR in 'if' conditionsBrad King2022-02-091-8/+15
| | | | | | | | | | | | The wording update in commit b74819e4fe (Help: Format 'if' command documentation, 2013-12-18, v3.0.0-rc1~227^2~1) incorrectly implied that `AND` has higher precedence than `OR`. Although this is common in many languages, it has never been true in CMake's implementation. Revise the wording to clarify the precedence. Add a test case demonstrating the order. Fixes: #23207
* Help: Non-zero floating point numbers are true in if() expressionsCraig Scott2022-01-031-1/+2
| | | Fixes: #22991
* Help: Clarify behavior of if(DEFINED) for cache and non-cache variablesCraig Scott2021-12-201-1/+10
| | | Fixes: #23023
* Help: Be more explicit about the behavior of if(<string>)Craig Scott2021-12-011-4/+13
|
* Help: Explicitly state that if(ENV{some_var}) is always falseCraig Scott2021-12-011-1/+3
|
* Help: Fix terminology for regular expression in if(MATCHES)Johel Ernesto Guerrero Peña2021-08-281-1/+1
| | | | | This was wrongly changed in commit ba90611225 (Help: Make synopsis of if command more compact; add section headers, 2018-10-05).
* Help: Document special cases for if(IS_ABSOLUTE)Craig Scott2021-04-171-1/+10
| | | | | | | The meaning of "absolute path" was previously assumed knowledge, but a number of special cases were left unspecified. The way some of these are handled differs to the way that cmake_path(IS_ABSOLUTE) works, so document those special cases so that the differing behavior between these two commands is clearly defined.
* Help: Add internal links to if() docsMichael Hirsch, Ph.D2021-02-181-7/+51
|
* Help: Document that if(EXISTS) does not expand ~Michael Hirsch, Ph.D2021-01-261-3/+4
| | | | Fixes: #21729
* Help: Add sections to if() conditions documentationShannon Booth2021-01-081-19/+35
|
* Help: Replace some `versionadded` directives with `versionchanged`Nikita Nemkin2020-11-121-1/+1
| | | | | | | | `.. versionchanged` directive might be more appropriate when documentation refers to previous CMake version, old behavior or a policy, and there's no new parameter or a variable involved. Issue: #19715
* Help: Add `.. versionadded` directives to commands documentationNikita Nemkin2020-11-091-25/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change ony concerns directives that appear in the document body. The guidelines for inserting version directives: * Baseline version is CMake 3.0, i.e. directives start at 3.1. * Always use `.. versionadded::` directive, avoid ad-hoc version references. Exception: policy pages. * For new command signatures, put `versionadded` on a separate line after the signature. * For a group of new signatures in a new document section, a single version note at the beginning of the section is sufficient. * For new options, put `versionadded` on a separate line before option description. * If all the option descriptions in the list are short one-liners, it's fine to put `versionadded` on the same line as the description. * If multiple option descriptions in close proximity would have the same ..versionadded directive, consider adding a single directive after the list, mentioning all added options. * For compact value lists and sub-option lists, put a single `versionadded` directive after the list mentioning all additions. * When a change is described in a single paragraph, put `versionadded` into that paragraph. * When only part of the paragraph has changed, separate the changed part if it doesn't break the flow. Otherwise, write a follow-up clarification paragraph and apply version directive to that. * When multiple version directives are close by, order earlier additions before later additions. * Indent related lists and code blocks to include them in the scope of `versionadded` directive. Issue: #19715
* CMakeDependentOption: Document that 4th parameter follows if-syntaxHong Xu2019-08-051-0/+2
|
* Merge topic 'if-EXISTS-doc'Brad King2019-04-041-1/+3
|\ | | | | | | | | | | | | 78ac8cb04a Help: clarify if(EXISTS) operation for symlinks Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3189
| * Help: clarify if(EXISTS) operation for symlinksShoaib Meenai2019-04-041-1/+3
| | | | | | | | if(EXISTS) resolves symlinks; note this explicitly in its documentation.
* | Help: Improve documentation formatingBartosz Kosiorek2019-04-041-1/+1
|/
* Help: Fix elseif/endif typoJuuso "Linda" Lapinlampi2019-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | In CMake 3.13.x, we had this evaluation for if() conditions: if(a) elseif(b) else(a) endif(a) The sensible intention of the change in commit c2efb3efcd (Help: Revise docs on Scripting Commands, 2018-10-16, v3.14.0-rc1~505^2) was: > "endif", "endfunction" etc: Explain that the argument is optional and > maintained for compatibility only Instead of "endif", it ended up being written to the documentation as "elseif" by the commit author (oops) to if()'s page. if(a) elseif(a!?) else() endif(a?) Truthfully, endif()'s parameter should be an optional verbatim repeat and not elseif()'s. If it wasn't, elseif() would be described to be the same as if(). The rightful intended description is: if(a) elseif(b) else() endif() Fix that typo.
* If: Support the 'DEFINED CACHE{}' syntaxRobert Maynard2018-11-091-5/+4
|
* Help: Document if(DEFINED ENV{name})Joachim Wuttke (h)2018-11-081-7/+9
|
* Help: short/long variable reference in if commandJoachim Wuttke (l)2018-11-081-1/+5
| | | | | Explain that the short form of variable references in the if command does not apply to ENV and CACHE vars.
* Help: Revise docs on Scripting CommandsJoachim Wuttke (l)2018-10-231-8/+17
| | | | | | | | | | | | | | | | | | | Revise docs for all "Scripting Commands", except four find_XXX that use a macro suite of their own. * Take full advantage of the improved syntax highlighting. * Make consequential use of <..> placeholders. * Clarify things here and there in the text. Specific improvements to some command docs: * "math": Correct description of novel hexadecimal capability. * "if", "foreach", "while": Provide link to "endif" etc * "foreach", "while": Mention "break" and "continue". * "foreach": Simplify explanation of ``RANGE`` and ``IN`` signatures; advise against negative arguments or reverse ranges (compare issue #18461) * "endif", "endfunction" etc: Explain that the argument is optional and maintained for compatibility only
* Help: Make synopsis of if command more compact; add section headersJoachim Wuttke (l)2018-10-091-41/+49
| | | | | | Also replace 'expression' by 'condition' (as in the while command); relegate optional arguments of else() and endif() to the text; revise explanation of operator precedence in Condition Syntax section.
* Help: Clarify handling of non-integer components in if() version testsCraig Scott2018-09-171-5/+15
|
* Help: Fix formatting typo for the 'if' commandSylvain Joubert2017-08-181-1/+1
|
* Help: Document CMAKE_MATCH_<n> variablesBrad King2017-04-181-0/+1
|
* Help: Link from if(MATCHES) to regex specification docsBrad King2017-04-181-1/+1
|
* Help: Fix cmake code block warnings produced by Sphinx 1.4Brad King2017-02-101-3/+3
| | | | | | | Some of our "cmake" code blocks do not use fully valid CMake syntax because they have placeholders for human reference. Sphinx has never been able to properly lex and highlight these, but now warns. Fix each block's syntax or change to a non-cmake block as appropriate.
* Add additional <= and >= comparison operatorsChuck Atkins2016-08-091-16/+43
| | | | | This adds the LESS_EQUAL, GREATER_EQUAL, and associated STR and VERSION equivalents to use the combined <= and >= functionality.
* Help: Clarify scope of `if(TARGET)` expressionBartosz Kosiorek2016-01-281-3/+4
|
* Help: Improve markup in `if` command documentationBartosz Kosiorek2016-01-281-1/+1
|
* if: Add "TEST <test>" conditionMatt McCormick2015-08-031-0/+4
| | | | | | | | if(TEST TestNameThatExists) will return true if a test with the name TestNameThatExists has been added with add_test. The syntax is similar to if(TARGET TargetName). Since use of "TEST" as an argument to if() could previously be interpreted as a non-keyword argument, add policy CMP0064 to treat it as a keyword as NEW behavior.
* if: Implement new IN_LIST operatorNils Gladitz2015-04-301-0/+3
|
* Help: Clarify if(<variable>) documentation (#15335)Brad King2015-01-081-4/+5
| | | | | When the variable is not defined the signature is actually accepting a string. Also clarify fall-through from if(<constant>) case.
* If: Introduce policy CMP0054 - don't dereference quoted variables in if()Nils Gladitz2014-09-111-0/+6
|
* Help: Fix typo in 'if()' command documentationRaphael Kubo da Costa2014-01-151-1/+1
| | | | s/argumemnts/arguments/
* Help: Clarify if(TARGET) behavior (#14646)Brad King2013-12-181-1/+3
| | | | | Define the meaning of a "target" clearly and link to the commands that create them.
* Help: Format 'if' command documentationBrad King2013-12-181-207/+167
| | | | | | | Manually update reStructuredText formatting. Use a definition list for the possible if() tests supported. Add inline literal markup as appropriate. Also make minor wording tweaks to make it flow better with the new markup.
* Help: Document macro argument caveats in more detailDaniele E. Domenichelli2013-11-191-1/+2
| | | | | | Add notes about macro arguments in the foreach, if, and list commands. Add a section to the macro command documentation explaining in detail how macro arguments are not variables.
* Convert builtin help to reStructuredText source filesKitware Robot2013-10-151-0/+238
Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.