How to handle dependencies in cross platform C++ projects?

Viewed 962

This are the ways I see for dealing with external libraries in a cross-platform project in an automated way. (Why are there no cross platform package managers?)

  • Add compiled binaries to the repository. (This doesn't work, since platform and build configuration vary and new environments may come up.)
  • Write download scripts to fetch source code from the internet. I could think of cloning the libraries from Github or from the projects' websites via HTTP. (This breaks when download links change. Moreover, I don't know a way to automate the build of all libraries.)
  • Include source code of all dependencies into the repository, alternatively as sub repositories. (The problem still is to find an automated way of compiling them. Also it requires a lot of space.)

What is the workflow for handling external libraries in cross-platform C++ projects? With many big projects out there, I guess there must have emerged one. If not, based on which criteria can I decide between reasonable ways?

1 Answers
Related