diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-09-09 13:44:46 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-09-09 22:27:41 +0200 |
commit | 53abc254c7b3adf3643056917bbe6cdf5793a83a (patch) | |
tree | 5358cf2df465d541508c1b86d37ccaeed86ff2d5 | |
parent | 0849f016ce9f0786dbf101730b0f839658586c07 (diff) |
Build: Fixed finding OpenSSL 1.1.1 installed from .msi packages instead of .exe
Closes #24664
(cherry picked from commit aba07047a05fc46e5904f3084b6351850188f9b4)
-rw-r--r-- | cmake/macros/FindOpenSSL.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/macros/FindOpenSSL.cmake b/cmake/macros/FindOpenSSL.cmake index 3af44729410..f269d6c3f4a 100644 --- a/cmake/macros/FindOpenSSL.cmake +++ b/cmake/macros/FindOpenSSL.cmake @@ -33,13 +33,17 @@ SET(_OPENSSL_ROOT_HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]" ) +set(_OPENSSL_MSI_INSTALL_GUID "") + IF(PLATFORM EQUAL 64) + set(_OPENSSL_MSI_INSTALL_GUID "117551DB-A110-4BBD-BB05-CFE0BCB3ED31") SET(_OPENSSL_ROOT_PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]" "C:/OpenSSL-Win64/" "C:/OpenSSL/" ) ELSE() + set(_OPENSSL_MSI_INSTALL_GUID "A1EEC576-43B9-4E75-9E02-03DA542D2A38") SET(_OPENSSL_ROOT_PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]" @@ -47,6 +51,13 @@ ELSE() ) ENDIF() +# If OpenSSL was installed using .msi package instead of .exe, Inno Setup registry values are not written to Uninstall\OpenSSL +# but because it is only a shim around Inno Setup it does write the location of uninstaller which we can use to determine path +get_filename_component(_OPENSSL_MSI_INSTALL_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Inno Setup MSIs\\${_OPENSSL_MSI_INSTALL_GUID};]" DIRECTORY) +if(NOT _OPENSSL_MSI_INSTALL_PATH STREQUAL "/") + list(APPEND _OPENSSL_ROOT_PATHS ${_OPENSSL_MSI_INSTALL_PATH}) +endif() + FIND_PATH(OPENSSL_ROOT_DIR NAMES include/openssl/ssl.h |