* wip commit * refactor openssl ports. * fix issues due to the file movement * qt build succesful. * qtbase finished? * add qttools and qtdeclarative * add EntryPoints to fixup_cmake_targets * add todo * more config fixup * correct entrypoint and remove winmain * format manifest * fix module issues * add extra vars * make qtdeclarative work (x64-windows). -static has problems * some extra cleanup tools start building * refactor code to use common script across ports * remove patch applied twice * remove copy pasta * add remaining qt6 ports * fix a few details * fix the rest * format manifests * add features to qt5compat. * small modification to directories * copy plugins * a bit of cleanup * smaller fixes * format manifest * fix_linux_configure_issue * adding linux features. * dont use quotes around INSTALL_ vars to fix linux build * fix script install on linux * remove bin if empty on all platforms otherwise let vcpkg throw an error * fix syncqt path * fix assimp feature * try to figure you ci failures * fix manifest format * change the head ref to dev add three required upstream cmake patches allow single config builds * fix typo * switch to use FEATURE_ instead of QT_FEATURE * [ZSTD] Update to 1.4.5 * [zstd] fix wrong assert to fix uwp regressions * always install *.pc file. Correct -l flag in pc file * remove any changes to vcpkg_copy_tools * fix orc regression * fix arrow regressions * fix zstd target suffix * fix orc zstd linkage * fix find_package(ZSTD) * fix icu linkage in harfbuzz * install zstd dlls. * skip qt5-base in ci to test qtbase due to conflicts * fix the patch due to a replacement error * add a way for vcpkg_from_github to only download the source archive and return the archive file name. * update everything to beta4. maybe qtdeclarative:x64-windows-static works now? * remove outdated patches * Print the failed condition * more debug messages * fix condition patch * update to beta5 * update vcpkg_from_git to support tags and make output of ref possible. * update ports * add missing qt ports, fix qtbase build * regenerate docs * fix typo * fix imageformats webp * fix qtdeclarative static builds msvc * more fixes * make the rest of qt build succesfully. (only tested x64-windows) * format manifest. * [vcpkg_from_git] new options TAG and OUT_REF - TAG github tag to checkout - OUT_REF github commit id related to tag or ref (useable for automatic updates of ports if used with a version tag) * fix importprefix in qml plugin targets in static builds * fix static qttools build on windows * move qml plugin fix into qtbase * try fixing staqtic build issues. * make comment in qtquickcontrols2 * dont promote targets * fix missing limits include * fix patch * pass options in qtopcua * fix freetype linkage * fix freetype a bit different * fix promotion patch * fix freetype wrapper without " * fix typo in patch * enable build of qtopcua * format manifest for ci to run * retry promotion * try again but explicity not promote Threads::Threads * push patch * [fontconfig] add vcpkg cmake wrapper. * fix empty statement in the wrapper * show files in bin if any * Apply suggestions from code review Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * additional changes due to CR * regenerate docs * qdoc is build if llvm is present. * fix merge issues * fix wayland deps * add qt5-base to skip for static-md * format manifest. * update all qt ports. Lets see which patches need to be fixed/removed * fix some regressions by removing patches no longer necessary. (needs further cleanup to actually remove the patches) * fix qtopcua * make qttools build on osx * fix dependency of qttranslations * fix qtwayland * fix typo * fix case * adjust ci baseline for qtwayland on osx due to missing system libs. * create directory before rename * trying to make osx work * create the directory and move the files * move the removing outside the foreach .... * update to 6.0.2 * remove some outdated patches * qt 6.1.0-beta1 ci testing * remove unused patches * fix a few issues with qt 6.1.0-beta1 qtvirtualkeyboard needs some features. + need to install cmake wrappers from qtimageformats. + move QtAxServer to manual-link * Fix missing qt cmake wrappers for qttools and qtshadertools. * block qt beta ports in CI * turn off beta build in CI * remove outdated patches * skip qt6 beta ports in CI * [gettext] add feature tools. * switch hunspell to configure_make for pc files * switch to manifest * hunspell remove port debug and add comment about tools * setup qtvirtualkeyboard features. * fix manifest format CI * only run wayland on linux * disable pthread detection in gettext on windows * fix hunspell host dependency * formant manifest * - add qt6 prefix - add qt.conf.in - make qtbase depend on itself (host dependency) and see what breaks. * cannot add qt6 to bin folder currently. * try the prefix method - add tools-path to vcpkg_fixup_cmake_targets - add destination to vcpkg_copy_tools * feature refinement * fix tools issues * update baseline * more feature refinement. * be less noise in logs * update version in gettext format-manifest. * add version details * move on to qt version 6.0.3 * build cmake test port against qt6 * move qt5 includes into include/qt5 * ws change in cmake to force rebuild * version stuff * add plugin_config patch * version stuff * use upstream plugin patch for 6.1 * version stuff * update to qt 6.1.0-beta3 * add alignment patch * fix hunspell include path * make the patch depend on architecture * add qbittorrent as a test port * downgrade qbittorrent a bit so that in can run in CI * remove bin in static builds * remove debug folder completly (since it is empty) * copy additional deps required by qtshadertools and qtdeclarative in qtbase to avoid issues with binary chaching. * fix logic * try upstream alignment patch * update baseline * add feature options to qt5compat * update to qt 6.1.0 * version stuff * fix qt.conf (for release builds only) * fix install of missing FindX modules in qtimageformats which where supposed to be fixed upstream but aren't * remove unnecessary patch * version stuff * fix some qt.conf stuff * install some wrappers for debug builds. * fine tuning qt.conf * fix debug windeployqt install but somebody is linking release icudt in debug * fix arm crossbuilds on windows * remove tools default line * version stuff * add missing host dependencies. * fix windeploy target correctly for debug * fix cmake arm builds. * some batch improvements * run qmake.debug.bat for debug builds. * version stuff * unconditionally include the patch in qtvirtualkeyboard * version stuff * more host dependencies * version stuff * more host deps * version stuff * fix qtactiveqt * version stuff * suppress batch skript output * version stuff * Apply CR changes * version stuff * newline attack * update qbittorrent test port and newline... * version stuff again * switch to version-semver * version stuff * remove qbittorrent test_port because - easier than rewriting history - qt6svg usage will probably be tested by paraview/vtk in the future Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com> Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Vcpkg: Overview
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.
- Github: https://github.com/microsoft/vcpkg
- Slack: https://cppalliance.org/slack/, the #vcpkg channel
- Discord: #include <C++>, the #🌏vcpkg channel
- Docs: Documentation
Table of Contents
- Vcpkg: Overview
- Table of Contents
- Getting Started
- Tab-Completion/Auto-Completion
- Examples
- Contributing
- License
- Telemetry
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: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:
- Apple Developer Tools
- On macOS 10.14 or below, you will also need:
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 10.15, 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.
On macOS 10.14 and previous, you'll also need to install g++ from homebrew; follow the instructions in the following section.
Installing GCC for macOS before 10.15
This will only be necessary if you're using a macOS version from before 10.15. Installing homebrew should be very easy; check out <brew.sh> for more information, but at its simplest, run the following command:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Then, in order to grab an up-to-date version of gcc, run the following:
$ brew install gcc
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
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 ReadTheDocs: https://vcpkg.readthedocs.io/!
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:
- Submit Issues in vcpkg or existing packages
- Submit Fixes and New Packages
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.
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 re-running the bootstrap-vcpkg script with -disableMetrics, passing --disable-metrics to vcpkg on the command line, or by setting the VCPKG_DISABLE_METRICS environment variable.
Read more about vcpkg telemetry at docs/about/privacy.md