I am using the excellent nlohmann::json
library. I can see that it has an option for disabling implicit conversion which is recommended.
First I tried to set this option via:
set(JSON_ImplicitConversions OFF)
find_package(nlohmann_json 3.10.3 REQUIRED)
But that did not seem to have any effect. I then tried using fetch_content
:
set(JSON_ImplicitConversions OFF)
FetchContent_Declare(json
GIT_REPOSITORY https://github.com/nlohmann/json
GIT_TAG v3.11.3
)
FetchContent_MakeAvailable(json)
And this gave the required effect. I much prefer the find_package
. Am I using it wrong? Is it not possible to set options in this way with find_package
?