diff options
author | Brad King <brad.king@kitware.com> | 2020-12-22 14:09:44 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-22 14:09:49 (GMT) |
commit | 1b02278fb1625785699252bffc911dcf549e7f58 (patch) | |
tree | e6eca68eb3b256126d5f3544afce703c47a1484b /Modules | |
parent | 89115682b5108ff552f87b9632ed57e6e8db5a22 (diff) | |
parent | a6e03b2e6f972fc28ecae8d7403f0f929bfe1895 (diff) | |
download | CMake-1b02278fb1625785699252bffc911dcf549e7f58.zip CMake-1b02278fb1625785699252bffc911dcf549e7f58.tar.gz CMake-1b02278fb1625785699252bffc911dcf549e7f58.tar.bz2 |
Merge topic 'FindOpenSSL-win-arch'
a6e03b2e6f FindOpenSSL: Distinguish 32-bit and 64-bit search paths on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5630
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindOpenSSL.cmake | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 03b699b..d574790 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -141,16 +141,30 @@ if (WIN32) "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]" ENV OPENSSL_ROOT_DIR ) - file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) + + if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") + set(_arch "Win64") + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) + else() + set(_arch "Win32") + set(_progfiles_x86 "ProgramFiles(x86)") + if(NOT "$ENV{${_progfiles_x86}}" STREQUAL "") + # under windows 64 bit machine + file(TO_CMAKE_PATH "$ENV{${_progfiles_x86}}" _programfiles) + else() + # under windows 32 bit machine + file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _programfiles) + endif() + endif() + set(_OPENSSL_ROOT_PATHS "${_programfiles}/OpenSSL" - "${_programfiles}/OpenSSL-Win32" - "${_programfiles}/OpenSSL-Win64" + "${_programfiles}/OpenSSL-${_arch}" "C:/OpenSSL/" - "C:/OpenSSL-Win32/" - "C:/OpenSSL-Win64/" + "C:/OpenSSL-${_arch}/" ) unset(_programfiles) + unset(_arch) else () set(_OPENSSL_ROOT_HINTS ${OPENSSL_ROOT_DIR} |