diff --git a/CMakeLists.txt b/CMakeLists.txt index 661b6da1..acc187e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,11 +212,11 @@ if (NOT MSVC) # msgpack check_include_file_cxx(msgpack.hpp HAVE_MSGPACKCXX) if (NOT HAVE_MSGPACKCXX) - find_package(msgpack QUIET CONFIG NAMES msgpack msgpackc-cxx) + find_package(msgpack CONFIG NAMES msgpack-cxx) if (NOT msgpack_FOUND) - find_package(msgpack QUIET CONFIG NAMES msgpack-cxx) + find_package(msgpack CONFIG NAMES msgpack msgpackc-cxx) if (msgpack_FOUND) - set(MSGPACK_TARGET "msgpack-cxx") + set(MSGPACK_TARGET "msgpackc-cxx") else() if(OPENDHT_DOWNLOAD_DEPS) # Workaround for msgpack-cxx @@ -227,14 +227,14 @@ if (NOT MSVC) ) set(MSGPACK_USE_BOOST OFF CACHE INTERNAL "Workaround for Boost") FetchContent_MakeAvailable(msgpack-c) - find_package(msgpack-c CONFIG REQUIRED) - include_directories(${MSGPACK_INCLUDEDIR} ${msgpack-c_SOURCE_DIR}/include) + find_package(msgpack-cxx CONFIG REQUIRED) + set(MSGPACK_TARGET msgpack-cxx) else() message(SEND_ERROR "msgpack not found and the fallback downloader is not set! Please install msgpack or use OPENDHT_DOWNLOAD_DEPS option") endif() endif () else() - set(MSGPACK_TARGET "msgpackc-cxx") + set(MSGPACK_TARGET "msgpack-cxx") endif() endif() # llhttp