summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenSSL.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2012-07-29 15:02:00 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2012-07-29 15:02:00 (GMT)
commitfc798ed64fe4c67881653805720b846a0489d1b9 (patch)
tree641ca3f1e20b3fedc7f4ea96a5d93439a1030c28 /Modules/FindOpenSSL.cmake
parentc78a7d11dd1eda50ce69566cc74311dde218839c (diff)
downloadCMake-fc798ed64fe4c67881653805720b846a0489d1b9.zip
CMake-fc798ed64fe4c67881653805720b846a0489d1b9.tar.gz
CMake-fc798ed64fe4c67881653805720b846a0489d1b9.tar.bz2
FindOpenSSL: cleanup path hints
-only use Windows-specific paths on Windows -recode the contents of $ENV{PROGRAMFILES} to be a valid CMake path before using it
Diffstat (limited to 'Modules/FindOpenSSL.cmake')
-rw-r--r--Modules/FindOpenSSL.cmake47
1 files changed, 28 insertions, 19 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 652ce05..fa5cfba 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -29,25 +29,34 @@ if (UNIX)
pkg_check_modules(_OPENSSL QUIET openssl)
endif (UNIX)
-# http://www.slproweb.com/products/Win32OpenSSL.html
-SET(_OPENSSL_ROOT_HINTS
- ${OPENSSL_ROOT_DIR}
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
- ENV OPENSSL_ROOT_DIR
- )
-SET(_OPENSSL_ROOT_PATHS
- "$ENV{PROGRAMFILES}/OpenSSL"
- "$ENV{PROGRAMFILES}/OpenSSL-Win32"
- "$ENV{PROGRAMFILES}/OpenSSL-Win64"
- "C:/OpenSSL/"
- "C:/OpenSSL-Win32/"
- "C:/OpenSSL-Win64/"
- )
-SET(_OPENSSL_ROOT_HINTS_AND_PATHS
- HINTS ${_OPENSSL_ROOT_HINTS}
- PATHS ${_OPENSSL_ROOT_PATHS}
- )
+IF (WIN32)
+ # http://www.slproweb.com/products/Win32OpenSSL.html
+ SET(_OPENSSL_ROOT_HINTS
+ ${OPENSSL_ROOT_DIR}
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
+ "[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)
+ SET(_OPENSSL_ROOT_PATHS
+ "${_programfiles}/OpenSSL"
+ "${_programfiles}/OpenSSL-Win32"
+ "${_programfiles}/OpenSSL-Win64"
+ "C:/OpenSSL/"
+ "C:/OpenSSL-Win32/"
+ "C:/OpenSSL-Win64/"
+ )
+ UNSET(_programfiles)
+ SET(_OPENSSL_ROOT_HINTS_AND_PATHS
+ HINTS ${_OPENSSL_ROOT_HINTS}
+ PATHS ${_OPENSSL_ROOT_PATHS}
+ )
+ELSE ()
+ SET(_OPENSSL_ROOT_HINTS
+ ${OPENSSL_ROOT_DIR}
+ ENV OPENSSL_ROOT_DIR
+ )
+ENDIF ()
FIND_PATH(OPENSSL_INCLUDE_DIR
NAMES