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)