This command cargo vcpkg
will create a vcpkg tree and install the packages specified in Cargo.toml
files in the crate being built and crates it depends on.
toml
[package.metadata.vcpkg]
git = "https://github.com/microsoft/vcpkg"
rev = "4c1db68"
install = ["pkg1", "pkg2"]
$ cargo install cargo-vcpkg
$ cargo vcpkg build
Fetching vcpkg
Checkout rev/tag/branch 4c1db68
Compiling pkg1, pkg2
Finished in 1.93s
$ cargo build
[...]
It is also possible to install different sets of packages per target, and override the vcpkg triplet to install.
```toml [package.metadata.vcpkg] git = "https://github.com/microsoft/vcpkg" rev = "4c1db68"
[package.metadata.vcpkg.target] x8664-apple-darwin = { install = ["sdl2"] } x8664-unknown-linux-gnu = { install = ["sdl2"] } x86_64-pc-windows-msvc = { triplet = "x64-windows-static", install = ["sdl2"] } ```
Install by running
cargo install cargo-vcpkg
See LICENSE-APACHE, and LICENSE-MIT for details.