Skip to content

Commit 18d9caf

Browse files
committed
Explain CMake syntax with 3 main elements
1 parent c35bbc6 commit 18d9caf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/cmake/introduction.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,30 @@ This allows breaking down complex configurations into manageable components.
147147

148148
## 4. CMake syntax
149149

150+
CMake syntax consists of the following 3 elements:
151+
152+
* Comments (single and multi-line)
153+
* Commands (functions and macros defined in modules, and CMake built-in
154+
commands)
155+
* Command arguments
156+
157+
```cmake
158+
# This is a line comment.
159+
160+
#[[
161+
This is a multi-line comment.
162+
]]
163+
164+
some_command()
165+
166+
another_command(
167+
"quoted argument"
168+
[[bracket argument]]
169+
unquoted_argument
170+
${variable}
171+
)
172+
```
173+
150174
### 4.1. Variables
151175

152176
In CMake, variables are essential for storing and manipulating data throughout

0 commit comments

Comments
 (0)