File tree Expand file tree Collapse file tree 3 files changed +51
-4
lines changed Expand file tree Collapse file tree 3 files changed +51
-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 @@ -179,14 +179,14 @@ if(TARGET OpenSSL::SSL)
179179 check_symbol_exists(RAND_egd openssl/rand.h HAVE_RAND_EGD)
180180 cmake_pop_check_state()
181181
182- if (OPENSSL_VERSION VERSION_LESS 3 AND PHP_EXT_OPENSSL_LEGACY_PROVIDER)
182+ if (OpenSSL_VERSION VERSION_LESS 3 AND PHP_EXT_OPENSSL_LEGACY_PROVIDER)
183183 message (
184184 WARNING
185185 "PHP_EXT_OPENSSL_LEGACY_PROVIDER is not available for OpenSSL version "
186- "${OPENSSL_VERSION } and won't be enabled."
186+ "${OpenSSL_VERSION } and won't be enabled."
187187 )
188188 elseif (
189- OPENSSL_VERSION VERSION_GREATER_EQUAL 3
189+ OpenSSL_VERSION VERSION_GREATER_EQUAL 3
190190 AND PHP_EXT_OPENSSL_LEGACY_PROVIDER
191191 )
192192 set (LOAD_OPENSSL_LEGACY_PROVIDER TRUE )
@@ -206,7 +206,7 @@ if(TARGET OpenSSL::SSL)
206206 )
207207 cmake_pop_check_state()
208208
209- if (OPENSSL_VERSION VERSION_LESS 3.2 OR NOT HAVE_OPENSSL_ARGON2)
209+ if (OpenSSL_VERSION VERSION_LESS 3.2 OR NOT HAVE_OPENSSL_ARGON2)
210210 message (
211211 FATAL_ERROR
212212 "The OpenSSL Argon2 password hashing requires OpenSSL 3.2 or newer."
Original file line number Diff line number Diff line change 1+ <!-- This is auto-generated file. -->
2+ * Source code: [ cmake/modules/FindOpenSSL.cmake] ( https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindOpenSSL.cmake )
3+
4+ # FindOpenSSL
5+
6+ This module overrides the upstream CMake ` FindOpenSSL ` module with few
7+ customizations:
8+
9+ * Added OpenSSL_VERSION result variable for CMake < 4.2.
10+
11+ See: https://cmake.org/cmake/help/latest/module/FindOpenSSL.html
12+
13+ ## Customizing search locations
14+
15+ To customize where to look for the OpenSSL package base
16+ installation directory, a common ` CMAKE_PREFIX_PATH ` or
17+ package-specific ` OPENSSL_ROOT ` variable can be set at
18+ the configuration phase. For example:
19+
20+ ``` sh
21+ cmake -S < source-dir> \
22+ -B < build-dir> \
23+ -DCMAKE_PREFIX_PATH=" /opt/OpenSSL;/opt/some-other-package"
24+ # or
25+ cmake -S < source-dir> \
26+ -B < build-dir> \
27+ -DOPENSSL_ROOT=/opt/OpenSSL \
28+ -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package
29+ ```
You can’t perform that action at this time.
0 commit comments