Managing 3rd party dependencies for C++
Haszlakiewicz, Eric
EHASZLA at transunion.com
Tue Apr 17 16:46:48 UTC 2012
On Tue, Apr 17, 2012 at 10:26:11, Hylton Peimer wrote:
> We have to parallel development groups.
>
> One group uses Java with Maven, and the maven manages dependencies
> with a local Sonatype Nexus repository.
>
> The C++ team also have many third party libraries which need to be
> managed. Since moving to HG we used subrepository feature of hg to
> bring the third party libraries from an SVN repository. Previous
> solution used SVN externals. SVN's advantage here is that we don't
> have to fetch the entire repository, instead only bring the required
> version in the .hgsub
>
> This solution is clumsy. Especially updating and adding new versions.
>
> Are there alternative solutions for managing third party C++ libs with
> Mercurial, on Windows.
If your third party libraries don't need to be custom compiled every time you do a build, I would recommend using Maven for those too, with the Nar plugin.
I have several libraries (some third party, some internally developed) that other projects depend on. I keep those in their own plain vanilla Mercurial repositories, with no sub-repo's involved.
The project that uses those libraries then has a few different directories (one for each dependent library) that each contain:
1) a Maven pom.xml file with
a dependency to the appropriate library (or type "nar")
a maven-nar-plugin configuration that specifies an unpackDirectory, plus some dummy values for "linker" and "c".
a maven-dependency-plugin configuration that bind the "unpack-dependencies" goal to the "process-resources" phase
2) a Makefile that does a "mvn process-resources", and then uses a couple tar commands piped together to copy whatever files maven unpacked into a build working directory where the rest of the build can find them.
In some ways it's trading the complexity of how we use Mercurial for the complexity of how things get built, but I've found that, for whatever reason, people have an easier time understanding things (and complain less!) if the source control part is kept simpler.
eric
More information about the Mercurial
mailing list