当前位置: 首页 > 工具软件 > vcpkg-tool > 使用案例 >

VCpkg究竟是个什么东西?

邢凯歌
2023-12-01

英文介绍转载自https://blogs.msdn.microsoft.com/vcblog/2016/09/19/vcpkg-a-tool-to-acquire-and-build-c-open-source-libraries-on-windows/ 中间省略介绍C++库。

We are delighted to announce the availability of Vcpkg on GitHub https://github.com/Microsoft/vcpkg . Vcpkg simplifies acquiring and building open source libraries on Windows.

Acquiring native libraries on Windows is a critical part of the application development process; in our surveys, you told us that 80% of your C++ projects depend on two or more libraries. Despite this, we’ve heard that the current process for acquiring native libraries falls below C++ developers’ expectations when compared to other platforms such as Mac (Homebrew) and Linux (apt-get, yum, etc.)

After examining successes across all platforms, we’ve created Vcpkg with these set of principles:

  • Open-source tools
  • No installation needed
  • Repeatable builds, from source
  • Customizable builds
  • Open to contributions from community
  • Ports collection approach

We created a document that goes into more details on these topics.

Getting Started

Prerequisites:

  • Visual Studio 2015 or Visual Studio 2017 (on Windows)
  • Windows 7 (or up)
  • Linux or MacOS (vcpkg is now cross platform, see announcement)

To acquire the tool:

  • Clone from GitHub: git clone https://github.com/Microsoft/vcpkg
  • Run the bootstrap script in the vcpkg folder:
  • C:\src\vcpkg> .\bootstrap-vcpkg.bat
  • Ubuntu:~/$ ./bootstrap-vcpkg.sh
  • Now vcpkg.exe is in the root of the repository

You are now all set (no installation, no registry… the tool and the associated “lib folder” are xcopy-able)

We accept contributions for new libraries, updates and improvements. See examples on how to create your own port file in the catalog.

Use Vcpkg with your projects

The easiest way to use Vcpkg from Visual Studio is through the user-wide integration, making the system available to all VS projects you build.

vcpkg integrate install

This will require administrator access the first time it is used on a given machine. After the first use, administrator access is no longer required and the integration is on a per-user basis.

In addition to the VS integration, Vcpkg also supports CMake and other build systems. For more information, see docs/EXAMPLES.

We want to hear from you!

This tool is now available for you to try. Please share your feedback and suggestions! The best place to provide them is in the GitHub repo: create new issues or vote on existing ones. We would love to accept pull requests for more open-source libraries — see docs/index.md.

You can also contact us at vcpkg@microsoft.com

 

 

 类似资料: