Skip to content

bengreenier/vcpkg.nuget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vcpkg.nuget

🚨🚨 THIS PROJECT IS NOT MAINTAINED ANYMORE, DO NOT USE IT 🚨🚨

vcpkg wrapped in nuget-y goodness 📦

build status

example gif

I needed a project local (not system wide) way to easily consume vcpkg that worked with no dependencies. This project aims to be that solution, distributed via nuget.

Note: This only supports vcpkg running as part of msbuild, and therefore requires windows.

How to use

See vcpkg.nuget-example for an example! ✨

This package relies on VcpkgPackage msbuild tasks, that leverage the following format:

<VcpkgPackage Include="packageName"/>

Where packageName refers to the vcpkg port you wish to install.

By default the task invoking vcpkg has a generous default timeout of ten minutes. If your package builds run longer than that, override the VcpkgTaskTimeout property with a higher value:

  <PropertyGroup>
    <!-- task may run for up to twenty minutes -->
    <VcpkgTaskTimeout>1200000</VcpkgTaskTimeout>
  </PropertyGroup>

Using Visual Studio

  • Install the nuget package
  • Find the relevant ports you wish to install here
  • Add VcpkgPackage elements to your project file
  • Building will ensure ports are built and installed

Using the shell

  • Install the nuget package
  • Import our build configuration in your project file:
<Import Project="packages\Vcpkg.Nuget.1.0.0-beta\build\Vcpkg.Nuget.props" Condition="Exists('packages\Vcpkg.Nuget.1.0.0-beta\build\Vcpkg.Nuget.props')" />
  • Find the relevant ports you wish to install here
  • Add VcpkgPackage elements to your project file
  • Building will ensure ports are built and installed

Overriding Triplets

Note: This approach is documented in the vcpkg docs as well. We're duplicating that info here as it's common scenario for folks consuming this library.

To override the automatically chosen triplet, you can specify the MSBuild property VcpkgTriplet in your .vcxproj. We recommend adding this to the Globals PropertyGroup.

<PropertyGroup Label="Globals">
  <!-- .... -->
  <VcpkgTriplet Condition="'$(Platform)'=='Win32'">x86-windows-static</VcpkgTriplet>
  <VcpkgTriplet Condition="'$(Platform)'=='x64'">x64-windows-static</VcpkgTriplet>
</PropertyGroup>

Contributing

CI Builds and Release managements takes place in a private VSTS instance. If you feel you need access (if you're a core contributor) please open an issue against @bengreenier.

  • Be nice and open to feedback.

Unless this project gets more traction, this is the only requirement to contribute.

License

MIT