summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenSSL.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-09 12:53:00 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-09 12:53:06 (GMT)
commitcc1592d708b7190dffb47e2414608694550ae6c1 (patch)
tree6f1fdc4f7113b8818ba040cc212d2f40f760a67f /Modules/FindOpenSSL.cmake
parent675ddc4ccfb3214187ed90817b010cabaafee5fd (diff)
parent796b447373ea8b085a8e41903dacdf9cc27f171a (diff)
downloadCMake-cc1592d708b7190dffb47e2414608694550ae6c1.zip
CMake-cc1592d708b7190dffb47e2414608694550ae6c1.tar.gz
CMake-cc1592d708b7190dffb47e2414608694550ae6c1.tar.bz2
Merge topic 'FindOpenSSL-3.0'
796b447373 FindOpenSSL: Fix OpenSSL 3.0.0 version extraction Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4860
Diffstat (limited to 'Modules/FindOpenSSL.cmake')
-rw-r--r--Modules/FindOpenSSL.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 8ddd78e..ee40696 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -444,11 +444,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 ()