OpenSSL: link error with WinCE target
With the introduction of CMake version 3.21, OpenSSL links with ws2_32 and crypt32 on Windows/static.
The equivalent library name of ws2_32.lib for WinCE is: ws2.lib.
Therefor, the block at line https://github.com/Kitware/CMake/blob/ff7a2e37bfff23ce1751a93b3eba179fbf32a9b6/Modules/FindOpenSSL.cmake#L126, should be:
if(WIN32 AND OPENSSL_USE_STATIC_LIBS)
set_property( TARGET ${target} APPEND PROPERTY INTERFACE_LINK_LIBRARIES crypt32 )
if(WINCE)
set_property( TARGET ${target} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ws2 )
else()
set_property( TARGET ${target} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ws2_32 )
endif()
Related commit: https://github.com/Kitware/CMake/commit/98fa09d5befbb970fe6230b95f49ee6821d301b1
Edited by Luca Bonifacio