mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 15:10:20 -06:00
FindOpenSSL: Prefer OPENSSL_ROOT_DIR only if non-empty
Since commit 5cc8a69867 (FindOpenSSL: Trust the user's OPENSSL_ROOT_DIR,
2023-05-17, v3.27.0-rc1~71^2) we use `OPENSSL_ROOT_DIR` whenever it is
defined, even if it is an empty string. This breaks a pattern in
existing projects that define an empty `OPENSSL_ROOT_DIR` cache entry so
that `cmake-gui` users can fill it in. Use the value only if non-empty.
Issue: #18352
This commit is contained in:
@@ -230,7 +230,7 @@ else()
|
||||
set(_OPENSSL_FIND_PATH_SUFFIX "include")
|
||||
endif()
|
||||
|
||||
if ((DEFINED OPENSSL_ROOT_DIR) OR (DEFINED ENV{OPENSSL_ROOT_DIR}))
|
||||
if (OPENSSL_ROOT_DIR OR NOT "$ENV{OPENSSL_ROOT_DIR}" STREQUAL "")
|
||||
set(_OPENSSL_ROOT_HINTS HINTS ${OPENSSL_ROOT_DIR} ENV OPENSSL_ROOT_DIR)
|
||||
set(_OPENSSL_ROOT_PATHS NO_DEFAULT_PATH)
|
||||
elseif (MSVC)
|
||||
|
||||
Reference in New Issue
Block a user