Cargo-inspired package manager for C++ with absolutely no dependencies! Because manually creating src/, CMakeLists.txt, and build/ for every project is hell. also because i hate cmake.
cppkg init— scaffold a new C++ project in secondscppkg add author/repo@version— fetch dependencies directly from GitHubcppkg build— fetches dependencies,creates lock file and compiles.cppkg clean— remove build artifacts and cloned dependencies- Workspace support — manage multiple packages under one root
- SSH with HTTPS fallback for dependency cloning
- Cross-platform — Windows (MSVC), Linux (GCC, Clang)
NOTE cppkg has cmakelists generation support for all cmake freaks out there
Download the latest binary from Releases and add it to your PATH.
git clone https://github.com/deform-labs/cppkg
cd cppkg
cmake -B build -S cppkg
cmake --build buildAdd the output directory to your PATH.
Note: cppkg is self-hosting — once you have a binary, you can use
cppkg build cppkgto rebuild itself.
cppkg init my-project
cd my-project
Creates:
my-project/
├── src/
│ └── main.cpp
├── .gitignore
└── cppkg.toml
cppkg add fmtlib/fmt@10.1.0
cppkg add gabime/spdlog@v1.12.0
cppkg add nlohmann/json@v3.11.2 --https
- Format:
author/repo@version - Validates the remote repo exists before writing to
cppkg.toml - SSH by default, HTTPS fallback automatic (or force with
--https)
cppkg build # build current directory
cppkg build my-project
- Reads
cppkg.tomlfor project metadata - Clones any missing dependencies into
target/deps/ - Compiles with your own compiler! no cmake and nothing extra is needed. use your pre-existing compiler on your computer!
- Automatically parallel (uses all CPU cores) and cached (fast rebuilds)
cppkg remove fmtlib/fmt
cppkg clean
cppkg clean my-project
Removes target/deps/ and build artifacts.
[package]
name = "my-project"
version = "0.1.0"
cpp_std = "c++20"
[dependencies]
fmtlib/fmt = "10.1.0"
gabime/spdlog = "v1.12.0"The key under [dependencies] is author/repo, the value is the tag or branch to clone.
Group multiple packages under one root.
cppkg workspace init my-workspace
cd my-workspace
cppkg init my-lib
cppkg init my-app
my-workspace/cppkg.toml:
[workspace]
members = [
"my-lib",
"my-app",
]Packages initialized inside a workspace are automatically registered as members.
please look at the source files to understand the layout.
- No conflict resolution for transitive dependencies
MIT