diff options
author | Brad King <brad.king@kitware.com> | 2020-05-28 10:50:44 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-05-28 10:51:52 (GMT) |
commit | 54eeccbfb61e0796f9435a6207e79d5c50b7116a (patch) | |
tree | fb1e37c240170ee73afd6e7ae57512b458b35729 /Modules | |
parent | 1b8b98a8849377d1dfc3015eb9f4f79fd14dba96 (diff) | |
parent | 61d746e5922de50310558364f157b261f3e7917a (diff) | |
download | CMake-54eeccbfb61e0796f9435a6207e79d5c50b7116a.zip CMake-54eeccbfb61e0796f9435a6207e79d5c50b7116a.tar.gz CMake-54eeccbfb61e0796f9435a6207e79d5c50b7116a.tar.bz2 |
Merge topic 'openssl-3.0.0' into release-3.17
61d746e592 FindOpenSSL: Detect OpenSSL 3.0.0
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4805
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindOpenSSL.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index af713d6..45b641d 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -415,6 +415,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 () |