Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add integrate.md #24756

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
84 changes: 84 additions & 0 deletions docs/commands/integrate.md
@@ -0,0 +1,84 @@
# vcpkg integrate

**The latest version of this documentation is available on [GitHub](https://github.com/Microsoft/vcpkg/tree/master/docs/commands/integrate.md).**

## Synopsis

**Buildsystem Integration**
```no-highlight
vcpkg integrate [options] install
vcpkg integrate [options] remove
vcpkg integrate [options] project
```
**Shell Integration**
```no-highlight
vcpkg integrate [options] powershell
vcpkg integrate [options] bash
vcpkg integrate [options] zsh
vcpkg integrate [options] x-fish
```

## Description

Integrate vcpkg with shells and buildsystems.

### `vcpkg integrate install`

Integrates with [Visual Studio](../users/integration.md#msbuild-integration-visual-studio) (Windows-only), sets the user-wide vcpkg instance, and displays CMake integration help.

On Windows with Visual Studio 2015, this subcommand will add redirecting logic into the MSBuild installation which will automatically pick up each user's user-wide vcpkg instance. Visual Studio 2017 and newer have this logic in the box.

To set the user-wide vcpkg instance, vcpkg creates a few short files containing the absolute path to the vcpkg instance inside the user's user-wide configuration location:

- `%LOCALAPPDATA%\vcpkg` or `%APPDATA%\Local\vcpkg` on Windows
- `$HOME/.vcpkg` or `/var/.vcpkg` on non-Windows

Displays the full path to the [CMake toolchain](../users/integration.md#cmake-integration). Running this command is not required to use the toolchain file.

### `vcpkg integrate remove`

Removes the user-wide vcpkg instance setting.

This command deletes the linking files from the user-wide configuration location created by `vcpkg integrate install`.

### `vcpkg integrate project`

Creates a linked NuGet package for MSBuild integration.

See [MSBuild Per-Project Integration](../users/integration.md#per-project-integration) for more information.

### `vcpkg integrate powershell`

**Windows Only**

Adds vcpkg tab-completion support to the current user's Powershell profile.

### `vcpkg integrate bash`

**Non-Windows Only**

Adds vcpkg tab-completion support to the current user's `.bashrc` (`.bash_profile` on MacOS).
Comment on lines +56 to +60
Copy link
Contributor

@Neumann-A Neumann-A May 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OT: Why don't we have this for the windows git bash ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's behind an #ifdef; otherwise I don't see why it couldn't work.


### `vcpkg integrate zsh`

**Non-Windows Only**

Adds vcpkg tab-completion support to the current user's `.zshrc`.

### `vcpkg integrate x-fish`

**Non-Windows Only**

Adds vcpkg tab-completion support to the current user's fish shell completions directory.

## Example
```no-highlight
$ vcpkg integrate install
Applied user-wide integration for this vcpkg root.

CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=/workspaces/vcpkg/scripts/buildsystems/vcpkg.cmake"
ras0219-msft marked this conversation as resolved.
Show resolved Hide resolved
```

## Options

All vcpkg commands support a set of [common options](common-options.md).