This Homebrew formula installs the header-only JSON for Modern C++ library to your system.
TL;DR: Just execute brew tap nlohmann/json
and brew install nlohmann_json
.
To use the JSON library, add
#include <json.hpp>
to your code and add
-I/usr/local/homebrew/Cellar/nlohmann_json/1.1.0/include
to your compiler flags.
With brew test nlohmann_json
you can check if the formula is working properly. Note the formula needs to be installed before it can be tested.