summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-08 08:25:59 -0400
committerBrad King <brad.king@kitware.com>2020-06-08 08:25:59 -0400
commit5a745cfbe0f4ebbf11c7ec38ea287842a7b2c164 (patch)
tree0ed6e20d0dea36c7362ea870510402e7b55472cb
parent37955f87d64c22c8119d387956aac8372cb3e38a (diff)
parent796b447373ea8b085a8e41903dacdf9cc27f171a (diff)
downloadcmake-5a745cfbe0f4ebbf11c7ec38ea287842a7b2c164.tar.gz
Merge branch 'FindOpenSSL-3.0' into release-3.17
Merge-request: !4860
-rw-r--r--Modules/FindOpenSSL.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 45b641ddef..ad1018faf8 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -419,11 +419,13 @@ if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
# 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]+)\".*$"
+ 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}")
+
+ unset(OPENSSL_VERSION_STR)
endif ()
endif ()