diff options
-rw-r--r-- | cmake/FindOpenSSL.cmake | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/cmake/FindOpenSSL.cmake b/cmake/FindOpenSSL.cmake index 287527c854e..d48a3d19bae 100644 --- a/cmake/FindOpenSSL.cmake +++ b/cmake/FindOpenSSL.cmake @@ -24,18 +24,16 @@ else( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES ) /usr/local/include /usr/local/include/openssl /usr/local/openssl/include - "C:/OpenSSL/include/openssl" - "C:/OpenSSL-Win32/include/openssl" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include/openssl" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include/openssl" + if (CMAKE_CL_64) + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]/include/openssl" + else + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include/openssl" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include/openssl" + endif DOC "Specify the directory containing openssl.h." ) - if( WIN32 ) - set(TMP_OPENSSL_LIBRARIES "libeay32 ssleay32") - endif( WIN32 ) - find_library(OPENSSL_LIBRARIES NAMES ssleay32 @@ -46,9 +44,12 @@ else( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES ) /usr/local/lib /usr/local/lib/ssl /usr/local/ssl/lib - "C:/OpenSSL/lib" - "C:/OpenSSL-Win32/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib" + if (CMAKE_CL_64) + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]/lib" + else + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib" + endif DOC "Specify the OpenSSL library here." ) @@ -57,8 +58,12 @@ else( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES ) NAMES libeay32 PATHS - "C:/OpenSSL/lib" - "C:/OpenSSL-Win32/lib" + if (CMAKE_CL_64) + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]/lib" + else + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib" + endif DOC "if more libraries are necessary to link in a OpenSSL client, specify them here." ) |