Vcpkg

用于 Windows、Linux 和 MacOS 的 c++ 库管理器。(C++ Library Manager for Windows, Linux, and MacOS.)

  • Owner: microsoft/vcpkg
  • Platform: Linux, Mac, Windows
  • License:: Other
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Vcpkg

概述

Vcpkg 帮助您管理 Windows、Linux 和 MacOS 上的 C 和 c++ 库。这个工具和生态系统在不断发展;你的参与对它的成功至关重要!

有关可用命令的简短说明,请运行 vcpkg help 。

快速入门

先决条件:

  • Windows 10,8.1或7
  • Visual Studio 2017或Visual Studio 2015 Update 3
  • GIT中
  • 可选:CMake 3.10.2

克隆这个仓库,然后运行

> git clone https://github.com/Microsoft/vcpkg.git
> cd vcpkg
PS> .\bootstrap-vcpkg.bat
Linux:~/$ ./bootstrap-vcpkg.sh

然后,为了连接用户范围的集成,运行(注意:第一次使用时需要管理员)

PS> .\vcpkg integrate install
Linux:~/$ ./vcpkg integrate install

安装任何软件包

PS> .\vcpkg install sdl2 curl
Linux:~/$ ./vcpkg install sdl2 curl

与 CMake 一起使用已安装库的最佳方法是通过工具链文件 scripts\buildsystems \vcpkg.cmake。 要使用此文件,只需将其作为 -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake 添加到 CMake 命令行中。

在 Visual Studio 中,您可以创建一个新项目(或打开一个现有项目)。 所有已安装的库都可以立即进行 #include 并在您的项目中使用,而无需其他配置。

有关更多信息,请参阅我们的使用软件包示例以获取详细信息。 如果您的库不存在于 vcpkg 目录中,则可以在 GitHub 存储库上打开一个问题,开发团队和社区可以在其中查看该库,并有可能为此库创建移植文件。

有关 macOS 和 Linux 支持的其他说明可以在官方公告中找到。

Tab-Completion / Auto-Completion(标签完成/自动完成)

Vcpkg 支持在 Powershell 和 bash 中自动完成命令、包名、选项等。若要启用 tab-completion,请使用下列选项之一

PS> .\vcpkg integrate powershell
Linux:~/$ ./vcpkg integrate bash

然后重新启动Powershell。

示例

请参阅文档以了解特定的演练,其中包括使用软件包添加新软件包、以及从 GitHub repo 添加新包

我们的文档现在也可以通过 ReadTheDocs 在线获取: https://vcpkg.readthedocs.io/

查看4分钟的视频演示

贡献

Vcpkg是建立在您的贡献之上的。以下是您可以贡献的一些方法:

有关详情,请参阅我们的贡献指南

这个项目采用了 Microsoft开源行为准则。有关更多信息,请参阅行为准则常见问题解答或联系 opencode@microsoft.com 以及任何其他问题或意见。

许可证

根据MIT 许可证授权许可的代码。

Main metrics

Overview
Name With Ownermicrosoft/vcpkg
Primary LanguageCMake
Program languageCMake (Language Count: 8)
PlatformLinux, Mac, Windows
License:Other
所有者活动
Created At2016-09-15 16:40:50
Pushed At2022-08-07 17:39:21
Last Commit At2022-08-06 09:16:14
Release Count33
Last Release Name2022.07.25 (Posted on 2022-07-22 23:39:50)
First Release Name2019.06 (Posted on 2019-06-30 09:31:22)
用户参与
Stargazers Count16.4k
Watchers Count408
Fork Count4.7k
Commits Count16.8k
Has Issues Enabled
Issues Count12295
Issue Open Count905
Pull Requests Count10647
Pull Requests Open Count168
Pull Requests Close Count2260
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Vcpkg

Overview

Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. This tool and ecosystem are constantly evolving; your involvement is vital to its success!

For short description of available commands, run vcpkg help.

  • Windows 10, 8.1, 7, Linux, or MacOS
  • Visual Studio 2015 Update 3 or newer (on Windows)
  • Git
  • gcc >= 7 or equivalent clang (on Linux)
  • Optional: CMake 3.12.4

To get started:

> git clone https://github.com/Microsoft/vcpkg.git
> cd vcpkg

PS> .\bootstrap-vcpkg.bat
Linux:~/$ ./bootstrap-vcpkg.sh

Then, to hook up user-wide integration, run (note: requires admin on first use)

PS> .\vcpkg integrate install
Linux:~/$ ./vcpkg integrate install

Install any packages with

PS> .\vcpkg install sdl2 curl
Linux:~/$ ./vcpkg install sdl2 curl

The best way to use installed libraries with CMake is via the toolchain file scripts\buildsystems\vcpkg.cmake. To use this file, you simply need to add it onto your CMake command line as -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake.

In Visual Studio, you can create a New Project (or open an existing one). All installed libraries are immediately ready to be #include'd and used in your project without additional configuration.

For more information, see our using a package example for the specifics. If your library is not present in vcpkg catalog, you can open an issue on the GitHub repo where the dev team and the community can see it and potentially create the port file for this library.

Additional notes on macOS and Linux support can be found in the official announcement.

Tab-Completion / Auto-Completion

vcpkg supports auto-completion of commands, package names, options etc in Powershell and bash. To enable tab-completion, use one of the following:

PS> .\vcpkg integrate powershell
Linux:~/$ ./vcpkg integrate bash

and 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 ReadTheDocs: https://vcpkg.readthedocs.io/!

See a 4 minute video demo.

Contributing

Vcpkg is built with your contributions. Here are some ways you can contribute:

Please refer to our Contribution guidelines for more details.

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

License

Code licensed under the MIT License.