FindOpenSSL fails to find release libraries with MD or MT suffix from slproweb distribution
On Windows with openssl from slproweb.com installed and when MSVC generator is used FindOpenSSL module always finds lib/ssleay32.lib and lib/libeay32.lib as a release libraries instead of libraries with MT or MD suffix from lib/VC/ folder. Setting OPENSSL_USE_STATIC_LIBS and OPENSSL_MSVC_STATIC_RT affects only which debug library will be found.
This problem was introduced in commit b1484403 which fixed issue #15887 (closed), if a manually revert this commit problem goes away.
Sample CMakeLists.txt to demonstrate the problem:
cmake_minimum_required(VERSION 3.6)
project(foo)
set(OPENSSL_MSVC_STATIC_RT true)
set(OPENSSL_USE_STATIC_LIBS true)
find_package(OpenSSL)
message(STATUS "${OPENSSL_LIBRARIES}")
This prints:
optimized;D:/OpenSSL-Win32/lib/ssleay32.lib;debug;D:/OpenSSL-Win32/lib/VC/static/ssleay32MTd.lib;optimized;D:/OpenSSL-Win32/lib/libeay32.lib;debug;D:/OpenSSL-Win32/lib/VC/static/libeay32MTd.lib
while correct OPENSSL_LIBRARIES value should be:
optimized;D:/OpenSSL-Win32/lib/VC/static/ssleay32MT.lib;debug;D:/OpenSSL-Win32/lib/VC/static/ssleay32MTd.lib;optimized;D:/OpenSSL-Win32/lib/VC/static/libeay32MT.lib;debug;D:/OpenSSL-Win32/lib/VC/static/libeay32MTd.lib