|
@@ -35,8 +35,30 @@ if(NOT gRPC_FOUND)
|
|
|
endif()
|
|
endif()
|
|
|
find_package(nlohmann_json 3.2.0 QUIET)
|
|
find_package(nlohmann_json 3.2.0 QUIET)
|
|
|
if(NOT nlohmann_json_FOUND)
|
|
if(NOT nlohmann_json_FOUND)
|
|
|
- find_package(PkgConfig REQUIRED)
|
|
|
|
|
- pkg_check_modules(NLOHMANN_JSON REQUIRED nlohmann_json)
|
|
|
|
|
|
|
+ find_package(PkgConfig QUIET)
|
|
|
|
|
+ if(PKG_CONFIG_FOUND)
|
|
|
|
|
+ pkg_check_modules(NLOHMANN_JSON QUIET nlohmann_json)
|
|
|
|
|
+ endif()
|
|
|
|
|
+ if(NOT nlohmann_json_FOUND AND NOT NLOHMANN_JSON_FOUND)
|
|
|
|
|
+ # Not available on system - parent project or FetchContent provides it
|
|
|
|
|
+ if(NOT TARGET nlohmann_json::nlohmann_json)
|
|
|
|
|
+ include(FetchContent)
|
|
|
|
|
+ FetchContent_Declare(
|
|
|
|
|
+ nlohmann_json
|
|
|
|
|
+ GIT_REPOSITORY https://github.com/nlohmann/json.git
|
|
|
|
|
+ GIT_TAG v3.11.3
|
|
|
|
|
+ GIT_SHALLOW TRUE
|
|
|
|
|
+ )
|
|
|
|
|
+ set(JSON_BuildTests OFF CACHE BOOL "" FORCE)
|
|
|
|
|
+ set(JSON_Install OFF CACHE BOOL "" FORCE)
|
|
|
|
|
+ FetchContent_MakeAvailable(nlohmann_json)
|
|
|
|
|
+ endif()
|
|
|
|
|
+ elseif(NLOHMANN_JSON_FOUND AND NOT TARGET nlohmann_json::nlohmann_json)
|
|
|
|
|
+ add_library(nlohmann_json::nlohmann_json INTERFACE IMPORTED)
|
|
|
|
|
+ set_target_properties(nlohmann_json::nlohmann_json PROPERTIES
|
|
|
|
|
+ INTERFACE_INCLUDE_DIRECTORIES "${NLOHMANN_JSON_INCLUDE_DIRS}"
|
|
|
|
|
+ )
|
|
|
|
|
+ endif()
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
# Find spdlog
|
|
# Find spdlog
|