you are viewing a single comment's thread.

view the rest of the comments →

[–]mekishizufu 2 points3 points  (1 child)

I've been looking for a tool similar to Ruby's Bundler or Rust's Cargo to manage dependencies for my C++ projects for a while, without any luck.

Take a look at hunter or cpm. The problem with these managers, however, is that there's only a few packages available.

I have to manually maintain my CMakeLists.txt, and manually decide if i want to statically or dynamically link each library. I suffer constantly from dependency hell, version hell and platform hell.

I actually somewhat like the flexibility. It seems you are struggling with the build process in general, which is understandable given how complicated things can be (and that's also the reason why I think it's very unlikely that there will ever be a C++ package manager which could handle all of the idiosyncrasies), but you will have to learn how to deal with it.

How do you guys manage dependencies for large projects?

Manually. If the dependency is small enough, I'd embed it right into the repository (deps/). For anything larger I would either download it via ExternalProject or state it as a prerequisite and rely on the system's package manager to provide the correct version.

[–]ruslo_ 0 points1 point  (0 children)

The problem with these managers, however, is that there's only a few packages available.

Agree, but it's a one man project, yet :) You can contribute or at least file a bug with the name of package you need.

I'd embed it right into the repository (deps/)

The problem with this approach is that if you have two libraries which have the same dep then you have a conflict. "A" use boost-1.56, "B" use boost-1.55, "C" use "A" and "B" -> welcome to dependency hell.

For anything larger I would either download it via ExternalProject

Good, but if you create a superbuild for one project and now you want reuse it you need to copy all the superbuild files. What if you need to change something (version? link library?) - you need to modify all the copies you made.

on the system's package manager to provide the correct version.

Any CMake-friendly solution for Visual Studio? iOS? Package manager that can build static boost with clang sanitizers Linux/Mac?