Skip to content
Snippets Groups Projects
Commit 366382f2 authored by Amna Snene's avatar Amna Snene Committed by Adrien Béraud
Browse files

build: update msgpack find

Change-Id: I2cb64513b019161150e93fd0737fbdf1831fd722
parent 0d279a1e
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(CTest)
include(GNUInstallDirs)
include(CheckIncludeFileCXX)
set (prefix ${CMAKE_INSTALL_PREFIX})
set (exec_prefix "\${prefix}")
set (libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
......@@ -38,12 +39,15 @@ if (NOT MSVC)
find_package (PkgConfig REQUIRED)
find_package(msgpack-cxx CONFIG)
if(msgpack-cxx_FOUND)
set(MSGPACK_LIB msgpack-cxx)
check_include_file_cxx(msgpack.hpp HAVE_MSGPACKCXX)
if (NOT HAVE_MSGPACKCXX)
find_package(msgpack QUIET CONFIG NAMES msgpack msgpackc-cxx)
if (NOT msgpack_FOUND)
find_package(msgpack REQUIRED CONFIG NAMES msgpack-cxx)
set(MSGPACK_TARGET "msgpack-cxx")
else()
find_package(msgpackc-cxx CONFIG REQUIRED NAMES msgpackc-cxx msgpack)
set(MSGPACK_LIB msgpackc-cxx)
set(MSGPACK_TARGET "msgpackc-cxx")
endif()
endif()
find_package(fmt)
......@@ -184,6 +188,9 @@ else()
${WIN32_DEP_DIR}/../msvc/lib/libfmt.lib
${WIN32_DEP_DIR}/../msvc/lib/libmsgpackc-cxx.lib)
endif()
if (NOT HAVE_MSGPACKCXX)
target_link_libraries(opendht PUBLIC ${MSGPACK_TARGET})
endif()
if (APPLE)
target_link_libraries(dhtnet PRIVATE "-framework CoreFoundation" "-framework Security" "resolv")
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment