explaingit

jbeder/yaml-cpp

5,919C++Audience · developerComplexity · 2/5Setup · moderate

TLDR

yaml-cpp is a C++ library for reading and writing YAML configuration files following the YAML 1.2 standard, integrating into CMake projects with a single FetchContent call.

Mindmap

mindmap
  root((yaml-cpp))
    What it does
      Reads YAML files
      Writes YAML files
      YAML 1.2 standard
    Tech stack
      C++
      CMake
      FetchContent
    Use cases
      Config file loading
      Data serialization
      Cross-platform builds
    Audience
      C++ developers
      CMake project owners
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Load a YAML configuration file in a C++ application and access its values as structured data at runtime

USE CASE 2

Write structured data from a C++ program out to a properly formatted YAML file using the emit API

USE CASE 3

Add yaml-cpp to a CMake project via FetchContent so it downloads and links automatically without any manual install steps

Tech stack

C++CMake

Getting it running

Difficulty · moderate Time to first run · 30min

Requires a CMake-based build setup, community wrappers for Qt and Unreal Engine are maintained separately and not officially supported.

No specific license is mentioned in the description.

In plain English

yaml-cpp is a library for C++ programs that need to read or write YAML files. YAML is a text format commonly used for configuration files, where data is organized using indentation and simple punctuation rather than XML tags or JSON brackets. This library lets C++ code load a YAML file and work with its contents as structured data, or take data from a C++ program and write it out as a properly formatted YAML file. The project follows the YAML 1.2 specification, which is the current official standard for the format. Developers integrate it into their own C++ projects using CMake, a widely used build tool that works across Windows, macOS, and Linux. The library can be built as a static library (bundled directly into the application) or as a shared library (loaded separately at runtime), depending on the needs of the project. Adding yaml-cpp to a CMake-based project can be done with CMake's FetchContent feature, which automatically downloads and links the library during the build process without requiring manual installation steps. The README points to a tutorial and a separate guide for emitting (writing out) YAML for anyone who wants to learn how to use the API. The project has a current API (version 0.5.0 and above) and an older API (version 0.3.x) that is still available but will stop receiving bug fixes in 2026. Community integrations exist for Qt and Unreal Engine, though those are maintained separately and not officially supported by this project.

Copy-paste prompts

Prompt 1
Using yaml-cpp, show me how to load a YAML config file in C++ and read a nested key called database.host
Prompt 2
How do I add yaml-cpp to my CMake project using FetchContent without installing it system-wide?
Prompt 3
Show me how to serialize a C++ struct to a YAML file using the yaml-cpp emitter API
Open on GitHub → Explain another repo

← jbeder on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.