Search code examples
c++visual-studiocmakevcpkg

Use vcxproj instead of Cmake for internal vcpkg port


We have some libraries written in Visual Studio that we would like to share with other projects in different solutions in different repos.

I liked the idea of using an internal vcpkg registry to distribute those libraries to those other solutions/projects.

My concern here is that the libraries we'd like to share are vcxproj projects, and I believe vcpkg requires "ports" (packages) to be Cmake projects.

Is my understanding correct? If we want to expose those libraries via an internal vcpkg registry we'd have to convert those projects to Cmake projects?


Solution

  • Vcpkg has built-in support for wrapping MSBuild (ie. sln/vcxproj) projects. See the function vcpkg_install_msbuild

    Many projects still use the deprecated vcpkg_build_msbuild, though. Using git grep I can find a few portfiles that will work as examples: