JSON_DisableTupleReferenceConversion (#5598) came in with the develop
merge. Meson gets the matching option, and both the Meson and the CMake
pkg-config file carry JSON_DISABLE_TUPLE_REFERENCE_CONVERSION=1 when it
is enabled. The ci_meson_install job checks it.
Reported by @heitbaum in #5587.
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann_jsonTargets.cmake always prepended the prefix computed from the
file's location to includedir. With an absolute includedir outside the
prefix (as Nix passes for packages with a separate dev output), this gave
"<prefix>//abs/include"; with an absolute datadir outside the prefix, the
number of ".." was derived from the absolute path and the prefix resolved
to "/". In both cases find_package(nlohmann_json) failed with "Imported
target includes non-existent path". Use the absolute include directory in
these cases, as CMake's install(EXPORT) does, and check it in CI.
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Finish the Meson changes from #4452:
- Offer all eight options that change the CMake target, named like the
CMake options without the JSON_ prefix. MultipleHeaders defaults to
false so that existing Meson users keep the single header.
- Add a compile definition only for an option that differs from its
default, exactly as target_compile_definitions does. Before, the
GlobalUDLs and ImplicitConversions definitions were inverted and were
also added in the default configuration.
- Keep the nlohmann_json_multiple_headers dependency that earlier
versions of meson.build provided.
- Put the definitions into the pkg-config file and the Meson-generated
nlohmann_jsonTargets.cmake, and install the pkg-config file into
<datadir>/pkgconfig like CMake does.
- Ship meson_options.txt in include.zip, since meson.build now reads
options and the zip is documented as a Meson subproject.
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This uses a meson option (set in `meson_options.txt`) to control whether
multi-header or single-header setup is wanted.
Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
Matching the CMake as closely as possible, as Meson doesn't have C++11
feature checks like CMAke does.
Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
This makes a single call to install the entire directory, and doesn't
need an update if any new headers are added. It also will simplify
bringing the Meson and CMake builds into allignment on how they handle
the multi-header vs single-header setups.
Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
Without a version set meson will give no developer warnings, including
deprecations. 0.64 was selected as it's quite old, it's the newest
version supported by muon (a pure C Meson implementation), and there's
nothing complicated going on here.
Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
A Meson installation only provided the headers and a pkg-config file, so
consumers using find_package(nlohmann_json) could not find the library.
Meson now also installs nlohmann_jsonConfig.cmake and
nlohmann_jsonConfigVersion.cmake from the existing templates, plus a
static nlohmann_jsonTargets.cmake that defines the header-only imported
target with a relocatable include path.
A new CI job installs with Meson and builds tests/cmake_import/project
against the result.
Closes#3885
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
- updated documentation wrt. new repository layout
- temporarily switched off Homebrew --HEAD building (can only be switched on after release)
- set copyright date to 2018