Skip to content

Commit d1bcd13

Browse files
committed
Fix nlohmann_json system dependency export
1 parent e5917bb commit d1bcd13

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

cmake/icey_build_config.cmake.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ if(_icey_have_libdatachannel AND DEFINED icey_FIND_COMPONENTS AND "webrtc" IN_LI
4444
endif()
4545

4646
if(@USE_SYSTEM_DEPS@)
47+
if("json" IN_LIST _icey_supported_components)
48+
find_dependency(nlohmann_json CONFIG)
49+
endif()
4750
find_package(libuv CONFIG QUIET)
4851
if(NOT TARGET libuv::uv_a AND NOT TARGET libuv::uv AND NOT TARGET libuv::libuv AND PkgConfig_FOUND)
4952
pkg_check_modules(LIBUV QUIET IMPORTED_TARGET GLOBAL libuv)

cmake/icey_config.cmake.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ if(NOT TARGET llhttp_static)
5959
endif()
6060

6161
if(@USE_SYSTEM_DEPS@)
62+
if("json" IN_LIST _icey_supported_components)
63+
find_dependency(nlohmann_json CONFIG)
64+
endif()
6265
find_dependency(ZLIB)
6366
if("archo" IN_LIST _icey_supported_components OR "pacm" IN_LIST _icey_supported_components)
6467
find_dependency(unofficial-minizip CONFIG QUIET)

icey.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ else()
210210
pkg_check_modules(LIBUV QUIET IMPORTED_TARGET GLOBAL libuv)
211211
endif()
212212
find_package(llhttp CONFIG QUIET)
213-
find_package(nlohmann_json CONFIG REQUIRED)
213+
if(BUILD_MODULES AND (NOT DEFINED BUILD_MODULE_json OR BUILD_MODULE_json))
214+
find_package(nlohmann_json CONFIG REQUIRED)
215+
endif()
214216
find_package(ZLIB REQUIRED)
215217
if(NOT TARGET llhttp_static
216218
AND NOT TARGET llhttp::llhttp_static

src/json/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,12 @@ else()
99
DEPENDS base
1010
PRETTY_NAME JSON
1111
)
12+
target_include_directories(json
13+
PUBLIC
14+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/vendor>
15+
)
16+
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/vendor/"
17+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
18+
COMPONENT dev
19+
)
1220
endif()

0 commit comments

Comments
 (0)