Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,24 @@ This will still allow people to not use vcpkg,
by passing the `CMAKE_TOOLCHAIN_FILE` directly,
but it will make the configure-build step slightly easier.

### Specifying Triplets

Vcpkg uses triplets to capture the desired target platform, and link type, as well as the host platform and link type.
If the default triplets are not used, then they must be specified both when building packages and when using them.
See the documenation on [integrating](docs/users/integration.md) and [host dependencies](docs/users/host-dependencies.md) for more information.

When installing packages, the triplets can be specified with command line flags.
`--triplet [triplet]` for target packages and `--host-triplet [triplet]` for host dependencies.

For projects cmake projects using the vcpkg toolchain, the triplets can be specified using the `VCPKG_TARGET_TRIPLET` and `VCPKG_HOST_TRIPLET` respectivley.
For example
```
-DVCPKG_TARGET_TRIPLET=[target-triplet]
-DVCPKG_HOST_TRIPLET=[host-triplet]
```

For both installation and use, `VCPKG_TARGET_TRIPLET` and `VCPKG_HOST_TRIPLET` environment variables can also be used.

[getting-started:using-a-package]: docs/examples/installing-and-using-packages.md
[getting-started:integration]: docs/users/integration.md
[getting-started:git]: https://git-scm.com/downloads
Expand Down
10 changes: 10 additions & 0 deletions docs/examples/installing-and-using-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ To remove the integration for your user, you can use `.\vcpkg integrate remove`.
The best way to use installed libraries with cmake is via the toolchain file `scripts\buildsystems\vcpkg.cmake`. To use this file, you simply need to add it onto your CMake command line as:
`-DCMAKE_TOOLCHAIN_FILE=D:\src\vcpkg\scripts\buildsystems\vcpkg.cmake`.

When using non-default triplets, they need to specified for cmake.
They can be specified using the `VCPKG_TARGET_TRIPLET` and `VCPKG_HOST_TRIPLET` respectivley.
For example
```
-DVCPKG_TARGET_TRIPLET=[target-triplet]
-DVCPKG_HOST_TRIPLET=[host-triplet]
```

Alternativley, `VCPKG_TARGET_TRIPLET` and `VCPKG_HOST_TRIPLET` environment variables can also be used.

If you are using CMake through Open Folder with Visual Studio you can define `CMAKE_TOOLCHAIN_FILE` by adding a "variables" section to each of your `CMakeSettings.json` configurations:

```json
Expand Down