Vcpkg
Another short article about little developers happiness. Any windows C++ developer can tell you, what a big headache setting up the Boost libraries is. It was so dreadful that some engineers used to build some version and stick with it until something extraordinary happens.
Now everything’s changed with new (relatively) little tool from Microsoft folks called Vcpkg (Visual C++ Packaging tool). It’s a small console tool which eases the open-source library management for all of your Visual Studio and CMake project.
And you don’t have to worry about binary compatibility or extreme size: vcpkg downloads source files and builds it with tools you’ve got on your computer. The good thing about this is the great amount of available libraries.
A couple of months ago I wanted to simplify the console interface in one of my applications. I went looking for the CLI library and it was… Well… Dreadful. Now imagine this process a couple of years ago: you download library sources, force them to compile for good hour or two, then try to use it in your program. Most of the time you find out that that’s not the droid you’re looking for.
Now with vcpkg everything became much simpler. All you have to do is scan the list, get the library and test it for yourself. Getting the library in a matter of one simple console (cmd or PowerShell, whichever you prefer) command:
vcpkg install tinyxml2 tinyxml2:x64-windows
And you’re good. Now open your Visual Studio project, write an #include
and you’re good to go. I cannot express enough how cool is that.
I started this article with Boost libraries. And they’re treated the same way. No more bjam and b2 nightmare, environment variables hell etc. Good days to be a C++ developer I must say.