Your Name Strip comments
aaf3009 2026-08-08
boilerplate
cmake
doc
src
subprojects
util
.gitignore 381 B
.gitlab-ci.yml 18.3 KB
AUTHORS 8 KB
BUGS 3.6 KB
cairo-features.h.in 1.8 KB
cairo.pc.in 401 B
CMakeLists.txt 19.7 KB
CODING_STYLE 8.8 KB
config.h.in 4.9 KB
COPYING 1.5 KB
COPYING-LGPL-2.1 25.9 KB
COPYING-MPL-1.1 25.2 KB
HACKING 5.1 KB
INSTALL 1.1 KB
NEWS 311.5 KB
README.md 2.3 KB

cairo-lite: 2D graphics library

A trimmed-down fork of cairo targeting Linux only, built with CMake, and some exotic features removed.

Removed from upstream cairo:

  • Xlib and XCB surface backends
  • Quartz (macOS) backend
  • Win32 / DirectWrite backend
  • PDF surface backend
  • PostScript surface backend
  • Script surface backend
  • GObject introspection bindings
  • All test, perf, and utility infrastructure

Dependencies

Library Version Purpose
pixman ≥ 0.40.0 Rasterisation
freetype2 ≥ 2.10 Font rendering
fontconfig ≥ 2.13.0 Font discovery
libpng ≥ 1.4.0 PNG output / SVG

Standard system libraries (libm, libdl, pthreads) are also required but present on any Linux system.

Debian / Ubuntu:

apt install libpixman-1-dev libfreetype-dev libfontconfig1-dev libpng-dev

Arch Linux:

pacman -S pixman freetype2 fontconfig libpng

Building

Requires CMake ≥ 3.16 and a C11-capable compiler.

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)

Both a shared library (libcairo.so) and a static archive (libcairo.a) are produced by default. Pass -DBUILD_STATIC=OFF to skip the .a.

# Install to /usr/local (default)
cmake --install build

# Install to a custom prefix
cmake --install build --prefix /usr

Consuming with CMake

After installation, downstream projects can use find_package:

find_package(cairo 1.18 REQUIRED)

# Link against the shared library
target_link_libraries(myapp PRIVATE cairo::cairo)

# Or link against the static archive
target_link_libraries(myapp PRIVATE cairo::cairo_static)

Consuming with pkg-config

pkg-config --cflags --libs cairo          # shared linking
pkg-config --cflags --libs --static cairo # static linking (pulls in all deps)

Licensing

cairo-lite inherits the upstream cairo licence: either the GNU Lesser General Public License version 2.1 or the Mozilla Public License version 1.1, at your option.

See COPYING, COPYING-LGPL-2.1, and COPYING-MPL-1.1 for the full licence texts.