BPM: A CMake native Package-Manager with Dependency-Graph-Solving and Binary-Caching

I’ve been using CPM.cmake as a Package Manager for quite some time, and I really like its approach. Especially how easy it is to use and how you can teach it to someone else in a minute.

Over time, though, I ran into a few limitations, especially in larger projects.

The first was that not every library is well suited to being pulled in with add_subdirectory(). Some projects make assumptions about their build environment, expose global options, or simply work much better as properly installed dependencies.

The second was binary caching. CPM makes it easy to cache sources, but I wanted to cache the builds and installations as well, so that dependencies wouldn’t have to be rebuilt every time another project used them. This can significantly reduce development and build times.

So I started building BPM.cmake (https://github.com/TobiasWallner/BPM.cmake).

BPM is inspired by CPM and extends its idea into a package manager that:

  • Is easy to use and explain in under a minute. No configuration files. No learing Python or another programming language. Everything is defined in CMakeLists.txt.
  • Caches repositories, sources, builds, and installations for different versions
  • Supports SemVer dependency version constraints
  • Has dependency graph solving
  • Tracks build metadata such as the compiler, compiler flags, OS, and more to enable deterministic and reusable builds
  • Works with existing repositories that have a working CMakeLists.txt, no centrally managed package repository is required

I’ve also started using BPM in my professional work (Mainly for C++ projects), and it has made dependency management much easier for me. Another thing I really like is that I can explain it easily to colleagues who studied physics rather than programming and only have limited C++ and CMake experience.

I’d love to get feedback from other CMake users.

Would you use this package manager yourself?
Is it as easy to understand and use as I make it out to be?
What problems or edge cases have you encountered or am i missing?
Are there any features you feel are missing?

Best Regards,
Tobias