GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Hunter
  • Brief overview
  • Quick start
  • User guides
  • List of packages
  • All packages
  • ARM_NEON_2_x86_SSE
  • AllTheFlopsThreads
  • Android-ARM-EABI-v7a-System-Image
  • Android-ARM64-v8a-System-Image
  • Android-Apk
  • Android-Build-Tools
  • Android-Google-APIs
  • Android-Google-APIs-Intel-x86-Atom-System-Image

This view

  • Original page
  • New address

GeezerVison is showing hunter.readthedocs.io — nlohmann_json — Hunter 0.23 documentation

nlohmann_json¶

  • Official GitHub
  • Example

Note

C++ 11 is required, you can find the supported compiler versions in the official README.

Usage¶

hunter_add_package(nlohmann_json)
find_package(nlohmann_json CONFIG REQUIRED)

add_executable(main main.cpp)
target_link_libraries(main PUBLIC nlohmann_json::nlohmann_json)

Old version¶

CMake API that should be used for versions older than nlohmann_json v3.2.0:

hunter_add_package(nlohmann_json)
find_package(nlohmann_json CONFIG REQUIRED)
target_link_libraries(... nlohmann_json)

Very old version¶

CMake API that should be used for nlohmann_json v1.0.0:

hunter_add_package(nlohmann-json)
find_package(nlohmann-json REQUIRED)
target_link_libraries(... nlohmann-json::nlohmann-json)

Related Hunter releases:

  • v1.0.0 Available from v0.12.13 to v0.19.52
  • v2.1.1+ Available since v0.19.52

migration from v1.0.0 to v2.1.1+¶

  • replace all nlohmann-json with nlohmann_json
  • add CONFIG to find_package(nlohmann_json CONFIG REQUIRED)
  • shorten target_link_libraries() to target_link_libraries(... nlohmann_json) no nlohmann_json::nlohmann_json
  • change #include <json.hpp> to #include <nlohmann/json.hpp>
You are visitor 01402639 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.