Getting started with nlohmann/json using conan package manager

Installing and setting up conan

pip install --user conan --upgrade
source ~/.profile
conan profile detect --force

When encountering issues, consult official documentation.

Build

conan install . --output-folder=build --build=missing
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build .
cd ..

More info here and here.

Run

./build/hello_json

Modify, rebuild and run

cmake --build build/ && ./build/hello_json