How to integrate Vcpkg with Meson Build system (Modern way)

Photo by Steve A Johnson from Pexels
Well, I already published a way to make Meson work with vcpkg and today I have a newer way to do the same.
I was writing a simple SFTP client and I needed the libssh library. Here is the modern way to set it up:
Prerequisites
- Install vcpkg as usual
- Install Visual Studio, Desktop C++ to make it works
Step-by-Step Guide
-
Install dependencies:
1$ vcpkg install libssh pkgconfNote: Remember to install
pkgconf; Meson needs it to find where the libraries are. -
Configure your PATH: Add the
vcpkg/installed/x64-windows/tools/pkgconffolder to your$PATH, and renamepkgconf.exetopkg-config.exe. -
Set up Environment Variables: Create a new environment variable named
PKG_CONFIG_PATHand point it tovcpkg/installed/x64-windows/lib/pkgconfig. -
Run your app: Finally, add the DLL path (
lib/) to yourPATHso you can run your built app.