From fc239d4a6177259186cc4f9c6e0e37f0dbc334d0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Dec 2009 08:32:27 -0500 Subject: [PATCH] Create ENABLE_OPENSSL CMake option This option tells libarchive whether to check for OpenSSL and use it. We enable it by default since we previously did this unconditionally. This provides the CMake equivalent to the --without-openssl option, spelled as -DENABLE_OPENSSL=OFF. See issue #22. SVN-Revision: 1750 --- CMakeLists.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 059df17df..a19391b2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ include(CTest) # TODO: Require CMake 2.8 and drop this workaround (perhaps late 2010). INCLUDE(AddTest28) +OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON) OPTION(ENABLE_TAR "Enable tar building" ON) OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" OFF) OPTION(ENABLE_CPIO "Enable cpio building" ON) @@ -259,11 +260,23 @@ LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H) # # Find OpenSSL # -FIND_PACKAGE(OpenSSL) +IF(ENABLE_OPENSSL) + FIND_PACKAGE(OpenSSL) +ELSE() + SET(OPENSSL_FOUND 0) +ENDIF() IF(OPENSSL_FOUND) INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) -ENDIF(OPENSSL_FOUND) +ELSE() + # Block OpenSSL checks and override cached results. + SET(HAVE_OPENSSL_MD5_H 0) + SET(HAVE_OPENSSL_RIPEMD_H 0) + SET(HAVE_OPENSSL_SHA_H 0) + SET(HAVE_OPENSSL_SHA256_INIT 0) + SET(HAVE_OPENSSL_SHA384_INIT 0) + SET(HAVE_OPENSSL_SHA512_INIT 0) +ENDIF() # # Check MD5/RMD160/SHA headers # -- 2.47.3