summaryrefslogtreecommitdiff
path: root/Modules/FindOpenSSL.cmake
diff options
context:
space:
mode:
authorVladimír Vondruš <mosra@centrum.cz>2016-06-09 14:03:47 +0200
committerBrad King <brad.king@kitware.com>2016-06-09 08:51:01 -0400
commite937b4c3879e1ee0770b465c0cdcbb6a960ba892 (patch)
tree24da3eeef143965ecc75ff2c038a2e5b330b896c /Modules/FindOpenSSL.cmake
parent39699947589e96b59d7f56d9c0b1dcb1bef27f8a (diff)
downloadcmake-e937b4c3879e1ee0770b465c0cdcbb6a960ba892.tar.gz
FindOpenSSL: Do not assume that the version regex finds something
BoringSSL's openslv.h does not have the version information.
Diffstat (limited to 'Modules/FindOpenSSL.cmake')
-rw-r--r--Modules/FindOpenSSL.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 8dbaf11ded..6393f2edcf 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -328,11 +328,11 @@ function(from_hex HEX DEC)
set(${DEC} ${_res} PARENT_SCOPE)
endfunction()
-if (OPENSSL_INCLUDE_DIR)
- if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
- file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
- REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
+if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
+ file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
+ REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
+ if(openssl_version_str)
# The version number is encoded as 0xMNNFFPPS: major minor fix patch status
# The status gives if this is a developer or prerelease and is ignored here.
# Major, minor, and fix directly translate into the version numbers shown in