N
N
Nikolay Beketov2016-07-06 12:55:41
git
Nikolay Beketov, 2016-07-06 12:55:41

How to organize the storage of libraries and headers on which our project depends?

We develop various libraries in C++.
We store the library code in the repository.
But almost always, libraries have dependencies.
CURL, POCO, OPENSSL, BOOST, ASTERISK, PJSIP, etc.
How to properly organize the storage of auxiliary libraries so that each time you can build a version of your lib from the repository that will use a specific version of dependent libraries. Do not put them all in our repository.
Now we use a network folder with approximately the following structure

S:\_SharedLib\BOOST\boost_1_57_0
S:\_SharedLib\BOOST\boost_1_60_0
S:\_SharedLib\POCO\1.6.0
S:\_SharedLib\POCO\1.4.7
S:\_SharedLib\OPENSSL\openssl-1.0.2a
S: \_SharedLib\OPENSSL\openssl-1.0.2e
S:\_SharedLib\OPENSSL\openssl-1.0.2f

Is there any practice for this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vapaamies, 2016-07-06
@vapaamies

And so that the history is kept, so that we can take the version of our library for the last year and quickly build it with all the dependencies. Now we use a network folder simply.

SVN has such a thing as svn:externals. Git and Mercurial also probably have it, but hardly CVS.
The bottom line is that your storage stores a link to another (external) storage, and when deploying a working copy, the client follows these "symbolic links" and downloads everything recursively along them. In SVN, the slave working copies will look like normal ones, they will have their own .svn.
You only need the external storage to be of the same type as yours. Let's say SVN won't be able to download from external Git. If you download libraries not from repositories, but just an archive from the site, get yourself a separate repository for libraries and add all the necessary versions there.

A
Alexey Cheremisin, 2016-07-06
@leahch

You can do it differently.
Use a script, with dependencies, or just paste it into the Makefile as a separate target so that all dependencies can be pulled.
Or use submodules -

https://git-scm.com/book/ru/v1/Инструменты-Git-Подмодули

And switch from using CVS and SVN to git or mercurial!

S
Stanislav Makarov, 2016-07-06
@Nipheris

CMake will solve most of your problems:
https://cmake.org/cmake/help/v3.6/command/find_pac...
CMake:How To Find Libraries
Most - except for the problem of installing/managing dependent libraries. Those. CMake will try to find the correct version of the library on the system, but you must install it yourself. In * nix - systems, the system package manager does a good job of this, in Windows everything is bad (ie, we do it by hand).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question