diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/examples/patching.md | 10 | ||||
| -rw-r--r-- | docs/users/config-environment.md | 2 | ||||
| -rw-r--r-- | docs/users/integration.md | 9 | ||||
| -rw-r--r-- | docs/users/triplets.md | 26 |
4 files changed, 31 insertions, 16 deletions
diff --git a/docs/examples/patching.md b/docs/examples/patching.md index 98115400e..b152231e2 100644 --- a/docs/examples/patching.md +++ b/docs/examples/patching.md @@ -147,11 +147,11 @@ Finally, we need to apply the patch after extracting the source. ```cmake # ports\libpng\portfile.cmake ... -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24 - PATCHES "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES + "use-abort-on-all-platforms.patch" ) vcpkg_configure_cmake( diff --git a/docs/users/config-environment.md b/docs/users/config-environment.md index 103c1c547..f25df89a3 100644 --- a/docs/users/config-environment.md +++ b/docs/users/config-environment.md @@ -26,7 +26,7 @@ This environment variable can be set to the full path of an executable to be use This environment variable can be set to a directory to use as the root of the vcpkg instance. Note that mixing vcpkg
repo versions and executable versions can cause issues.
-#### VCPKG_DEFAULT_VS_PATH
+#### VCPKG_VISUAL_STUDIO_PATH
This environment variable can be set to the full path to a Visual Studio instance on the machine. This Visual Studio instance
will be used if the triplet does not override it via the [`VCPKG_VISUAL_STUDIO_PATH` triplet setting](triplets.md#VCPKG_VISUAL_STUDIO_PATH).
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 diff --git a/docs/users/triplets.md b/docs/users/triplets.md index 4f23c8e27..87fa72fd3 100644 --- a/docs/users/triplets.md +++ b/docs/users/triplets.md @@ -53,25 +53,33 @@ This option also has forms for configuration-specific and C flags: ## Windows Variables -### VCPKG_PLATFORM_TOOLSET -Specifies the VS-based C/C++ compiler toolchain to use. - -This can be set to `v141`, `v140`, or left blank. If left blank, we select the latest compiler toolset available on your machine. - -Visual Studio 2015 platform toolset is `v140` -Visual Studio 2017 platform toolset is `v141` - <a name="VCPKG_VISUAL_STUDIO_PATH"></a> ### VCPKG_VISUAL_STUDIO_PATH Specifies the Visual Studio installation to use. -When unspecified, a Visual Studio instance is selected automatically, preferring Stable 2017, then Preview 2017, then 2015. +To select the precise combination of Visual Studio instance and toolset version, we walk through the following algorithm: +1. Determine the setting for `VCPKG_VISUAL_STUDIO_PATH` from the triplet, or the environment variable `VCPKG_VISUAL_STUDIO_PATH`, or consider it unset +2. Determine the setting for `VCPKG_PLATFORM_TOOLSET` from the triplet or consider it unset +3. Gather a list of all pairs of Visual Studio Instances with all toolsets available in those instances + 1. This is ordered first by instance type (Stable, Prerelease, Legacy) and then by toolset version (v142, v141, v140) +4. Filter the list based on the settings for `VCPKG_VISUAL_STUDIO_PATH` and `VCPKG_PLATFORM_TOOLSET`. +5. Select the best remaining option The path should be absolute, formatted with backslashes, and have no trailing slash: ```cmake set(VCPKG_VISUAL_STUDIO_PATH "C:\\Program Files (x86)\\Microsoft Visual Studio\\Preview\\Community") ``` +### VCPKG_PLATFORM_TOOLSET +Specifies the VS-based C/C++ compiler toolchain to use. + +See [`VCPKG_VISUAL_STUDIO_PATH`](#VCPKG_VISUAL_STUDIO_PATH) for the full selection algorithm. + +Valid settings: +* The Visual Studio 2019 platform toolset is `v142`. +* The Visual Studio 2017 platform toolset is `v141`. +* The Visual Studio 2015 platform toolset is `v140`. + ## MacOS Variables ### VCPKG_INSTALL_NAME_DIR |
