Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: CMake: Use pkg-config instead of the dropped libgcrypt-config #182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading