Enabled nlohmann_json from system

This commit is contained in:
Ilya Lavrenov 2022-04-03 12:02:25 +03:00
parent bdbc7804af
commit 69bafd3519
4 changed files with 19 additions and 14 deletions

View File

@ -140,8 +140,13 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cnpy")
add_subdirectory(thirdparty/cnpy EXCLUDE_FROM_ALL)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/json")
if(NOT TARGET nlohmann_json::nlohmann_json)
find_package(nlohmann_json QUIET)
if(nlohmann_json_FOUND)
message(STATUS "nlohmann_json (${nlohmann_json_VERSION}) is found at ${nlohmann_json_DIR}")
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/nlohmann_json")
add_subdirectory(thirdparty/json EXCLUDE_FROM_ALL)
endif()
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/common/utils")

View File

@ -14,7 +14,9 @@ add_subdirectory(common)
add_subdirectory(core)
add_subdirectory(frontends)
# TODO: remove ngraph/ngraph.hpp usage
add_subdirectory(core/tests)
if(ENABLE_TESTS)
add_subdirectory(core/tests)
endif()
add_subdirectory(bindings)
if(CMAKE_COMPILER_IS_GNUCXX)

View File

@ -7,7 +7,10 @@ if(ENABLE_LTO)
endif()
add_subdirectory(common)
add_subdirectory(tests)
if(ENABLE_TESTS)
add_subdirectory(tests)
endif()
if(ENABLE_OV_ONNX_FRONTEND)
add_subdirectory(onnx)

View File

@ -157,18 +157,13 @@ endif()
# nlohmann json
#
# find_package(nlohmann_json QUIET)
# if(nlohmann_json_FOUND)
# nlohmann_json::nlohmann_json
# else()
add_subdirectory(json)
add_subdirectory(json)
openvino_developer_export_targets(COMPONENT openvino_common
openvino_developer_export_targets(COMPONENT openvino_common
TARGETS nlohmann_json nlohmann_json_schema_validator)
ov_install_static_lib(nlohmann_json openvino_common)
ov_install_static_lib(nlohmann_json_schema_validator openvino_common)
# endif()
ov_install_static_lib(nlohmann_json openvino_common)
ov_install_static_lib(nlohmann_json_schema_validator openvino_common)
#
# Install