summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenSSL.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-28 10:50:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-05-28 10:51:52 (GMT)
commit40748ec1d9099550267c8e6c8de86704038098e8 (patch)
tree7d41aad949e07f8e073532d77ef178a3f8cbaa39 /Modules/FindOpenSSL.cmake
parent9bd7de0dac1436fd8f6009de1b2d87e9c56407ef (diff)
parent61d746e5922de50310558364f157b261f3e7917a (diff)
downloadCMake-40748ec1d9099550267c8e6c8de86704038098e8.zip
CMake-40748ec1d9099550267c8e6c8de86704038098e8.tar.gz
CMake-40748ec1d9099550267c8e6c8de86704038098e8.tar.bz2
Merge topic 'openssl-3.0.0'
61d746e592 FindOpenSSL: Detect OpenSSL 3.0.0 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4805
Diffstat (limited to 'Modules/FindOpenSSL.cmake')
-rw-r--r--Modules/FindOpenSSL.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index a813ab5..8ddd78e 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -440,6 +440,15 @@ if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
endif ()
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
+ else ()
+ # Since OpenSSL 3.0.0, the new version format is MAJOR.MINOR.PATCH and
+ # a new OPENSSL_VERSION_STR macro contains exactly that
+ file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" OPENSSL_VERSION_STR
+ REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_STR[\t ]+\"([0-9])+\.([0-9])+\.([0-9])+\".*")
+ string(REGEX REPLACE "^.*OPENSSL_VERSION_STR[\t ]+\"([0-9]+\.[0-9]+\.[0-9]+)\".*$"
+ "\\1" OPENSSL_VERSION_STR "${OPENSSL_VERSION_STR}")
+
+ set(OPENSSL_VERSION "${OPENSSL_VERSION_STR}")
endif ()
endif ()