diff options
author | Brad King <brad.king@kitware.com> | 2011-02-08 20:22:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-02-08 20:22:50 (GMT) |
commit | ee55a4f70906a41db18df07de89383f0aa948c71 (patch) | |
tree | 1b3e872cf16ace82f3d207057af95cf81aba1f75 /Utilities/cmlibarchive/CMakeLists.txt | |
parent | 41b7b3efa4e2684085be7c7dd76baea17f269988 (diff) | |
download | CMake-ee55a4f70906a41db18df07de89383f0aa948c71.zip CMake-ee55a4f70906a41db18df07de89383f0aa948c71.tar.gz CMake-ee55a4f70906a41db18df07de89383f0aa948c71.tar.bz2 |
libarchive: Use OpenSSL only if CMAKE_USE_OPENSSL (#11815)
OpenSSL is not part of the Linux Standard Base but its headers and
libraries may still be found at build time even though they may not be
available at runtime. Use it only if explicitly allowed.
Diffstat (limited to 'Utilities/cmlibarchive/CMakeLists.txt')
-rw-r--r-- | Utilities/cmlibarchive/CMakeLists.txt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt index 6472ec5..08cda1e 100644 --- a/Utilities/cmlibarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/CMakeLists.txt @@ -274,7 +274,11 @@ LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H) # # Find OpenSSL # -FIND_PACKAGE(OpenSSL) +IF(CMAKE_USE_OPENSSL) + FIND_PACKAGE(OpenSSL) +ELSE() + SET(OPENSSL_FOUND 0) +ENDIF() IF(OPENSSL_FOUND) INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) @@ -296,7 +300,11 @@ LA_CHECK_INCLUDE_FILE("sha256.h" HAVE_SHA256_H) # # Find MD5/RMD160/SHA library # -FIND_LIBRARY(CRYPTO_LIBRARY NAMES crypto) +IF(CMAKE_USE_OPENSSL) + FIND_LIBRARY(CRYPTO_LIBRARY NAMES crypto) +ELSE() + SET(CRYPTO_LIBRARY "") +ENDIF() IF(CRYPTO_LIBRARY) LIST(APPEND ADDITIONAL_LIBS ${CRYPTO_LIBRARY}) ELSE(CRYPTO_LIBRARY) |