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
The vcpkg `version` will automatically generate the `url` from the [official repository](https://github.com/microsoft/vcpkg/releases). For a custom registry you can specify your own `url` (and omit the `version`). You can browse available packages on [vcpkg.io](https://vcpkg.io/en/packages.html).
170
+
The vcpkg `version` will automatically generate the `url` from the [official repository](https://github.com/microsoft/vcpkg/releases). For a custom registry you can specify your own `url` (and omit the `version`). You can browse available packages on [vcpkg.io](https://vcpkg.io/en/packages.html) or [vcpkg.link](https://vcpkg.link).
170
171
171
172
To specify package features you can use the following syntax: `imgui[docking-experimental,freetype,sdl2-binding,opengl3-binding]`. To disable the [default features](https://learn.microsoft.com/en-us/vcpkg/concepts/default-features) you can do: `cpp-httplib[core,openssl]`
172
173
173
-
The `overlay-ports` feature allows you to embed vcpkg ports inside your project, without having to fork the main vcpkg registry or creating a custom registry. You can find more information in the relevant [documentation](https://learn.microsoft.com/en-us/vcpkg/concepts/overlay-ports).
174
+
The `overlay-ports` feature allows you to embed vcpkg ports inside your project, without having to fork the main vcpkg registry or creating a custom registry. You can find more information in the relevant [documentation](https://learn.microsoft.com/en-us/vcpkg/concepts/overlay-ports). The `overlay-triplets` feature allows you to customize triplets and change the default behavior (for example always preferring static libraries on Windows). To specify both in one go you can do `[vcpkg].overlay = "my-overlay"`.
174
175
175
176
## Packages
176
177
@@ -218,28 +219,28 @@ Table keys that match CMake variable names (`[A-Z_]+`) will be passed to the [`F
compile-features = [""]# C++ standard version (cxx_std_20)
231
232
private-compile-features = [""]
232
-
compile-options = [""]
233
+
compile-options = [""]# compiler flags
233
234
private-compile-options = [""]
234
-
include-directories = [""]
235
+
include-directories = [""]# include paths/directories
235
236
private-include-directories = [""]
236
-
link-directories = [""]
237
+
link-directories = [""]# library directories
237
238
private-link-directories = [""]
238
-
link-libraries = [""]
239
+
link-libraries = [""]# dependencies
239
240
private-link-libraries = [""]
240
-
link-options = [""]
241
+
link-options = [""]# linker flags
241
242
private-link-options = [""]
242
-
precompile-headers = [""]
243
+
precompile-headers = [""]# precompiled headers
243
244
private-precompile-headers = [""]
244
245
245
246
cmake-before = """
@@ -258,6 +259,35 @@ CXX_STANDARD_REQUIRED = true
258
259
FOLDER = "MyFolder"
259
260
```
260
261
262
+
A table mapping the cmkr features to the relevant CMake construct and the relevant documentation pages:
263
+
264
+
| cmkr | CMake construct | Description |
265
+
| ---- | ----- | ----------- |
266
+
|`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). |
269
+
|`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. |
270
+
|`compile-definitions`|[`target_compile_definitions`](https://cmake.org/cmake/help/latest/command/target_compile_definitions.html)| Adds a macro definition (define, `-DMYMACRO=XXX`). |
271
+
|`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. |
279
+
280
+
The default [visibility](/basics) is as follows:
281
+
282
+
| Type | Visibility |
283
+
| ------------ | ----------- |
284
+
|`executable`|`PRIVATE`|
285
+
|`library`|`PUBLIC`|
286
+
|`shared`|`PUBLIC`|
287
+
|`static`|`PUBLIC`|
288
+
|`object`|`PUBLIC`|
289
+
|`interface`|`INTERFACE`|
290
+
261
291
## Templates
262
292
263
293
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