nlohmann-json-3.12.0

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

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

Package Information

nlohmann-json Dependencies

Required

CMake-4.3.4

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