nlohmann_json/3.11.3

JSON for Modern C++ parser and generator.
Recipe info
2023-11-29

Available packages
Header Only

Install
Add the following line to your conanfile.txt:
[requires]
nlohmann_json/3.11.3

Using nlohmann_json

Note

If you are new with Conan, we recommend to read the section how to consume packages.

If you need additional assistance, please ask a question in the Conan Center Index repository.

Simplest use case consuming this recipe and assuming CMake as your local build tool:

[requires]
nlohmann_json/3.11.3
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
from conan import ConanFile
from conan.tools.cmake import cmake_layout


class ExampleRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"

    def requirements(self):
        self.requires("nlohmann_json/3.11.3")

    def layout(self):
        cmake_layout(self)

Now, you can run this Conan command to locally install (and build if necessary) this recipe and its dependencies (if any):

$ conan install conanfile.txt --build=missing

Useful information to take into account to consume this library:


These are the main declared targets:

  • CMake package name(s): nlohmann_json
  • CMake target name(s): nlohmann_json::nlohmann_json
  • pkg-config file name(s): nlohmann_json.pc

A simple use case using the CMake file name and the global target:

# ...
find_package(nlohmann_json REQUIRED)
# ...
target_link_libraries(YOUR_TARGET nlohmann_json::nlohmann_json)

These are all the available headers. Some of these ones might be non-public; make sure of it by visiting the nlohmann_json homepage listed above:

#include "nlohmann/adl_serializer.hpp"
#include "nlohmann/byte_container_with_subtype.hpp"
#include "nlohmann/detail/abi_macros.hpp"
#include "nlohmann/detail/conversions/from_json.hpp"
#include "nlohmann/detail/conversions/to_chars.hpp"
#include "nlohmann/detail/conversions/to_json.hpp"
#include "nlohmann/detail/exceptions.hpp"
#include "nlohmann/detail/hash.hpp"
#include "nlohmann/detail/input/binary_reader.hpp"
#include "nlohmann/detail/input/input_adapters.hpp"
#include "nlohmann/detail/input/json_sax.hpp"
#include "nlohmann/detail/input/lexer.hpp"
#include "nlohmann/detail/input/parser.hpp"
#include "nlohmann/detail/input/position_t.hpp"
#include "nlohmann/detail/iterators/internal_iterator.hpp"
#include "nlohmann/detail/iterators/iter_impl.hpp"
#include "nlohmann/detail/iterators/iteration_proxy.hpp"
#include "nlohmann/detail/iterators/iterator_traits.hpp"
#include "nlohmann/detail/iterators/json_reverse_iterator.hpp"
#include "nlohmann/detail/iterators/primitive_iterator.hpp"
#include "nlohmann/detail/json_custom_base_class.hpp"
#include "nlohmann/detail/json_pointer.hpp"
#include "nlohmann/detail/json_ref.hpp"
#include "nlohmann/detail/macro_scope.hpp"
#include "nlohmann/detail/macro_unscope.hpp"
#include "nlohmann/detail/meta/call_std/begin.hpp"
#include "nlohmann/detail/meta/call_std/end.hpp"
#include "nlohmann/detail/meta/cpp_future.hpp"
#include "nlohmann/detail/meta/detected.hpp"
#include "nlohmann/detail/meta/identity_tag.hpp"
#include "nlohmann/detail/meta/is_sax.hpp"
#include "nlohmann/detail/meta/std_fs.hpp"
#include "nlohmann/detail/meta/type_traits.hpp"
#include "nlohmann/detail/meta/void_t.hpp"
#include "nlohmann/detail/output/binary_writer.hpp"
#include "nlohmann/detail/output/output_adapters.hpp"
#include "nlohmann/detail/output/serializer.hpp"
#include "nlohmann/detail/string_concat.hpp"
#include "nlohmann/detail/string_escape.hpp"
#include "nlohmann/detail/value_t.hpp"
#include "nlohmann/json.hpp"
#include "nlohmann/json_fwd.hpp"
#include "nlohmann/ordered_map.hpp"
#include "nlohmann/thirdparty/hedley/hedley.hpp"
#include "nlohmann/thirdparty/hedley/hedley_undef.hpp"