From 484ae7a2eab39ae9f6a660ea7dfd80fb5b8bba54 Mon Sep 17 00:00:00 2001 From: pdlan Date: Thu, 1 Sep 2022 00:58:24 -0400 Subject: Add support for RSA-AES security types --- cmake/Modules/FindNettle.cmake | 20 ++++++++++++++++++++ cmake/StaticBuild.cmake | 6 ++++++ 2 files changed, 26 insertions(+) create mode 100644 cmake/Modules/FindNettle.cmake (limited to 'cmake') diff --git a/cmake/Modules/FindNettle.cmake b/cmake/Modules/FindNettle.cmake new file mode 100644 index 00000000..cd9b424a --- /dev/null +++ b/cmake/Modules/FindNettle.cmake @@ -0,0 +1,20 @@ +find_package(PkgConfig) + +if (PKG_CONFIG_FOUND) + pkg_check_modules(NETTLE nettle>=3.0) + pkg_check_modules(HOGWEED hogweed) + pkg_check_modules(GMP gmp) +else() + find_path(NETTLE_INCLUDE_DIRS NAMES eax.h PATH_SUFFIXES nettle) + find_library(NETTLE_LIBRARIES NAMES nettle) + find_package_handle_standard_args(NETTLE DEFAULT_MSG NETTLE_LIBRARIES NETTLE_INCLUDE_DIRS) + find_path(GMP_INCLUDE_DIRS NAMES gmp.h PATH_SUFFIXES) + find_library(GMP_LIBRARIES NAMES gmp) + find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARIES GMP_INCLUDE_DIRS) + find_library(HOGWEED_LIBRARIES NAMES hogweed) + find_package_handle_standard_args(HOGWEED DEFAULT_MSG HOGWEED_LIBRARIES) +endif() + +if (NOT HOGWEED_FOUND OR NOT GMP_FOUND) + set(NETTLE_FOUND 0) +endif() diff --git a/cmake/StaticBuild.cmake b/cmake/StaticBuild.cmake index 7ce219de..1a3bdb46 100644 --- a/cmake/StaticBuild.cmake +++ b/cmake/StaticBuild.cmake @@ -119,6 +119,12 @@ if(BUILD_STATIC) string(STRIP ${GNUTLS_LIBRARIES} GNUTLS_LIBRARIES) endif() + if(NETTLE_FOUND) + set(NETTLE_LIBRARIES "-Wl,-Bstatic -lnettle -Wl,-Bdynamic") + set(HOGWEED_LIBRARIES "-Wl,-Bstatic -lhogweed -Wl,-Bdynamic") + set(GMP_LIBRARIES "-Wl,-Bstatic -lgmp -Wl,-Bdynamic") + endif() + if(DEFINED FLTK_LIBRARIES) set(FLTK_LIBRARIES "-Wl,-Bstatic -lfltk_images -lpng -ljpeg -lfltk -Wl,-Bdynamic") -- cgit v1.2.3