C++ Library Manager for Windows, Linux, and MacOS
Перейти к файлу
Billy O'Neal e79c0d2b5d
Add vcpkg_minimum_required before using VERSION. (#27598)
* When @BillyONeal started being the on-call vcpkg maintainer on 2022-10-17, he started applying use of the "embedded VERSION" feature https://github.com/microsoft/vcpkg-tool/pull/717 to PRs on merge.

@dg0yt points out that this use should be accompanied by a call to vcpkg_minimum_required, in https://github.com/microsoft/vcpkg/pull/27594/files#r1010641672

This is an audit of everything merged in that time and whether it needs to gain that.

https://github.com/microsoft/vcpkg/pull/27561 No VERSION
https://github.com/microsoft/vcpkg/pull/27525 No VERSION
https://github.com/microsoft/vcpkg/pull/27554 Already has vcpkg_minimum_required
https://github.com/microsoft/vcpkg/pull/27536 No VERSION
https://github.com/microsoft/vcpkg/pull/27562 No VERSION
https://github.com/microsoft/vcpkg/pull/24914 Fixed here
https://github.com/microsoft/vcpkg/pull/27547 No VERSION
https://github.com/microsoft/vcpkg/pull/27502 No VERSION
https://github.com/microsoft/vcpkg/pull/27497 No VERSION
https://github.com/microsoft/vcpkg/pull/27317 No VERSION
https://github.com/microsoft/vcpkg/pull/27288 No VERSION
https://github.com/microsoft/vcpkg/pull/27509 No VERSION
https://github.com/microsoft/vcpkg/pull/27504 No VERSION
https://github.com/microsoft/vcpkg/pull/27514 No VERSION
https://github.com/microsoft/vcpkg/pull/27501 No VERSION
https://github.com/microsoft/vcpkg/pull/27495 No VERSION
https://github.com/microsoft/vcpkg/pull/27488 No VERSION
https://github.com/microsoft/vcpkg/pull/27499 No VERSION
https://github.com/microsoft/vcpkg/pull/27378 No VERSION
https://github.com/microsoft/vcpkg/pull/27376 Fixed here
https://github.com/microsoft/vcpkg/pull/27373 No VERSION
https://github.com/microsoft/vcpkg/pull/27045 No VERSION
https://github.com/microsoft/vcpkg/pull/27521 No VERSION
https://github.com/microsoft/vcpkg/pull/27453 No VERSION
https://github.com/microsoft/vcpkg/pull/27481 No VERSION
https://github.com/microsoft/vcpkg/pull/27511 No VERSION
https://github.com/microsoft/vcpkg/pull/27490 No VERSION
https://github.com/microsoft/vcpkg/pull/27510 No VERSION
https://github.com/microsoft/vcpkg/pull/27496 No VERSION
https://github.com/microsoft/vcpkg/pull/27503 No VERSION
https://github.com/microsoft/vcpkg/pull/27485 No VERSION
https://github.com/microsoft/vcpkg/pull/27484 No VERSION
https://github.com/microsoft/vcpkg/pull/27483 No VERSION
https://github.com/microsoft/vcpkg/pull/27459 No VERSION
https://github.com/microsoft/vcpkg/pull/27369 No VERSION
https://github.com/microsoft/vcpkg/pull/27489 No VERSION
https://github.com/microsoft/vcpkg/pull/26594 No VERSION
https://github.com/microsoft/vcpkg/pull/27465 No VERSION
https://github.com/microsoft/vcpkg/pull/27456 No VERSION
https://github.com/microsoft/vcpkg/pull/27425 No VERSION
https://github.com/microsoft/vcpkg/pull/27464 Fixed here
https://github.com/microsoft/vcpkg/pull/27406 No VERSION
https://github.com/microsoft/vcpkg/pull/27398 No VERSION
https://github.com/microsoft/vcpkg/pull/27240 No VERSION
https://github.com/microsoft/vcpkg/pull/27450 No VERSION
https://github.com/microsoft/vcpkg/pull/27463 No VERSION
https://github.com/microsoft/vcpkg/pull/27462 No VERSION
https://github.com/microsoft/vcpkg/pull/27448 No VERSION
https://github.com/microsoft/vcpkg/pull/27440 No VERSION
https://github.com/microsoft/vcpkg/pull/27435 No VERSION
https://github.com/microsoft/vcpkg/pull/27424 No VERSION
https://github.com/microsoft/vcpkg/pull/27414 No VERSION
https://github.com/microsoft/vcpkg/pull/27412 No VERSION
https://github.com/microsoft/vcpkg/pull/27380 No VERSION
https://github.com/microsoft/vcpkg/pull/27343 No VERSION
https://github.com/microsoft/vcpkg/pull/27342 No VERSION
https://github.com/microsoft/vcpkg/pull/27367 No VERSION
https://github.com/microsoft/vcpkg/pull/27226 No VERSION
https://github.com/microsoft/vcpkg/pull/27320 No VERSION
https://github.com/microsoft/vcpkg/pull/26923 No VERSION
https://github.com/microsoft/vcpkg/pull/27284 No VERSION
https://github.com/microsoft/vcpkg/pull/27433 No VERSION
https://github.com/microsoft/vcpkg/pull/27314 VERSION got *removed*
https://github.com/microsoft/vcpkg/pull/27335 No VERSION
https://github.com/microsoft/vcpkg/pull/27370 No VERSION
https://github.com/microsoft/vcpkg/pull/27324 No VERSION
https://github.com/microsoft/vcpkg/pull/27391 No VERSION
https://github.com/microsoft/vcpkg/pull/27388 No VERSION
https://github.com/microsoft/vcpkg/pull/27396 No VERSION
https://github.com/microsoft/vcpkg/pull/27404 No VERSION
https://github.com/microsoft/vcpkg/pull/27413 No VERSION
https://github.com/microsoft/vcpkg/pull/27417 No VERSION
https://github.com/microsoft/vcpkg/pull/27427 No VERSION
https://github.com/microsoft/vcpkg/pull/27428 No VERSION
https://github.com/microsoft/vcpkg/pull/27368 No VERSION
https://github.com/microsoft/vcpkg/pull/27307 No VERSION
https://github.com/microsoft/vcpkg/pull/27415 Fixed here.
https://github.com/microsoft/vcpkg/pull/27371 Fixed here.
https://github.com/microsoft/vcpkg/pull/27323 No VERSION
https://github.com/microsoft/vcpkg/pull/27352 No VERSION
https://github.com/microsoft/vcpkg/pull/27347 No VERSION
https://github.com/microsoft/vcpkg/pull/27366 No VERSION
https://github.com/microsoft/vcpkg/pull/27361 No VERSION
https://github.com/microsoft/vcpkg/pull/27359 No VERSION
https://github.com/microsoft/vcpkg/pull/27358 No VERSION
https://github.com/microsoft/vcpkg/pull/27355 No VERSION
https://github.com/microsoft/vcpkg/pull/27331 No VERSION
https://github.com/microsoft/vcpkg/pull/24615 No VERSION
https://github.com/microsoft/vcpkg/pull/27325 No VERSION
https://github.com/microsoft/vcpkg/pull/24861 No VERSION
https://github.com/microsoft/vcpkg/pull/27354 No VERSION
https://github.com/microsoft/vcpkg/pull/27346 No VERSION
https://github.com/microsoft/vcpkg/pull/27345 No VERSION
https://github.com/microsoft/vcpkg/pull/27218 No VERSION
https://github.com/microsoft/vcpkg/pull/27329 No VERSION
https://github.com/microsoft/vcpkg/pull/27326 No VERSION
https://github.com/microsoft/vcpkg/pull/27321 No VERSION
https://github.com/microsoft/vcpkg/pull/27312 No VERSION
https://github.com/microsoft/vcpkg/pull/27297 No VERSION
https://github.com/microsoft/vcpkg/pull/27336 No VERSION
https://github.com/microsoft/vcpkg/pull/27225 No VERSION
https://github.com/microsoft/vcpkg/pull/27339 No VERSION
https://github.com/microsoft/vcpkg/pull/27302 No VERSION
https://github.com/microsoft/vcpkg/pull/27295 No VERSION
https://github.com/microsoft/vcpkg/pull/27233 No VERSION
https://github.com/microsoft/vcpkg/pull/27313 No VERSION
https://github.com/microsoft/vcpkg/pull/27237 No VERSION
https://github.com/microsoft/vcpkg/pull/27250 No VERSION
https://github.com/microsoft/vcpkg/pull/27263 No VERSION
https://github.com/microsoft/vcpkg/pull/27266 No VERSION
https://github.com/microsoft/vcpkg/pull/27272 No VERSION
https://github.com/microsoft/vcpkg/pull/27287 No VERSION
https://github.com/microsoft/vcpkg/pull/27282 No VERSION
https://github.com/microsoft/vcpkg/pull/27294 No VERSION
https://github.com/microsoft/vcpkg/pull/27228 No VERSION
https://github.com/microsoft/vcpkg/pull/27163 No VERSION
https://github.com/microsoft/vcpkg/pull/26817 No VERSION
https://github.com/microsoft/vcpkg/pull/27286 No VERSION
https://github.com/microsoft/vcpkg/pull/27274 No VERSION
https://github.com/microsoft/vcpkg/pull/27276 No VERSION
https://github.com/microsoft/vcpkg/pull/27232 No VERSION
https://github.com/microsoft/vcpkg/pull/27221 No VERSION
https://github.com/microsoft/vcpkg/pull/27215 No VERSION
https://github.com/microsoft/vcpkg/pull/27166 No VERSION
https://github.com/microsoft/vcpkg/pull/27239 No VERSION
https://github.com/microsoft/vcpkg/pull/27246 No VERSION
https://github.com/microsoft/vcpkg/pull/27268 No VERSION
https://github.com/microsoft/vcpkg/pull/27259 No VERSION
https://github.com/microsoft/vcpkg/pull/27238 No VERSION
https://github.com/microsoft/vcpkg/pull/27224 No VERSION
https://github.com/microsoft/vcpkg/pull/27203 No VERSION
https://github.com/microsoft/vcpkg/pull/27124 No VERSION

* Also add libcanberra
2022-11-08 14:49:28 -08:00
.github warn when vcpkg_extract_source_archive_ex is used (#27433) 2022-10-24 17:09:56 -07:00
docs Add optional LFS support to vcpkg_from_git (#27461) 2022-11-07 07:55:41 -08:00
ports Add vcpkg_minimum_required before using VERSION. (#27598) 2022-11-08 14:49:28 -08:00
scripts Add optional LFS support to vcpkg_from_git (#27461) 2022-11-07 07:55:41 -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 [android] Add --host flags to triplets (#27246) 2022-10-17 07:37:03 -07:00
versions Add vcpkg_minimum_required before using VERSION. (#27598) 2022-11-08 14:49:28 -08:00
.gitattributes [vcpkg] Make C++ the primary github language (#12810) 2020-08-10 09:28:50 -07:00
.gitignore [docs registries] Add reference documentation (#17672) 2021-05-06 12:13:29 -07:00
.vcpkg-root
CHANGELOG.md Actually remove policheck sensitive term. (#20332) 2021-09-27 11:48:53 -07:00
CONTRIBUTING.md
CONTRIBUTING_zh.md Fixed inaccurate Chinese words (#23179) 2022-02-24 20:54:11 -08:00
LICENSE.txt [vcpkg] remove text from license (#8082) 2019-09-06 14:24:19 -07:00
NOTICE.txt Add third party notices -- copied from chakracore (#7403) 2019-07-24 11:07:55 -07:00
README.md [docs] Revert FetchContent section (#27311) 2022-11-01 15:32:26 -07:00
README_es.md [docs] Split integration.md per Build System. (#24737) 2022-05-17 17:12:53 -07:00
README_fr.md Typo "Github"→"GitHub" (#26441) 2022-08-22 09:18:59 -07:00
README_ko_KR.md Typo "Github"→"GitHub" (#26441) 2022-08-22 09:18:59 -07:00
README_zh_CN.md Update README_zh_CN.md (#26456) 2022-08-22 09:25:00 -07:00
SECURITY.md Microsoft mandatory file (#24791) 2022-05-18 17:06:39 -07:00
bootstrap-vcpkg.bat
bootstrap-vcpkg.sh
shell.nix [vcpkg] Add shell.nix for building on NixOS (#15906) 2021-02-03 11:20:35 -08:00

README.md

Vcpkg: Overview

中文总览 Español 한국어 Français

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.

Finally, if you're interested in the future of vcpkg, check out the manifest guide! This is an experimental feature and will likely have bugs, so try it out and open all the issues!

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 for CMake projects, and installing it globally for Visual Studio projects. 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.

For any other tools, including Visual Studio Code, check out the integration guide.

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 for CMake projects.

$ 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.

For any other tools, check out the integration guide.

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

Open the Toolchains settings (File > Settings on Windows and Linux, CLion > Preferences on macOS), and go to the CMake settings (Build, Execution, Deployment > CMake). Finally, in CMake options, add the following line:

-DCMAKE_TOOLCHAIN_FILE=[vcpkg root]/scripts/buildsystems/vcpkg.cmake

You must add this line to each profile.

Vcpkg as a Submodule

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 in 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 docs/about/privacy.md