aboutsummaryrefslogtreecommitdiff
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-07-03 10:51:36 +0200
committerAndreas Schneider <asn@cryptomilk.org>2015-07-03 10:51:36 +0200
commit70cc11618a71abec9b8ac79aab614ec09b21e8e4 (patch)
treec7593417896929a683015c4228662b0027d9c967 /ConfigureChecks.cmake
parent387fd2cf536965208e0d7bd708a09f7008cb6c28 (diff)
downloadlibssh-70cc11618a71abec9b8ac79aab614ec09b21e8e4.tar.gz
libssh-70cc11618a71abec9b8ac79aab614ec09b21e8e4.tar.xz
libssh-70cc11618a71abec9b8ac79aab614ec09b21e8e4.zip
cmake: Fail if can't find OpenSSL aes and des headers
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake42
1 files changed, 25 insertions, 17 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index e3a39dd9..5fb06534 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -65,23 +65,31 @@ if (WIN32)
check_include_files("winsock2.h;ws2tcpip.h" HAVE_WS2TCPIP_H)
endif (WIN32)
-set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
-check_include_file(openssl/aes.h HAVE_OPENSSL_AES_H)
-
-set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
-check_include_file(openssl/blowfish.h HAVE_OPENSSL_BLOWFISH_H)
-
-set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
-check_include_file(openssl/des.h HAVE_OPENSSL_DES_H)
-
-set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
-check_include_file(openssl/ecdh.h HAVE_OPENSSL_ECDH_H)
-
-set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
-check_include_file(openssl/ec.h HAVE_OPENSSL_EC_H)
-
-set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
-check_include_file(openssl/ecdsa.h HAVE_OPENSSL_ECDSA_H)
+if (OPENSSL_FOUND)
+ set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+ check_include_file(openssl/des.h HAVE_OPENSSL_DES_H)
+ if (NOT HAVE_OPENSSL_DES_H)
+ message(FATAL_ERROR "Could not detect openssl/des.h")
+ endif()
+
+ set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+ check_include_file(openssl/aes.h HAVE_OPENSSL_AES_H)
+ if (NOT HAVE_OPENSSL_AES_H)
+ message(FATAL_ERROR "Could not detect openssl/aes.h")
+ endif()
+
+ set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+ check_include_file(openssl/blowfish.h HAVE_OPENSSL_BLOWFISH_H)
+
+ set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+ check_include_file(openssl/ecdh.h HAVE_OPENSSL_ECDH_H)
+
+ set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+ check_include_file(openssl/ec.h HAVE_OPENSSL_EC_H)
+
+ set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+ check_include_file(openssl/ecdsa.h HAVE_OPENSSL_ECDSA_H)
+endif()
if (CMAKE_HAVE_PTHREAD_H)
set(HAVE_PTHREAD_H 1)