Find nlohmann_json test dependency only when required by justend29 · Pull Request #342 · Thalhammer/jwt-cpp
Yes - I believe falling back to downloading and building the package when it's not found is not a convenience, it's a mistake. It's far too easy to mistype paths and then get the surprise of downloading a package you already have. Explicit selection of which to use is worthwhile.
A dependent option, maybe JWT_EXTERNAL_TEST_NLOHMANN_JSON, would offer this control. Additionally, CMake has built-in integration between find_package and fetch_content offered in CMake 3.24+ allowing standard CMake variables control how the dependencies are acquired, and dependency providers can be used to override it. Nevertheless, this project only mandates CMake 3.14+, and CMake 3.24's integrations would only complement JWT's variable for users who use compatible versions.
Adding now. Let me know if you'd like further changes.
Also, really great library. Thank you for the contributions.