cxpm docs

Describe your C++ project in C++.

cxpm is a package manager and build tool for C++. A project is described in a package.cpp, cxpm fetches and builds what it depends on, and the result is handed to the package manager of the system it is installed on.

#include <CXPM/Project.hpp>
#include <CXPM/Target.hpp>

using namespace CXPM;

auto target = Target()
                  .name_set("greeter")
                  .version_set("0.1.0")
                  .type_set("static-library")
                  .sources_append({"src/*.cpp"})
                  .include_directories_append({"include"})
                  .options_append({CompilerOptions::StandardCxx23,
                                   CompilerOptions::WarningsAll})
                  .dependencies_append({"fmt >= 10"})
                  .create();

auto project = Project().target_set(target).tests_append("tests").create();
cxpm build      # fetch and configure what is needed, then compile
cxpm test       # build and run the tests projects
cxpm pack       # a package for pacman, rpm, dpkg, or a plain archive
cxpm install    # install that package

One project, one target

A project builds one thing: an executable, a library, headers or data. Tests, examples and tools are projects of their own that depend on it, so nothing is special-cased.

A lifecycle, not a script

fetch, configure, build, pack, install. Each stage runs the ones before it when they are out of date, and only then.

A sysroot per project

Dependencies built from source are installed into .cxpm/sysroot, not into your system. A toolchain can point at another sysroot to build for another distribution.

Native packages

cxpm pack writes a pacman, rpm or deb package and cxpm install gives it to that package manager, so the system knows what cxpm installed.

Confined manifests and builds

A package.cpp is code. It is compiled, loaded and run in a process that sees the project and nothing else, with no network.

Builds itself

cxpm is a cxpm workspace. A bare C++ compiler builds the first cxpm, which builds, tests and packs the real one.

Project status

cxpm is experimental and its manifest API still changes between versions. The plan and what is done are on the roadmap ; every issue and requirement is on the project board, planning.pb, at the root of the repository.

Start here