Say I have a C++ project that is split in several subprojects. The subproject all produce a DLL and different teams of developers work on each of the subproject. Now if I want to build the main project, is there a way to avoid having to build all the subprojects by myself?
In short, I'm looking for something that does the dependency management (i.e. for binary files and headers) in a similar way as Maven does for Java.
In fact, I tried to use Maven for this but this is rather cumbersome because I have to create the packages manually and quite frequently, Maven misses to pick up the most recent changes. Also, running the compilation is a bit of a hack as I have to call NAnt from within Maven (I use NAnt's feature to build Visual Studio solutions directly).
Any hints and ideas of how to do this?
The best alternative is GNU Make, which is both free and Open Source. Other great apps like Maven are CMake, Gradle, SCons and Meson. Apache Maven is a Java-based tool for build automation and project management (in software development).
I'm quite happy with the result, the usual maven commands can be used to grab dependencies, compile, clean, and deploy. I would definitely use Maven for dependency management for C and C++ projects, or really any other situation where you need it, and it isn't already provided for whatever reason.
The dependency management section is a mechanism for centralizing dependency information. When you have a set of projects that inherit from a common parent, it's possible to put all information about the dependency in the common POM and have simpler references to the artifacts in the child POMs.
Open the dependency POM and find the transitive dependency you want to exclude. Copy groupId and artifactId . In your project POM, underneath your active dependency, enter exclusions and using code completion paste the copied info of the dependency you want to exclude.
Initial Answer: I would suggest using CMake. It is a multi-platform make file generator (generates Visual Studio or Eclipse CDT projects as well).
http://www.cmake.org/
I did really good experience with it. The best thing I like about it was the ability to produce generic project structure. So you can generically include sub-projects look-up for unit tests etc. without changing the script every time.
They have also lots of modules on how to find pre-installed build libraries, required for the project (like Boost, QT etc.)
Update: In the mean time there was some effort to introduce package management for C++. Some projects worth looking at:
Note as pointed out by @RAM in the comments cpm is no longer actively maintained.
For the dependency management, it exists a new project (it is a startup company) which is implementing this type of tool: https://github.com/biicode (a C++ dependency manager). You could add your dependencies and it should work.
Currently, the project's name is conan.io, they were acquired by JFrog.
UPDATE: The project is dead... Unfortunately, it seems the startup couldn't get enough premium paying customers, but the server seems is working fine...
UPDATE2: It seems there is a substitute project: conan.io (thanks @mucaho)
I recommend the following high-level build systems:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With