From f42d94da596c2708f682199d4c51120bcefec27d Mon Sep 17 00:00:00 2001
From: Amin Bandali <amin.bandali@savoirfairelinux.com>
Date: Sat, 14 Jan 2023 23:41:08 -0500
Subject: [PATCH] build/cmake: Set variables needed by pkg-config files.

Up until now, these were only set by the GNU Build System in
configure.ac, and so the pkg-config files generated from CMake builds
did not have the right Libs.private and Requires.private, especially
useful when linking statically.
---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40bc547e..6f17eb37 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,9 +67,11 @@ if (NOT MSVC)
         find_package (Readline 6 REQUIRED)
     endif ()
     pkg_search_module(argon2 REQUIRED libargon2)
+    set(argon2_lib ", libargon2")
     pkg_search_module(Jsoncpp jsoncpp)
     if (Jsoncpp_FOUND)
         add_definitions(-DOPENDHT_JSONCPP)
+	set(jsoncpp_lib ", jsoncpp")
         list (APPEND opendht_SOURCES
           src/base64.h
           src/base64.cpp
@@ -86,6 +88,7 @@ if (NOT MSVC)
         add_library(fmt SHARED IMPORTED)
         find_library(HTTP_PARSER_LIBRARY http_parser)
         add_library(http_parser SHARED IMPORTED)
+	set(http_parser_lib "-lhttp_parser")
         if (NOT Jsoncpp_FOUND)
             message(SEND_ERROR "Jsoncpp is required for DHT proxy support")
         endif()
@@ -96,6 +99,7 @@ if (NOT MSVC)
                 message(STATUS "Found OpenSSL ${OPENSSL_VERSION} ${OPENSSL_INCLUDE_DIRS}")
                 include_directories(SYSTEM ${OPENSSL_INCLUDE_DIRS})
                 link_directories (${OPENSSL_LIBRARY_DIRS})
+		set(openssl_lib ", openssl")
             else ()
                 message(SEND_ERROR "OpenSSL is required for DHT proxy as specified")
             endif()
-- 
GitLab