mirror of
https://github.com/nlohmann/json.git
synced 2026-09-29 14:24:56 +01:00
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>