json-3.12.0 (nlohmann-json)

Introduction to nlohmann-json

The nlohmann-json package provides a header-only in-memory JSON and interface library for C++. The package is simply called json, but most refer to it as nlohmann json to reduce ambiguity, and is done so here.

[Note]

Note

This package is known to build and work properly using an LFS 13.1 platform.

Package Information

nlohmann-json Dependencies

Required

CMake-4.4.2

Installation of nlohmann-json

Install nlohmann-json by running the following commands:

mkdir build &&
cd    build &&

cmake -D CMAKE_INSTALL_PREFIX=/usr \
      -D CMAKE_BUILD_TYPE=Release  \
      -D JSON_BuildTests=OFF       \
      -G Ninja ..

If you removed the -D JSON_BuildTests=OFF parameter, run the test suite by issuing ninja && ninja test. 4 tests are known to fail which fetch contents, but they require that a Git repository for the project is set up.

Now, as the root user:

ninja install

Command Explanations

-D JSON_BuildTests=OFF: This parameter disables building tests, as they can take a while to build. Remove this option if you want to run the test suite.

Contents

Installed Programs: None
Installed Libraries: None
Installed Directories: /usr/include/nlohmann and /usr/share/cmake/nlohmann_json