msbuild – Migrating large C++ multi-project Visual Studio solution from NuGet to vcpkg

I have a Visual Studio C++ solution (MsBuild) with over a hundred projects in it.

Some projects depend on third-party libs such as fmt, zlib and etc (which are stored on a shared drive as DLLs + headers, this is configured through .props files) and there are also dependencies on internal libs that come from private NuGet channels (also DLLs + headers, that is configured in .vsxproj files + packages.config).

I am trying to modernise/simplify dependency management and considering vcpkg as the main option and hoping that after the migration:

  1. to be able to specify version of a dependency at a solution level (as opposed to project level) so that when it’s time to update, it’s only one place to change.
  2. not have to migrate internal projects that the solution depends on to vcpkg (continue consuming them as NuGet packages even after migration vcpkg).
  3. (highly desirable) have unified mechanism to control NuGet and vcpkg dependencies (e.g. get rid of packages.config and have all configurations solely in vcpkg.json or similar)
  4. (optional) having “cache” of external dependencies at least on solution level (not having to build fmt for every project that depends on it separately)

In simple terms, I just want to have one place specifying all required dependencies and as little interaction with Nuget as possible. I never want two projects to use different versions of the same dependency.

I tried a basic tutorial from learn.microsoft.com/en-us/vcpkg/get_started/get-started-msbuild but I it does not seem to be bringing me any closer especially in the context of a solution with a lot of project solutions (I ended up with even more per-project configuration than I started from).

Any help or examples of set ups like this are highly appreciated. Thanks in advance.

Read more here: Source link