I added the dependency by writing about three CMake lines.
And after that, it just works, for years.
I may have to add from 2, to 5 dependencies for a project, instead of the myriad of dependencies in JS. And they don't become obsolete and need an update each week.
It's a difference of some orders of magnitude, both in number and in upgrade frequency. This is a huge part of dependency management for me.
And there are C++ package managers like Conan, which solve your requirement of adding a dependency by just using the command line.
I will probably use Conan if I have to write C++ again.
Conan makes much of this easier, but is not really suited for large software projects with the problems mentioned above - in my experience.
About dependencies, if they can be found in the package manager then it goes that way. Else, they are a git submodule.
The most problematic has indeed been the C++ MySQL connector, because it has changed a bit over the last five years, so I had to edit the #include lines in the source code files.
When you are using git submodules as package manager, what do you do if the dependency doesn’t come with CMake files, but with autotools for example?
I think bazel is becoming a great solution for these problems if you align with their philosophy.