diff options
| author | zhihaoy <43971430+zhihaoy@users.noreply.github.com> | 2019-02-22 18:29:05 -0600 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-02-22 16:29:05 -0800 |
| commit | 4ad78224c989953cde21c77dd63345b9f722671b (patch) | |
| tree | f19e079d7e57f7c76f57c3e04b10ed01a1f7f3b9 /docs | |
| parent | 9c8a15919991920b42bc9710cc34fdf59dbd36b4 (diff) | |
| download | vcpkg-4ad78224c989953cde21c77dd63345b9f722671b.tar.gz vcpkg-4ad78224c989953cde21c77dd63345b9f722671b.zip | |
[docs] Show how to default VCPKG_TARGET_TRIPLET (#5346)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/users/integration.md | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/users/integration.md b/docs/users/integration.md index 10f5574c1..6d56c7c70 100644 --- a/docs/users/integration.md +++ b/docs/users/integration.md @@ -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 |
