[cmake-developers] Can't find correct openssl on Windows

Brad King brad.king at kitware.com
Mon Dec 21 09:12:40 EST 2015


On 12/18/2015 07:49 PM, Patrick Spendrin wrote:
> I attached a patch both here and at the bug report which fixes this
> behaviour for the cost of having an additional and ugly option for the
> FindOpenSSL.cmake file.
> I don't see a different solution, as the no-MD/MT version of the
> library is the backup solution (although the one I would prefer in
> this case).

The OPENSSL_MSVC_NO_RT_MODE patch can be a fallback solution, but we
may be able to avoid it.  Take a look at the NAMES_PER_DIR option of
the find_library command.  Using that it should be possible to find
the library of any name that appears first among the searched locations.

FYI, one may avoid using OpenSSL altogether on Windows by using Schannel
instead:

 https://msdn.microsoft.com/en-us/library/windows/desktop/aa380123.aspx
 https://msdn.microsoft.com/en-us/library/windows/desktop/aa374782.aspx

This is the approach CMake itself currently uses, in particular because
it has the advantage of using the OS-maintained list of root CAs.

-Brad


More information about the cmake-developers mailing list