All Projects → microsoft → Vcpkg

microsoft / Vcpkg

Licence: other
C++ Library Manager for Windows, Linux, and MacOS

Programming Languages

CMake
9771 projects
powershell
5483 projects
shell
77523 projects
python
139335 projects - #7 most used programming language
ruby
36898 projects - #4 most used programming language
Qt Script
14 projects

Projects that are alternatives of or similar to Vcpkg

Cmakeconverter
This project aims to facilitate the conversion of Visual Studio to CMake projects.
Stars: ✭ 387 (-97.32%)
Mutual labels:  cmake, visual-studio
Genie
GENie - Project generator tool
Stars: ✭ 693 (-95.2%)
Mutual labels:  cmake, visual-studio
Conan
Conan - The open-source C/C++ package manager
Stars: ✭ 5,498 (-61.95%)
Mutual labels:  cmake, package-manager
Xmake
🔥 A cross-platform build utility based on Lua
Stars: ✭ 4,229 (-70.73%)
Mutual labels:  visual-studio, package-manager
Moderncppci
This is an example of doing a Modern C++ project with CI
Stars: ✭ 109 (-99.25%)
Mutual labels:  cmake, visual-studio
Cget
C++ package retrieval
Stars: ✭ 370 (-97.44%)
Mutual labels:  cmake, package-manager
Modern Cpp Template
A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.
Stars: ✭ 690 (-95.22%)
Mutual labels:  cmake, package-manager
ck-env
CK repository with components and automation actions to enable portable workflows across diverse platforms including Linux, Windows, MacOS and Android. It includes software detection plugins and meta packages (code, data sets, models, scripts, etc) with the possibility of multiple versions to co-exist in a user or system environment:
Stars: ✭ 67 (-99.54%)
Mutual labels:  package-manager, libraries
Openrct2
An open source re-implementation of RollerCoaster Tycoon 2 🎢
Stars: ✭ 10,115 (-30%)
Mutual labels:  cmake, visual-studio
Cmake Get
Get dependencies with cmake
Stars: ✭ 59 (-99.59%)
Mutual labels:  cmake, package-manager
Thyme
An open source re-implementation of Generals : Zero Hour written in C++.
Stars: ✭ 313 (-97.83%)
Mutual labels:  cmake, visual-studio
Chronoshift
An open source re-implementation of Red Alert written in C++.
Stars: ✭ 144 (-99%)
Mutual labels:  cmake, visual-studio
S25client
Return To The Roots (Settlers II(R) Clone)
Stars: ✭ 288 (-98.01%)
Mutual labels:  cmake, visual-studio
Cmake Conan
CMake wrapper for conan C and C++ package manager
Stars: ✭ 374 (-97.41%)
Mutual labels:  cmake, package-manager
Boomerang
Boomerang Decompiler - Fighting the code-rot :)
Stars: ✭ 265 (-98.17%)
Mutual labels:  cmake, visual-studio
Cpm.cmake
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.
Stars: ✭ 560 (-96.12%)
Mutual labels:  cmake, package-manager
inqlude
Command line client for independent Qt library archive
Stars: ✭ 30 (-99.79%)
Mutual labels:  package-manager, libraries
flatn
flat node dependencies
Stars: ✭ 18 (-99.88%)
Mutual labels:  package-manager, packages
Composer
Dependency Manager for PHP
Stars: ✭ 25,994 (+79.9%)
Mutual labels:  package-manager, packages
Core Plans
Core Habitat Plan definitions
Stars: ✭ 129 (-99.11%)
Mutual labels:  package-manager, packages

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.

Build Status

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

If you're using vcpkg with CMake, the following may help!

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

Unfortunately, you'll have to add this 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 [email protected] with any additional questions or comments.

License

The code in this repository is licensed under the MIT License.

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].