From dbb0686c0901c5a59b2934bf61588314ee641908 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Sat, 8 Jul 2023 09:18:39 -0400
Subject: [PATCH] various include fixes

Change-Id: Ic00be577eaf76395ec95b8f8a41c330006339f51
---
 CMakeLists.txt              | 10 ++++++++--
 include/upnp/mapping.h      |  2 +-
 include/upnp/upnp_context.h |  4 ++--
 include/upnp/upnp_control.h |  2 +-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47740a5..ec0da0d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,13 @@ set (libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
 set (includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
 
 find_package (PkgConfig REQUIRED)
-find_package(msgpack REQUIRED QUIET CONFIG NAMES msgpack msgpack-cxx)
+find_package(msgpackc-cxx QUIET CONFIG)
+if(msgpackc-cxx_FOUND)
+  add_library(msgpack-cxx ALIAS msgpackc-cxx)
+else()
+  find_package(msgpack-cxx CONFIG REQUIRED)
+endif()
+
 find_package(fmt)
 pkg_check_modules (opendht REQUIRED IMPORTED_TARGET opendht>=2.6.0)
 pkg_check_modules (pjproject REQUIRED IMPORTED_TARGET libpjproject)
@@ -54,7 +60,7 @@ list (APPEND dhtnet_HEADERS
 )
 
 add_library(dhtnet ${dhtnet_SOURCES})
-target_link_libraries(dhtnet PUBLIC PkgConfig::opendht PkgConfig::pjproject fmt::fmt msgpackc)
+target_link_libraries(dhtnet PUBLIC PkgConfig::opendht PkgConfig::pjproject fmt::fmt msgpack-cxx)
 target_include_directories(dhtnet PUBLIC
     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
     $<INSTALL_INTERFACE:include>
diff --git a/include/upnp/mapping.h b/include/upnp/mapping.h
index ebcbdaa..19e6421 100644
--- a/include/upnp/mapping.h
+++ b/include/upnp/mapping.h
@@ -21,7 +21,7 @@
 
 #pragma once
 
-#include "ip_utils.h"
+#include "../ip_utils.h"
 
 #include <map>
 #include <string>
diff --git a/include/upnp/upnp_context.h b/include/upnp/upnp_context.h
index 57b45d6..2ac63cd 100644
--- a/include/upnp/upnp_context.h
+++ b/include/upnp/upnp_context.h
@@ -31,10 +31,10 @@
 #endif
 #include "igd.h"*/
 
-#include "ip_utils.h"
+#include "../ip_utils.h"
 
 #include "upnp_thread_util.h"
-#include "upnp/mapping.h"
+#include "mapping.h"
 
 #include <opendht/rng.h>
 #include <opendht/logger.h>
diff --git a/include/upnp/upnp_control.h b/include/upnp/upnp_control.h
index c9949b4..236c0c7 100644
--- a/include/upnp/upnp_control.h
+++ b/include/upnp/upnp_control.h
@@ -23,7 +23,7 @@
 #pragma once
 
 #include "mapping.h"
-#include "ip_utils.h"
+#include "../ip_utils.h"
 
 #include <memory>
 #include <chrono>
-- 
GitLab