Skip to content

Commit

Permalink
Fix: CMake: Use pkg-config instead of the dropped libgcrypt-config
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell committed Oct 15, 2024
1 parent 15e1b45 commit 959a3a5
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 959a3a5

Please sign in to comment.