mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 09:08:59 +08:00
[docs] Show how to default VCPKG_TARGET_TRIPLET (#5346)
This commit is contained in:
parent
9c8a159199
commit
4ad78224c9
@ -135,9 +135,16 @@ To override the automatically chosen [triplet][], you can specify the MSBuild pr
|
||||
```
|
||||
|
||||
#### With CMake
|
||||
Simply set `VCPKG_TARGET_TRIPLET` on the configure line.
|
||||
You can set `VCPKG_TARGET_TRIPLET` on the configure line:
|
||||
```no-highlight
|
||||
cmake ../my/project -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=...
|
||||
```
|
||||
If you use `VCPKG_DEFAULT_TRIPLET` [environment variable](config-environment.md) to contoll the unqualified triplet in vcpkg command lines you can default `VCPKG_TARGET_TRIPLET` in CMake like [Using an environment variable instead of a command line option](#using-an-environment-variable-instead-of-a-command-line-option):
|
||||
|
||||
```cmake
|
||||
if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
|
||||
set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "")
|
||||
endif()
|
||||
```
|
||||
|
||||
[triplet]: triplets.md
|
||||
|
Loading…
Reference in New Issue
Block a user