From 959a3a5e3c079f7fcfac406b74c504cf02f21b21 Mon Sep 17 00:00:00 2001 From: Matt Mundell Date: Tue, 15 Oct 2024 10:47:00 +0200 Subject: [PATCH] Fix: CMake: Use pkg-config instead of the dropped libgcrypt-config --- src/CMakeLists.txt | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b45182001..6faa68750 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,29 +34,17 @@ pkg_check_modules (ZLIB REQUIRED zlib>=1.2) pkg_check_modules (BROTLI libbrotlienc) message (STATUS "Looking for libgcrypt...") -find_library (LIBGCRYPT gcrypt) -if (NOT LIBGCRYPT) - message (SEND_ERROR "The libgcrypt library is required.") -else (NOT LIBGCRYPT) - message (STATUS "Looking for libgcrypt... ${LIBGCRYPT}") - execute_process (COMMAND libgcrypt-config --libs - OUTPUT_VARIABLE LIBGCRYPT_LDFLAGS - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND libgcrypt-config --cflags - OUTPUT_VARIABLE LIBGCRYPT_CFLAGS - OUTPUT_STRIP_TRAILING_WHITESPACE) -endif (NOT LIBGCRYPT) +pkg_check_modules (GCRYPT REQUIRED libgcrypt) if (NOT LIBMICROHTTPD_FOUND OR NOT LIBXML_FOUND OR NOT GLIB_FOUND OR (GTHREAD_REQUIRED AND NOT GTHREAD_FOUND) OR NOT - LIBGVM_GMP_FOUND OR NOT GNUTLS_FOUND OR NOT - LIBGCRYPT OR NOT ZLIB_FOUND) + LIBGVM_GMP_FOUND OR NOT GNUTLS_FOUND OR NOT ZLIB_FOUND) message (FATAL_ERROR "One or more required libraries was not found " "(see message above), please install the missing " "libraries and run cmake again.") endif (NOT LIBMICROHTTPD_FOUND OR NOT LIBXML_FOUND OR NOT GLIB_FOUND OR (GTHREAD_REQUIRED AND NOT GTHREAD_FOUND) OR NOT - LIBGVM_GMP_FOUND OR NOT GNUTLS_FOUND OR NOT LIBGCRYPT OR NOT ZLIB_FOUND) + LIBGVM_GMP_FOUND OR NOT GNUTLS_FOUND OR NOT ZLIB_FOUND) ## Program @@ -106,7 +94,7 @@ target_link_libraries (gsad ${LIBMICROHTTPD_LDFLAGS} ${GTHREAD_LDFLAGS} ${GLIB_LDFLAGS} ${LIBXML_LDFLAGS} - ${LIBGCRYPT_LDFLAGS} + ${GCRYPT_LDFLAGS} ${GNUTLS_LDFLAGS} ${ZLIB_LDFLAGS} ${BROTLI_LDFLAGS}