Closed HenriqueCA closed 1 year ago
I get this exact error with 2.2.0 as well, using FetchContent_Declare
and FetchContent_Populate
(instead of FetchContent_MakeAvailable
). I can confirm that downgrading to 2.1.0 works.
If you set the Cmake Variable "JSON_Install" to ON, it will work with version 2.2.0, using FetchContent_MakeAvailable
set(JSON_Install ON)
Try out #262. It should fix it at least if you are not trying to further install nlohmann_json_schema_validator
after you have FetchContent
it.
This is a design problem that I am trying to get some clarification. On one hand json-schema-validator
needs nlohmann_json
because it is used as an #include
in the exported header. On the other hand it is bad practice to install something that is not the project that you are declaring. So for the moment the installation of nlohmann_json_schema_validator
I have it set to JSON_Install=ON
to make it installable, but it should be fixed as soon as possible.
I tried to use Cmake FetchContent to download nlohmann_json and this repository. When i tried using the new tagged version (2.2.0) from the validator, it presented this error:
CMake Error: install(EXPORT "nlohmann_json_schema_validatorTargets" ...) includes target "nlohmann_json_schema_validator" which requires target "nlohmann_json" that is not in any export set.
Below is the code used to download both repositories: