cmake: Enable ECC support for GCrypt 1.5.0 or newer.

This commit is contained in:
Andreas Schneider
2012-02-04 20:10:04 +01:00
parent ddcfe95bbd
commit 3e83bc665f
3 changed files with 9 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ if (WITH_ZLIB)
endif (WITH_ZLIB)
if (WITH_GCRYPT)
find_package(GCrypt REQUIRED)
find_package(GCrypt 1.5.0 REQUIRED)
if (NOT GCRYPT_FOUND)
message(FATAL_ERROR "Could not find GCrypt")
endif (NOT GCRYPT_FOUND)

View File

@@ -146,7 +146,11 @@ if (OPENSSL_FOUND)
endif (OPENSSL_FOUND)
if (GCRYPT_FOUND)
set(HAVE_LIBGCRYPT 1)
set(HAVE_LIBGCRYPT 1)
if (GCRYPT_VERSION VERSION_GREATER "1.4.6")
set(HAVE_GCRYPT_ECC 1)
set(HAVE_ECC 1)
endif (GCRYPT_VERSION VERSION_GREATER "1.4.6")
endif (GCRYPT_FOUND)
if (CMAKE_HAVE_THREADS_LIBRARY)

View File

@@ -50,6 +50,9 @@
/* Define to 1 if you have eliptic curve cryptography in openssl */
#cmakedefine HAVE_OPENSSL_ECC 1
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
#cmakedefine HAVE_GCRYPT_ECC 1
/* Define to 1 if you have eliptic curve cryptography */
#cmakedefine HAVE_ECC 1