File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 1+ #[=============================================================================[
2+ # FindOpenSSL
3+
4+ This module overrides the upstream CMake `FindOpenSSL` module with few
5+ customizations:
6+
7+ * Added OpenSSL_VERSION result variable for CMake < 4.2.
8+
9+ See: https://cmake.org/cmake/help/latest/module/FindOpenSSL.html
10+ #]=============================================================================]
11+
12+ # Find package with upstream CMake find module. Absolute path prevents the
13+ # maximum nesting/recursion depth error on some systems, like macOS.
14+ include (${CMAKE_ROOT} /Modules/FindOpenSSL.cmake)
15+
16+ if (CMAKE_VERSION VERSION_LESS 4.2)
17+ set (OpenSSL_VERSION "${OPENSSL_VERSION} " )
18+ endif ()
Original file line number Diff line number Diff line change @@ -176,14 +176,14 @@ if(TARGET OpenSSL::SSL)
176176 check_symbol_exists(RAND_egd openssl/rand.h HAVE_RAND_EGD)
177177 cmake_pop_check_state()
178178
179- if (OPENSSL_VERSION VERSION_LESS 3 AND PHP_EXT_OPENSSL_LEGACY_PROVIDER)
179+ if (OpenSSL_VERSION VERSION_LESS 3 AND PHP_EXT_OPENSSL_LEGACY_PROVIDER)
180180 message (
181181 WARNING
182182 "PHP_EXT_OPENSSL_LEGACY_PROVIDER is not available for OpenSSL version "
183- "${OPENSSL_VERSION } and won't be enabled."
183+ "${OpenSSL_VERSION } and won't be enabled."
184184 )
185185 elseif (
186- OPENSSL_VERSION VERSION_GREATER_EQUAL 3
186+ OpenSSL_VERSION VERSION_GREATER_EQUAL 3
187187 AND PHP_EXT_OPENSSL_LEGACY_PROVIDER
188188 )
189189 set (LOAD_OPENSSL_LEGACY_PROVIDER TRUE )
@@ -213,7 +213,7 @@ if(TARGET OpenSSL::SSL)
213213 )
214214 cmake_pop_check_state()
215215
216- if (OPENSSL_VERSION VERSION_LESS 3.2 OR NOT HAVE_OPENSSL_ARGON2)
216+ if (OpenSSL_VERSION VERSION_LESS 3.2 OR NOT HAVE_OPENSSL_ARGON2)
217217 message (
218218 FATAL_ERROR
219219 "The OpenSSL Argon2 password hashing requires OpenSSL 3.2 or newer."
You can’t perform that action at this time.
0 commit comments