Skip to content

Support CMake scripts #97

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Support CMake scripts #97

wants to merge 2 commits into from

Conversation

godbyk
Copy link

@godbyk godbyk commented Jun 25, 2017

CMake has the following end-wise pairings:

  • foreach() / endforeach()
  • function() / endfunction()
  • if() / endif()
  • macro() / endmacro()
  • while() / endwhile()

The end forms can take an optional argument, though the argument is ignored. This code leaves that argument empty.

CMake's commands are case-insensitive (e.g., function(), Function(), FUNCTION(), and fUnCtIoN() are all equivalent). This code will maintain the case of the opening command and prefix END if and only if the command is written in ALL CAPS. In all other cases (i.e., the command is written in lowercase or mixed case), end will be prefixed.

Examples:

if(SOME_CONDITION)
    # ...
endif()

Function(MyFunction)
    # ...
endFunction()

WHILE(TRUE)
    # ...
ENDWHILE()

godbyk and others added 2 commits June 25, 2017 15:12
CMake has the following end-wise pairings:

 * `foreach()` / `endforeach()`
 * `function()` / `endfunction()`
 * `if()` / `endif()`
 * `macro()` / `endmacro()`
 * `while()` / `endwhile()`

The `end` forms can take an optional argument, though the argument is ignored. This code leaves that argument empty.

CMake's commands are case-insensitive (e.g., `function()`, `Function()`, `FUNCTION()`, and `fUnCtIoN()` are all equivalent). This code will maintain the case of the opening command and prefix `END` if any only if the command is written in ALL CAPS. In all other cases (i.e., the command is written in lowercase or mixed case), `end` will be prefixed.

Examples:

```cmake
if(SOME_CONDITION)
    # ...
endif()

Function(MyFunction)
    # ...
endFunction()

WHILE(TRUE)
    # ...
ENDWHILE()
```
thetic added a commit to thetic/vim-cmake-syntax that referenced this pull request Oct 12, 2019
Derived from (seemingly dead) PR: tpope/vim-endwise#97
yous added a commit to yous/dotfiles that referenced this pull request Mar 10, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant