diff options
author | Brad King <brad.king@kitware.com> | 2015-10-06 14:59:08 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-10-06 14:59:08 (GMT) |
commit | 5d315f32236dfebf3561789d17aaaab2d86c504d (patch) | |
tree | 8ee8cf874dbd6a2617d04e1a5e1d8b835bee7ad8 | |
parent | 53d90de3d9b536bcee45acc40183569895a9776e (diff) | |
parent | 821e17785ecd4a329842dc6c5b093eb30cc4f160 (diff) | |
download | CMake-5d315f32236dfebf3561789d17aaaab2d86c504d.zip CMake-5d315f32236dfebf3561789d17aaaab2d86c504d.tar.gz CMake-5d315f32236dfebf3561789d17aaaab2d86c504d.tar.bz2 |
Merge topic 'FindOpenSSL-msvc-static-rt'
821e1778 FindOpenSSL: Add support for static MSVC runtime
-rw-r--r-- | Help/release/dev/FindOpenSSL-msvc-static-rt.rst | 6 | ||||
-rw-r--r-- | Modules/FindOpenSSL.cmake | 17 |
2 files changed, 18 insertions, 5 deletions
diff --git a/Help/release/dev/FindOpenSSL-msvc-static-rt.rst b/Help/release/dev/FindOpenSSL-msvc-static-rt.rst new file mode 100644 index 0000000..6e0ee27 --- /dev/null +++ b/Help/release/dev/FindOpenSSL-msvc-static-rt.rst @@ -0,0 +1,6 @@ +FindOpenSSL-msvc-static-rt +-------------------------- + +* The :module:`FindOpenSSL` module gained a new + ``OPENSSL_MSVC_STATIC_RT`` option to search for libraries using + the MSVC static runtime. diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index d75e8ab..a0f4c52 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -37,6 +37,7 @@ # # Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation. # Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries. +# Set ``OPENSSL_MSVC_STATIC_RT`` set ``TRUE`` to choose the MT version of the lib. #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -113,7 +114,7 @@ if(WIN32 AND NOT CYGWIN) # /MD and /MDd are the standard values - if someone wants to use # others, the libnames have to change here too # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b - # TODO: handle /MT and static lib + # enable OPENSSL_MSVC_STATIC_RT to get the libs build /MT (Multithreaded no-DLL) # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix: # * MD for dynamic-release # * MDd for dynamic-debug @@ -126,6 +127,12 @@ if(WIN32 AND NOT CYGWIN) # ssleay32MD.lib is identical to ../ssleay32.lib # enable OPENSSL_USE_STATIC_LIBS to use the static libs located in lib/VC/static + if (OPENSSL_MSVC_STATIC_RT) + set(_OPENSSL_MSVC_RT_MODE "MT") + else () + set(_OPENSSL_MSVC_RT_MODE "MD") + endif () + if(OPENSSL_USE_STATIC_LIBS) set(_OPENSSL_PATH_SUFFIXES "lib" @@ -142,7 +149,7 @@ if(WIN32 AND NOT CYGWIN) find_library(LIB_EAY_DEBUG NAMES - libeay32MDd + libeay32${_OPENSSL_MSVC_RT_MODE}d libeay32d ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES @@ -151,7 +158,7 @@ if(WIN32 AND NOT CYGWIN) find_library(LIB_EAY_RELEASE NAMES - libeay32MD + libeay32${_OPENSSL_MSVC_RT_MODE} libeay32 ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES @@ -160,7 +167,7 @@ if(WIN32 AND NOT CYGWIN) find_library(SSL_EAY_DEBUG NAMES - ssleay32MDd + ssleay32${_OPENSSL_MSVC_RT_MODE}d ssleay32d ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES @@ -169,7 +176,7 @@ if(WIN32 AND NOT CYGWIN) find_library(SSL_EAY_RELEASE NAMES - ssleay32MD + ssleay32${_OPENSSL_MSVC_RT_MODE} ssleay32 ssl ${_OPENSSL_ROOT_HINTS_AND_PATHS} |