|
nxpp
Header-only graph utilities on top of Boost Graph Library
|
This document explains how to consume nxpp from another project today.
For which surfaces are stable versus experimental, see `STABILITY.md`.
nxpp is currently a header-only C++20 library built on top of the Boost Graph Library (BGL).
That means:
nxpp library to linknxpp from the modular include/ tree, from the installed CMake package, or from the tested single-header release assetBefore choosing an include form, distinguish these cases clearly:
nxpp: #include "include/nxpp.hpp"#include <nxpp.hpp> or #include <nxpp/...>#include <nxpp.hpp>Generated-reference companions:
Some README examples are intentionally written for the repository root and use:
That form is appropriate when:
-I. from the repository rootIt is not the normal external-consumer include form.
For external consumption, prefer the options below.
If you vendor the repository or otherwise copy the include/ tree into your project, put that include/ directory on your compiler include path.
Then use:
or narrower semantic headers such as:
Minimal example:
Minimal compile command:
If Boost is not installed in a standard compiler search path, add the appropriate include directory for your Boost installation too.
This is the normal external modular-header path.
nxpp now provides an installable/exported CMake package config.
After installing it into a prefix, consumers can use:
Minimal consumer-side configure example:
This path assumes:
GitHub releases publish a tested nxpp.hpp asset.
This is the intended single-file distribution for external consumers.
Place that file somewhere under your project's include/vendor directory and put that directory on the compiler include path.
Then use:
Minimal compile command:
nxpp depends on Boost Graph headers. The minimum supported Boost version is 1.86.0.
The repository compatibility workflow tests Boost 1.86.0 as the minimum supported version and the latest Boost release available from archives.boost.io.
On Ubuntu / Debian the repository CI installs:
The header also performs a compile-time include check and fails early if the required BGL headers are missing.
Inside the repository:
include/nxpp.hpp is the canonical umbrella headerdist/nxpp.hpp is a generated artifact used for validation and release prepFor external users:
nxpp.hpp asset attached to a GitHub releasedist/nxpp.hpp as the source of truth#include "include/nxpp.hpp" examples with the normal external single-header path; external consumers should include the shipped file as <nxpp.hpp>#include "include/nxpp.hpp" only when you are compiling directly inside a clone of the repo#include <nxpp.hpp> when your project points at the include/ treeadd_subdirectory(...) when nxpp is checked into your source tree as a dependencyfind_package(nxpp CONFIG REQUIRED) workflowToday the documented external-consumption story is intentionally minimal:
It does not yet assume:
Debian / Ubuntu packaging was evaluated as a possible next distribution step, but is intentionally deferred for now. A Debian source package or Ubuntu PPA story would add meaningful maintenance overhead beyond the current project needs, while the existing source, installed-package, Conan, and vcpkg overlay paths already cover the main external-consumption scenarios.
Conan support now exists as a local recipe in the repository:
conanfile.py models nxpp as a header-only packageMinimal local Conan validation command:
This assumes:
vcpkg support now exists as a repository-hosted overlay-port path in the repository:
packaging/vcpkg/ports/nxpp/portfile.cmakepackaging/vcpkg/ports/nxpp/vcpkg.jsonfind_package(nxpp CONFIG REQUIRED) has also been validated locallyTypical local overlay-port install shape:
This assumes:
vcpkg is installed in your environmentA release-based AUR packaging path also now exists in the repository under packaging/aur/.
nxpp package shape (not nxpp-git)makepkg, namcap, and regenerated .SRCINFO from PKGBUILD)For CMake consumers that prefer pinned-tag Git consumption over system package managers, the near-term recommended path is documented FetchContent / CPM.cmake usage.
Minimal FetchContent shape:
Minimal CPM.cmake shape:
Guidance notes:
vX.Y.Z) rather than branch headsfind_package(nxpp CONFIG REQUIRED)) as the primary long-lived path when you control the environmentThe repository version remains the source of truth for all distributed package paths maintained inside this repo.
That means a published release tag vX.Y.Z is expected to line up with:
project(nxpp VERSION X.Y.Z) in CMakeLists.txtversion = "X.Y.Z" in conanfile.py"version-string": "X.Y.Z" in packaging/vcpkg/ports/nxpp/vcpkg.jsonThis does not imply that every external channel is published at exactly the same moment. It does mean that the repository-hosted package definitions should track the tagged release directly, and that any lagging or policy-gated channel should be called out explicitly in the docs.
If you vendor the repository, you can also consume it through CMake:
This minimal CMake path currently assumes:
nxpp is available as a subdirectory or vendored checkoutFor repository development there is also a minimal CMake-driven path for the formal test suite.
Configure with:
Then build and run the registered tests with:
This path currently covers the main formal modular test binaries. It is meant as a cross-platform repository build path, not as a replacement for the existing shell scripts or for the single-header validation flow.
The repository now keeps platform-specific runners under:
scripts/unix/ for the Unix/macOS .sh entry pointsscripts/windows/ for the PowerShell counterparts