Skip to content

Commit

Permalink
Fix: CMake. Use pkg-config instead of the droped libgcript-config
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Aug 8, 2024
1 parent 2a4d217 commit d3705d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 40 deletions.
21 changes: 1 addition & 20 deletions nasl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,7 @@ if (NETSNMP)
endif (NETSNMP)

message (STATUS "Looking for libgcrypt...")
find_library (GCRYPT gcrypt)
message (STATUS "Looking for libgcrypt... ${GCRYPT}")
if (NOT GCRYPT)
message (SEND_ERROR "The libgcrypt library is required.")
else (NOT GCRYPT)
execute_process (COMMAND libgcrypt-config --libs
OUTPUT_VARIABLE GCRYPT_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND libgcrypt-config --cflags
OUTPUT_VARIABLE GCRYPT_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND libgcrypt-config --version
OUTPUT_VARIABLE GCRYPT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
message (STATUS " found libgcrypt, version ${GCRYPT_VERSION}")
if (GCRYPT_VERSION VERSION_LESS "1.6")
message (SEND_ERROR "libgcrypt 1.6 or greater is required")
endif (GCRYPT_VERSION VERSION_LESS "1.6")
string(REPLACE "-I" "" GCRYPT_INCLUDE_DIRS "${GCRYPT_CFLAGS}")
endif (NOT GCRYPT)
pkg_check_modules (GCRYPT REQUIRED libgcrypt)


## Library
Expand Down
21 changes: 1 addition & 20 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,7 @@ pkg_check_modules (GLIB REQUIRED glib-2.0>=2.42)
pkg_check_modules (LIBBSD REQUIRED libbsd)

message (STATUS "Looking for libgcrypt...")
find_library (GCRYPT gcrypt)
if (NOT GCRYPT)
message (SEND_ERROR "The libgcrypt library is required.")
else (NOT GCRYPT)
message (STATUS "Looking for libgcrypt... ${GCRYPT}")
execute_process (COMMAND libgcrypt-config --libs
OUTPUT_VARIABLE GCRYPT_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND libgcrypt-config --cflags
OUTPUT_VARIABLE GCRYPT_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND libgcrypt-config --version
OUTPUT_VARIABLE GCRYPT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
message (STATUS " found libgcrypt, version ${GCRYPT_VERSION}")
if (GCRYPT_VERSION VERSION_LESS "1.6")
message (SEND_ERROR "libgcrypt 1.6 or greater is required")
endif (GCRYPT_VERSION VERSION_LESS "1.6")
string(REPLACE "-I" "" GCRYPT_INCLUDE_DIRS "${GCRYPT_CFLAGS}")
endif (NOT GCRYPT)
pkg_check_modules (GCRYPT REQUIRED libgcrypt)

message (STATUS "Looking for pcap...")
find_library (PCAP pcap)
Expand Down

0 comments on commit d3705d9

Please sign in to comment.