Ensure that all vcpkg ports have working CMake usage instructions. #18224
NicolBolas
started this conversation in
Ideas
Replies: 1 comment
-
As an example of the problems that these things are causing, consider the I eventually discovered a
Obvious, right? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My understanding of the purpose of package managers like vcpkg is that they are intended to make consumption of user-created C++ libraries easier to use, preferably to the point of being trivial. To me, this involves making each of the following steps fairly straightforward:
It seems to me that vcpkg is pretty good at items 1 and 2. But thus far, 3 seems to be rather lacking.
At first, vcpkg seemed to be pretty good at 3. When you successfully install and build a port, vcpkg spits out a blob of text that can be copied into your CMake project file. So all you need to do to consume a project is to follow the instructions.
However, as I started to use more projects, I found that some of them have no such instructions. In at least one case (Cairo, if you're interested), they had such instructions until an update removed them. Thus breaking my build and forcing me to find alternatives.
This lead down the "FindPkgConfig" rabbit hole.
See, I don't really know much about CMake. I never learned CMake, and quite frankly, I don't really want to. I want to spend as little time on my build system as possible. So overall, I've just been cobbling together working scripts from fragments. So when vcpkg gave me a set of stuff to copy into my CMake file, I could do that.
But some vcpkg ports don't give you instructions. Do they have CMake package files that work under
find_package
, or are you expected to useFindPkgConf
? If it's the latter, what exactly do you need to do? Exactly what package name do you search for, what library files do you incorporate? And most importantly... how do you figure that out?Ultimately, it all boils down to finding the library's installation instructions and following them. This also means hoping that the instructions on Windows aren't just "precompiled binaries can be found here. Good luck, loser!" Such instructions typically require knowing otherwise irrelevant details about where vcpkg sticks its build products, finding out the exact name of each of these libraries, making sure the headers are right, and investigating any
#define
s the library might need.If I have to look at the specific installation instructions for each package before I can use it... how helpful is vcpkg really? Yes, it makes downloading the appropriate files easier, but cloning a Git repo isn't exactly a challenge these days. Yes, it makes compiling them easier, but if the project has a CMake build script, compiling it isn't the hard part. And yes, it handles dependencies automatically, which is one of the hard parts of using C++ libraries. And it centralizes everything, which is helpful.
But ultimately, the most laborious part of using a C++ library, figuring out how to actually use it correctly, seems to be pot-luck with vcpkg. Some ports provide
find_package
support and a good set of working instructions, and those are great. Some ports provide "FindPkgConfig" support with no instructions on how to use it, which is functional but less great. And some ports don't even bother with that, leaving you to just look for directories or hope that any#define
s are listed on the library's website.So from my perspective, vcpkg seems rather incomplete. If it is not feasible to have a consistent way to use each package port, then at least force all ports to have copy-and-pasteable instructions for how to consume them (instructions that ideally ought to be testable).
I don't think that's too much to ask of a good package manager.
Beta Was this translation helpful? Give feedback.
All reactions