C++ Library Manager for Windows, Linux, and MacOS
Go to file
Siyuan Ren fe41b0abf5
Upgrade utf8proc to 2.9.0 (#36785)
<!-- If your PR fixes issues, please note that here by adding "Fixes
#NNNNNN." for each fixed issue on separate lines. -->

<!-- If you are still working on the PR, open it as a Draft:
https://github.blog/2019-02-14-introducing-draft-pull-requests/. -->

- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] SHA512s are updated for each updated download.
- [x] The "supports" clause reflects platforms that may be fixed by this
new version.
- [x] Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.
- [x] Any patches that are no longer applied are deleted from the port's
directory.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.

<!-- If this PR adds a new port, please uncomment and fill out this
checklist:

- [ ] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [ ] The name of the port matches an existing name for this component
on https://repology.org/ if possible, and/or is strongly associated with
that component on search engines.
- [ ] Optional dependencies are resolved in exactly one way. For
example, if the component is built with CMake, all `find_package` calls
are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or
disabled with
[CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html).
- [ ] The versioning scheme in `vcpkg.json` matches what upstream says.
- [ ] The license declaration in `vcpkg.json` matches what upstream
says.
- [ ] The installed as the "copyright" file matches what upstream says.
- [ ] The source code of the component installed comes from an
authoritative source.
- [ ] The generated "usage text" is accurate. See
[adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md)
for context.
- [ ] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [ ] Only one version is in the new port's versions file.
- [ ] Only one version is added to each modified port's versions file.

