Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmake/icey_build_config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ if(_icey_have_libdatachannel AND DEFINED icey_FIND_COMPONENTS AND "webrtc" IN_LI
endif()

if(@USE_SYSTEM_DEPS@)
if("json" IN_LIST _icey_supported_components)
find_dependency(nlohmann_json CONFIG)
endif()
find_package(libuv CONFIG QUIET)
if(NOT TARGET libuv::uv_a AND NOT TARGET libuv::uv AND NOT TARGET libuv::libuv AND PkgConfig_FOUND)
pkg_check_modules(LIBUV QUIET IMPORTED_TARGET GLOBAL libuv)
Expand Down
3 changes: 3 additions & 0 deletions cmake/icey_config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ if(NOT TARGET llhttp_static)
endif()

if(@USE_SYSTEM_DEPS@)
if("json" IN_LIST _icey_supported_components)
find_dependency(nlohmann_json CONFIG)
endif()
find_dependency(ZLIB)
if("archo" IN_LIST _icey_supported_components OR "pacm" IN_LIST _icey_supported_components)
find_dependency(unofficial-minizip CONFIG QUIET)
Expand Down
3 changes: 3 additions & 0 deletions icey.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ else()
pkg_check_modules(LIBUV QUIET IMPORTED_TARGET GLOBAL libuv)
endif()
find_package(llhttp CONFIG QUIET)
if(BUILD_MODULES AND (NOT DEFINED BUILD_MODULE_json OR BUILD_MODULE_json))
find_package(nlohmann_json CONFIG REQUIRED)
endif()
find_package(ZLIB REQUIRED)
if(NOT TARGET llhttp_static
AND NOT TARGET llhttp::llhttp_static
Expand Down
26 changes: 20 additions & 6 deletions src/json/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
icy_add_module(json
DEPENDS base
PRETTY_NAME JSON
)
# nlohmann/json.hpp is vendored in include/nlohmann/ (MIT licensed, single-header)
# so no external dependency is needed - icy_add_module already adds our include dir.
if(USE_SYSTEM_DEPS)
icy_add_module(json
DEPENDS base
PACKAGES nlohmann_json::nlohmann_json
PRETTY_NAME JSON
)
else()
icy_add_module(json
DEPENDS base
PRETTY_NAME JSON
)
target_include_directories(json
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/vendor>
)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/vendor/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT dev
)
endif()
File renamed without changes.
Loading