
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.
25 lines
937 B
CMake
25 lines
937 B
CMake
# Copyright 2023 Google LLC
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
@PACKAGE_INIT@
|
|
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() |