END OF NEW PORT CHECKLIST (delete this line) -->
2024-02-16 11:55:43 -08:00
.github [bot] automatically handle too short issues and internal compiler errors (#36673) 2024-02-15 23:59:09 -08:00
docs [docs] Add stubs to redirect to Microsoft Learn (#29820) 2023-02-23 17:11:56 -08:00
ports Upgrade utf8proc to 2.9.0 (#36785) 2024-02-16 11:55:43 -08:00
scripts Remove password from Osx Readme for azure pipelines (#36734) 2024-02-14 16:57:30 -08:00
toolsrc [vcpkg] Download vcpkg.exe rather than building it in bootstrap on Windows. (#15474) 2021-02-04 10:15:44 -08:00
triplets Add arm64-ios-release triplet (#36373) 2024-02-01 15:01:07 -08:00
versions Upgrade utf8proc to 2.9.0 (#36785) 2024-02-16 11:55:43 -08:00
.gitattributes [vcpkg] Make C++ the primary github language (#12810) 2020-08-10 09:28:50 -07:00
.gitignore ignore manifest stuff (#29979) 2023-03-03 10:54:45 -08:00
.vcpkg-root Add .vcpkg-root file that signifies the root directory 2016-09-19 18:49:38 -07:00
bootstrap-vcpkg.bat Fix paths with single quotes in bootstrap. (#36115) 2024-01-11 15:42:29 -08:00
bootstrap-vcpkg.sh [vcpkg] Update to CMake 3.14.0 2019-03-20 16:23:02 -07:00
CONTRIBUTING_pt.md Translations to PT (#28435) 2022-12-19 14:42:29 -08:00
CONTRIBUTING_zh.md Fixed inaccurate Chinese words (#23179) 2022-02-24 20:54:11 -08:00
CONTRIBUTING.md Moved CONTRIBUTING.md to root. Fixes #54. 2016-09-21 13:35:51 -07:00
LICENSE.txt Fix license text. (#29536) 2023-02-08 11:34:04 -08:00
NOTICE_pt.txt Translations to PT (#28435) 2022-12-19 14:42:29 -08:00
NOTICE.txt Add third party notices -- copied from chakracore (#7403) 2019-07-24 11:07:55 -07:00
README_es.md [vcpkg docs][ES] Sync with English readme (#32698) (#33230) 2023-08-24 16:22:08 -07:00
README_fr.md [Docs] Fix the broken link in README_xx.md (#32923) 2023-08-04 11:00:07 -07:00
README_ko_KR.md [Docs] Fix the broken link in README_xx.md (#32923) 2023-08-04 11:00:07 -07:00
README_pt.md [Docs] Fix the broken link in README_xx.md (#32923) 2023-08-04 11:00:07 -07:00
README_vn.md [vcpkg doc] Add Vietnamese Translation (#32524) 2023-08-24 16:29:00 -07:00
README_zh_CN.md [Docs] Fix the broken link in README_xx.md (#32923) 2023-08-04 11:00:07 -07:00
README.md Updating the information on CLion integration (#36196) 2024-01-24 15:26:46 -08:00
SECURITY.md Microsoft mandatory file (#24791) 2022-05-18 17:06:39 -07:00
shell.nix [vcpkg] Add shell.nix for building on NixOS (#15906) 2021-02-03 11:20:35 -08:00

Vcpkg: Overview

中文总览 Español 한국어 Français Tiếng Việt

Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. This tool and ecosystem are constantly evolving, and we always appreciate contributions!

If you've never used vcpkg before, or if you're trying to figure out how to use vcpkg, check out our Getting Started section for how to start using vcpkg.

For short description of available commands, once you've installed vcpkg, you can run vcpkg help, or vcpkg help [command] for command-specific help.

Table of Contents

Getting Started

First, follow the quick start guide for either Windows, or macOS and Linux, depending on what you're using.

For more information, see Installing and Using Packages. If a library you need is not present in the vcpkg catalog, you can open an issue on the GitHub repo where the vcpkg team and community can see it, and potentially add the port to vcpkg.

After you've gotten vcpkg installed and working, you may wish to add tab completion to your shell.

Quick Start: Windows

Prerequisites:

  • Windows 7 or newer
  • Git
  • Visual Studio 2015 Update 3 or greater with the English language pack

First, download and bootstrap vcpkg itself; it can be installed anywhere, but generally we recommend using vcpkg as a submodule so the consuming repo can stay self-contained. Alternatively, vcpkg can be installed globally; we recommend somewhere like C:\src\vcpkg or C:\dev\vcpkg, since otherwise you may run into path issues for some port build systems.

> git clone https://github.com/microsoft/vcpkg
> .\vcpkg\bootstrap-vcpkg.bat

To install the libraries for your project, run:

> .\vcpkg\vcpkg install [packages to install]

Note: This will install x86 libraries by default. To install x64, run:

> .\vcpkg\vcpkg install [package name]:x64-windows

Or

> .\vcpkg\vcpkg install [packages to install] --triplet=x64-windows

You can also search for the libraries you need with the search subcommand:

> .\vcpkg\vcpkg search [search term]

In order to use vcpkg with Visual Studio, run the following command (may require administrator elevation):

> .\vcpkg\vcpkg integrate install

After this, you can now create a New non-CMake Project (or open an existing one). All installed libraries are immediately ready to be #include'd and used in your project without additional configuration.

If you're using CMake with Visual Studio, continue here.

In order to use vcpkg with CMake outside of an IDE, you can use the toolchain file:

> cmake -B [build directory] -S . "-DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake"
> cmake --build [build directory]

With CMake, you will still need to find_package and the like to use the libraries. Check out the CMake section for more information, including on using CMake with an IDE.

Quick Start: Unix

Prerequisites for Linux:

Prerequisites for macOS:

First, download and bootstrap vcpkg itself; it can be installed anywhere, but generally we recommend using vcpkg as a submodule.

$ git clone https://github.com/microsoft/vcpkg
$ ./vcpkg/bootstrap-vcpkg.sh

To install the libraries for your project, run:

$ ./vcpkg/vcpkg install [packages to install]

You can also search for the libraries you need with the search subcommand:

$ ./vcpkg/vcpkg search [search term]

In order to use vcpkg with CMake, you can use the toolchain file:

$ cmake -B [build directory] -S . "-DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake"
$ cmake --build [build directory]

With CMake, you will still need to find_package and the like to use the libraries. Check out the CMake section for more information on how best to use vcpkg with CMake, and CMake Tools for VSCode.

Installing Linux Developer Tools

Across the different distros of Linux, there are different packages you'll need to install:

  • Debian, Ubuntu, popOS, and other Debian-based distributions:
$ sudo apt-get update
$ sudo apt-get install build-essential tar curl zip unzip
  • CentOS
$ sudo yum install centos-release-scl
$ sudo yum install devtoolset-7
$ scl enable devtoolset-7 bash

For any other distributions, make sure you're installing g++ 6 or above. If you want to add instructions for your specific distro, please open a PR!

Installing macOS Developer Tools

On macOS, the only thing you should need to do is run the following in your terminal:

$ xcode-select --install

Then follow along with the prompts in the windows that comes up.

You'll then be able to bootstrap vcpkg along with the quick start guide

Using vcpkg with CMake

Visual Studio Code with CMake Tools

Adding the following to your workspace settings.json will make CMake Tools automatically use vcpkg for libraries:

{
  "cmake.configureSettings": {
    "CMAKE_TOOLCHAIN_FILE": "[vcpkg root]/scripts/buildsystems/vcpkg.cmake"
  }
}

Vcpkg with Visual Studio CMake Projects

Open the CMake Settings Editor, and under CMake toolchain file, add the path to the vcpkg toolchain file:

[vcpkg root]/scripts/buildsystems/vcpkg.cmake

Vcpkg with CLion

Vcpkg is integrated in the CLion IDE. For details, see the official documentation.

Vcpkg as a Submodule with CMake

When using vcpkg as a submodule of your project, you can add the following to your CMakeLists.txt before the first project() call, instead of passing CMAKE_TOOLCHAIN_FILE to the cmake invocation.

set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake"
  CACHE STRING "Vcpkg toolchain file")

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.

Tab-Completion/Auto-Completion

vcpkg supports auto-completion of commands, package names, and options in both powershell and bash. To enable tab-completion in the shell of your choice, run:

> .\vcpkg integrate powershell

or

$ ./vcpkg integrate bash # or zsh

depending on the shell you use, then restart your console.

Examples

See the documentation for specific walkthroughs, including installing and using a package, adding a new package from a zipfile, and adding a new package from a GitHub repo.

Our docs are now also available online at our website https://vcpkg.io/. We really appreciate any and all feedback! You can submit an issue in https://github.com/vcpkg/vcpkg.github.io/issues.

See a 4 minute video demo.

Contributing

Vcpkg is an open source project, and is thus built with your contributions. Here are some ways you can contribute:

Please refer to our Contributing Guide for more details.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or email opencode@microsoft.com with any additional questions or comments.

License

The code in this repository is licensed under the MIT License. The libraries provided by ports are licensed under the terms of their original authors. Where available, vcpkg places the associated license(s) in the location installed/<triplet>/share/<port>/copyright.

Security

Most ports in vcpkg build the libraries in question using the original build system preferred by the original developers of those libraries, and download source code and build tools from their official distribution locations. For use behind a firewall, the specific access needed will depend on which ports are being installed. If you must install it in an "air gapped" environment, consider installing once in a non-"air gapped" environment, populating an asset cache shared with the otherwise "air gapped" environment.

Telemetry

vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by

  • running the bootstrap-vcpkg script with -disableMetrics
  • passing --disable-metrics to vcpkg on the command line
  • setting the VCPKG_DISABLE_METRICS environment variable

Read more about vcpkg telemetry at https://learn.microsoft.com/vcpkg/about/privacy.