Add options to link against external JSON libraries (#91)

Add options to link against external JSON libraries

This adds two options to the CMake config:

`CPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE` and `CPPDAP_USE_EXTERNAL_RAPIDJSON_PACKAGE`
If either of these is set, instead of using the json submodule, the build will be configured by using `find_package()` and linking against the specified JSON library.
This commit is contained in:
nikitalita
2023-01-10 05:35:23 -08:00
committed by GitHub
parent a4bc977343
commit 0a340c6d71
2 changed files with 48 additions and 21 deletions

View File

@@ -17,3 +17,9 @@ include(CMakeFindDependencyMacro)
include("${CMAKE_CURRENT_LIST_DIR}/@CPPDAP_TARGETS_EXPORT_NAME@.cmake")
check_required_components("@CPPDAP_TARGET_NAME@")
if ( @CPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE@ )
find_dependency(nlohmann_json CONFIG)
elseif( @CPPDAP_USE_EXTERNAL_RAPIDJSON_PACKAGE@ )
find_dependency(RapidJSON CONFIG)
endif()