From 74b7fb7bbac618419e5e40a2df0beb2304aa84ad Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Fri, 25 Sep 2009 23:31:48 +0200 Subject: [PATCH] Add an option to let users choose libgcrypt --- CMakeLists.txt | 18 ++++++++++++------ DefineOptions.cmake | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea40ecc3..210512b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,14 +38,20 @@ include(MacroCopyFile) # search for libraries find_package(ZLIB REQUIRED) -find_package(OpenSSL) - -if (NOT CRYPTO_FOUND) - find_package(GCrypt) +if (WITH_GCRYPT) + find_package(GCrypt REQUIRED) if (NOT GCRYPT_FOUND) - message(FATAL_ERROR "Could not find OpenSSL or GCrypt") + message(FATAL_ERROR "Could not find GCrypt") endif (NOT GCRYPT_FOUND) -endif (NOT CRYPTO_FOUND) +else (WITH_GCRYPT) + find_package(OpenSSL) + if (NOT CRYPTO_FOUND) + find_package(GCrypt) + if (NOT GCRYPT_FOUND) + message(FATAL_ERROR "Could not find OpenSSL or GCrypt") + endif (NOT GCRYPT_FOUND) + endif (NOT CRYPTO_FOUND) +endif(WITH_GCRYPT) # config.h checks include(ConfigureChecks.cmake) diff --git a/DefineOptions.cmake b/DefineOptions.cmake index 0fb25876..bec65614 100644 --- a/DefineOptions.cmake +++ b/DefineOptions.cmake @@ -5,3 +5,4 @@ option(WITH_SERVER "Build with SSH server support" ON) option(WITH_STATIC_LIB "Build with a static library" OFF) option(WITH_DEBUG_CRYPTO "Build with cryto debug output" OFF) option(WITH_DEBUG_CALLTRACE "Build with calltrace debug output" ON) +option(WITH_GCRYPT "Compile against libgcrypt" OFF)