Install a Phosphor library
Link phosphor-* into a Qt6 CMake project: find_package, FetchContent, or Nix.
Every library installs as a standalone CMake package with headers under libs/phosphor-*/include/. The CMake shape is identical across the suite — find_package(Phosphor<Name>) → link Phosphor<Name>::Phosphor<Name>. The libraries index lists every slug.
Prerequisites
- CMake 3.16+.
- Qt 6.6+ with the modules the specific library depends on (
QtCore,QtGui,QtQml,QtQuick— see each library's Dependencies list at /libraries/). - A C++20-capable compiler (GCC 11+, Clang 14+).
- For Wayland-integrating libraries (
phosphor-shell,phosphor-layer,phosphor-protocol,phosphor-surfaces):wayland-scannerand the matching protocol headers. Distros usually ship them aswayland-devel/wayland-dev.
System package (find_package)
Once the libraries ship as distribution packages, use find_package with the CONFIG signature. Each library exports its own Phosphor<Name>Config.cmake.
# Replace `PhosphorZones` with whichever library you need —# same shape for every library in the suite.find_package(PhosphorZones CONFIG REQUIRED)
add_executable(my-app main.cpp)target_link_libraries(my-app PRIVATE PhosphorZones::PhosphorZones)The Phosphor<Name>:: namespace is consistent across the suite — PhosphorRendering::PhosphorRendering, PhosphorShell::PhosphorShell, etc. Each library installs its exported target set under Phosphor<Name>Targets.
FetchContent
To pin an exact upstream commit without a distro package dependency, use FetchContent. The whole suite lives in the PlasmaZones repo, so one fetch gets every Phosphor<Name> target.
include(FetchContent)
FetchContent_Declare(PlasmaZones GIT_REPOSITORY https://github.com/fuddlesworth/PlasmaZones.git GIT_TAG v2.8.7)FetchContent_MakeAvailable(PlasmaZones)
add_executable(my-app main.cpp)target_link_libraries(my-app PRIVATE PhosphorZones::PhosphorZones)Bump GIT_TAG to the latest release tag or pin a specific SHA for reproducibility.
Nix flake
On Nix or NixOS, the PlasmaZones flake exposes the umbrella package plus NixOS and Home-Manager modules.
# one-shot installnix profile install github:fuddlesworth/PlasmaZonesOr pin as a flake input:
{ inputs.plasmazones.url = "github:fuddlesworth/PlasmaZones";
outputs = { self, nixpkgs, plasmazones, ... }: { # NixOS system config nixosConfigurations.my-host = nixpkgs.lib.nixosSystem { modules = [ plasmazones.nixosModules.default ({ ... }: { programs.plasmazones.enable = true; }) ]; };
# or Home Manager homeConfigurations.me = home-manager.lib.homeManagerConfiguration { modules = [ plasmazones.homeManagerModules.default ({ ... }: { programs.plasmazones.enable = true; }) ]; }; };}Including headers
Each library's public headers live under phosphor-<slug>/<TypeName>.h and its symbols under the matching Phosphor<Name> namespace.
#include <phosphor-zones/Zone.h>#include <phosphor-zones/IZoneDetector.h>#include <phosphor-rendering/ShaderEffect.h>
using namespace PhosphorZones;
auto zone = Zone{ /* ... */ };The API reference lists every header and type under its generated namespace page. Each library's page at /libraries/ links directly into that namespace's doxygen tree.