diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-09-09 13:44:46 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-09-09 13:44:46 +0200 |
commit | aba07047a05fc46e5904f3084b6351850188f9b4 (patch) | |
tree | 6c5e48e8a6868b79659697d467fc4f56370f3d8e /cmake/macros | |
parent | c0d62fe0b3d2bc69d9bcb5fdb9c1e7c5333c72ca (diff) |
Build: Fixed finding OpenSSL 1.1.1 installed from .msi packages instead of .exe
Closes #24664
Diffstat (limited to 'cmake/macros')
-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 fef3779b129..25e98f42d2c 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 |