You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
compile-features = [""]# C++ standard version (cxx_std_20)
231
231
private-compile-features = [""]
232
-
compile-options = [""]
232
+
compile-options = [""]# compiler flags
233
233
private-compile-options = [""]
234
-
include-directories = [""]
234
+
include-directories = [""]# include paths/directories
235
235
private-include-directories = [""]
236
-
link-directories = [""]
236
+
link-directories = [""]# library directories
237
237
private-link-directories = [""]
238
-
link-libraries = [""]
238
+
link-libraries = [""]# dependencies
239
239
private-link-libraries = [""]
240
-
link-options = [""]
240
+
link-options = [""]# linker flags
241
241
private-link-options = [""]
242
-
precompile-headers = [""]
242
+
precompile-headers = [""]# precompiled headers
243
243
private-precompile-headers = [""]
244
244
245
245
cmake-before = """
@@ -258,6 +258,35 @@ CXX_STANDARD_REQUIRED = true
258
258
FOLDER = "MyFolder"
259
259
```
260
260
261
+
A table mapping the cmkr features to the relevant CMake construct and the relevant documentation pages:
262
+
263
+
| cmkr | CMake construct | Description |
264
+
| ---- | ----- | ----------- |
265
+
|`alias`|[Alias Libraries](https://cmake.org/cmake/help/latest/command/add_library.html#alias-libraries)| Create an [alias target](https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#alias-targets), used for namespacing or clarity. |
|`headers`|[`target_sources`](https://cmake.org/cmake/help/latest/command/target_sources.html)| For readability (and future packaging). |
268
+
|`msvc-runtime`|[`MSVC_RUNTIME_LIBRARY`](https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html)| The [CMP0091](https://cmake.org/cmake/help/latest/policy/CMP0091.html) policy is set automatically. |
269
+
|`compile-definitions`|[`target_compile_definitions`](https://cmake.org/cmake/help/latest/command/target_compile_definitions.html)| Adds a macro definition (define, `-DMYMACRO=XXX`). |
270
+
|`compile-features`|[`target_compile_features`](https://cmake.org/cmake/help/latest/command/target_compile_features.html)| Specifies the C++ standard version (`cxx_std_20`). |
|`include-directories`|[`target_include_directories`](https://cmake.org/cmake/help/latest/command/target_include_directories.html)| Adds include directories. |
|`properties`|[`set_target_properties`](https://cmake.org/cmake/help/latest/command/set_target_properties.html)| See [properties on targets](https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html#properties-on-targets) for more information. |
278
+
279
+
The default [visibility](/basics) is as follows:
280
+
281
+
| Type | Visibility |
282
+
| ------------ | ----------- |
283
+
|`executable`|`PRIVATE`|
284
+
|`library`|`PUBLIC`|
285
+
|`shared`|`PUBLIC`|
286
+
|`static`|`PUBLIC`|
287
+
|`object`|`PUBLIC`|
288
+
|`interface`|`INTERFACE`|
289
+
261
290
## Templates
262
291
263
292
To avoid repeating yourself you can create your own target type and use it in your targets:
The `hello` target uses [conditions](/cmake-toml#conditions) to set different compiler flags depending on the platform. See the [targets](/cmake-toml/#targets) documentation for other things you can set.
30
+
The `hello` target uses [conditions](/cmake-toml#conditions) to set different compiler flags and definitions depending on the platform. See the [targets](/cmake-toml/#targets) documentation for other things you can set.
28
31
29
32
_Note_: In general you only want to specify flags _required_ to compile your code without errors.
# The `hello` target uses [conditions](/cmake-toml#conditions) to set different compiler flags depending on the platform. See the [targets](/cmake-toml/#targets) documentation for other things you can set.
17
+
# The `hello` target uses [conditions](/cmake-toml#conditions) to set different compiler flags and definitions depending on the platform. See the [targets](/cmake-toml/#targets) documentation for other things you can set.
15
18
# _Note_: In general you only want to specify flags _required_ to compile your code without errors.
0 commit comments