# naming conventions for CMake functions

**URL:** https://discourse.cmake.org/t/naming-conventions-for-cmake-functions/4615
**Category:** Development
**Created:** [December 7, 2021, 4:33pm UTC](https://discourse.cmake.org/t/naming-conventions-for-cmake-functions/4615 "2021-12-07T16:33:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hex](https://discourse.cmake.org/user_avatar/discourse.cmake.org/hex/32/363_2.png) [@hex](https://discourse.cmake.org/u/hex)
#### Post date: [December 7, 2021, 4:33pm UTC](https://discourse.cmake.org/t/naming-conventions-for-cmake-functions/4615/1 "2021-12-07T16:33:17Z")

</div>

In general, CMake functions use the following naming convention:

```
command names are all lowercase with words separated by underscores

```

For example:

```cmake
ExternalData_add_test(...)
ExternalData_add_target(...)
ExternalData_expand_arguments(...)

```

Some CMake modules use a different notation:

```cmake
ExternalProject_Get_Property(...)
ExternalProject_Add_StepTargets(...)
ExternalProject_Add_Step(...)
ExternalProject_Add_StepDependencies(...)
ExternalProject_Add(...)

FetchContent_Declare(...)
FetchContent_MakeAvailable()
FetchContent_GetProperties(...)
FetchContent_Populate(...)

```

Are there more conventions? Is it possible to make the documentation more consistent? I suggest adding naming conventions to `Help/dev/documentation.rst` under the section `Style: CMake Command Signatures`

Function names are case insensitive. For my own projects i use the same casing as used by the CMake documentation. For consistency I am considering to use the lowercased version, instead - unless i am overlooking something.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 7, 2021, 4:46pm UTC](https://discourse.cmake.org/t/naming-conventions-for-cmake-functions/4615/2 "2021-12-07T16:46:33Z")

</div>

Making it more explicit seems fine to me (that `MakeAvailable` might be more difficult to handle 😕 ).

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [December 7, 2021, 5:37pm UTC](https://discourse.cmake.org/t/naming-conventions-for-cmake-functions/4615/4 "2021-12-07T17:37:40Z")

</div>

Conventions evolved over time. For module-provided functions, I’ve opened [CMake MR 6793](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6793) to document the current conventions.
