Preferred way to add third party library to git project

Let's say that I use gtest and I used to include sources in my project (and cmake) so that they are generated locally - as recommended.

How can I add this to the (public) git repository (e.g. on GitHub). Also add thrid member code (in subfolder)? I'm used to working in private svn repos where we just followed this approach. Not sure if this is recommended for public projects. Also, the frameworks will include their licenses, but I'm not sure if I should also explicitly reference them in the project root.

Is it possible in any way to reference the code for the framework i.e. do not fix the code, but do checks or build the project, if necessary, load the frame code? Is it better to just assert that the dependency exists and let everyone handle it locally?

+3


source to share


1 answer


You can use git submodules to reference dependencies.

Subcategories

Git allows you to include a completely different repository in a given directory and only save the link.



http://git-scm.com/book/en/v2/Git-Tools-Submodules

+2


source







All Articles