libwebsockets/cmake/FindOpenSSLbins.cmake

43 lines
703 B
CMake
Raw Permalink Normal View History

CMake support + fixed windows build. - Finalized CMake support (tested on windows only so far). - Uses a generated lws_config.h that is included in private-libwebsocket to pass defines, only used if CMAKE_BUILD is set. - Support for SSL on Windows. - Initial support for CyaSSL replacement of OpenSSL (This has been added to my older CMake-fork but haven't been tested on this version yet). - Fixed windows build (see below for details). - Fixed at least the 32-bit Debug build for the existing Visual Studio Project. (Not to keen fixing all the others when we have CMake support anyway (which can generate much better project files)...) - BUGFIXES: - handshake.c - used C99 definition of handshake_0405 function - libwebsocket.c - syslog not available on windows, put in ifdefs. - Fixed previous known crash bug on Windows where WSAPoll in Ws2_32.dll would not be present, causing the poll function pointer being set to NULL. - Uninitialized variable context->listen_service_extraseen would result in stack overflow because of infinite recursion. Fixed by initializing in libwebsocket_create_context - SO_REUSADDR means something different on Windows compared to Unix. - Setting a socket to nonblocking is done differently on Windows. (This should probably broken out into a helper function instead) - lwsl_emit_syslog -> lwsl_emit_stderr on Windows. - private-libwebsocket.h - PATH_MAX is not available on Windows, define as MAX_PATH - Always define LWS_NO_DAEMONIZE on windows. - Don't define lws_latency as inline that does nothing. inline is not support by the Microsoft compiler, replaced with an empty define instead. (It's __inline in MSVC) - server.c - Fixed nonblock call on windows - test-ping.c - Don't use C99 features (Microsoft compiler does not support it). - Move non-win32 headers into ifdefs. - Skip use of sighandler on Windows. - test-server.c - ifdef syslog parts on Windows.
2013-02-06 15:26:58 +09:00
if(OPENSSL_FOUND)
2013-02-22 09:28:11 +08:00
find_program(OPENSSL_EXECUTABLE openssl openssl.exe bin/openssl.exe
HINTS ${_OPENSSL_ROOT_HINTS}
2013-02-22 09:28:11 +08:00
PATH
/usr/bin/
bin/
DOC "Openssl executable")
mark_as_advanced(OPENSSL_EXECUTABLE)
CMake support + fixed windows build. - Finalized CMake support (tested on windows only so far). - Uses a generated lws_config.h that is included in private-libwebsocket to pass defines, only used if CMAKE_BUILD is set. - Support for SSL on Windows. - Initial support for CyaSSL replacement of OpenSSL (This has been added to my older CMake-fork but haven't been tested on this version yet). - Fixed windows build (see below for details). - Fixed at least the 32-bit Debug build for the existing Visual Studio Project. (Not to keen fixing all the others when we have CMake support anyway (which can generate much better project files)...) - BUGFIXES: - handshake.c - used C99 definition of handshake_0405 function - libwebsocket.c - syslog not available on windows, put in ifdefs. - Fixed previous known crash bug on Windows where WSAPoll in Ws2_32.dll would not be present, causing the poll function pointer being set to NULL. - Uninitialized variable context->listen_service_extraseen would result in stack overflow because of infinite recursion. Fixed by initializing in libwebsocket_create_context - SO_REUSADDR means something different on Windows compared to Unix. - Setting a socket to nonblocking is done differently on Windows. (This should probably broken out into a helper function instead) - lwsl_emit_syslog -> lwsl_emit_stderr on Windows. - private-libwebsocket.h - PATH_MAX is not available on Windows, define as MAX_PATH - Always define LWS_NO_DAEMONIZE on windows. - Don't define lws_latency as inline that does nothing. inline is not support by the Microsoft compiler, replaced with an empty define instead. (It's __inline in MSVC) - server.c - Fixed nonblock call on windows - test-ping.c - Don't use C99 features (Microsoft compiler does not support it). - Move non-win32 headers into ifdefs. - Skip use of sighandler on Windows. - test-server.c - ifdef syslog parts on Windows.
2013-02-06 15:26:58 +09:00
# On Windows, we need to copy the OpenSSL dlls
# to the output directory.
CMake support + fixed windows build. - Finalized CMake support (tested on windows only so far). - Uses a generated lws_config.h that is included in private-libwebsocket to pass defines, only used if CMAKE_BUILD is set. - Support for SSL on Windows. - Initial support for CyaSSL replacement of OpenSSL (This has been added to my older CMake-fork but haven't been tested on this version yet). - Fixed windows build (see below for details). - Fixed at least the 32-bit Debug build for the existing Visual Studio Project. (Not to keen fixing all the others when we have CMake support anyway (which can generate much better project files)...) - BUGFIXES: - handshake.c - used C99 definition of handshake_0405 function - libwebsocket.c - syslog not available on windows, put in ifdefs. - Fixed previous known crash bug on Windows where WSAPoll in Ws2_32.dll would not be present, causing the poll function pointer being set to NULL. - Uninitialized variable context->listen_service_extraseen would result in stack overflow because of infinite recursion. Fixed by initializing in libwebsocket_create_context - SO_REUSADDR means something different on Windows compared to Unix. - Setting a socket to nonblocking is done differently on Windows. (This should probably broken out into a helper function instead) - lwsl_emit_syslog -> lwsl_emit_stderr on Windows. - private-libwebsocket.h - PATH_MAX is not available on Windows, define as MAX_PATH - Always define LWS_NO_DAEMONIZE on windows. - Don't define lws_latency as inline that does nothing. inline is not support by the Microsoft compiler, replaced with an empty define instead. (It's __inline in MSVC) - server.c - Fixed nonblock call on windows - test-ping.c - Don't use C99 features (Microsoft compiler does not support it). - Move non-win32 headers into ifdefs. - Skip use of sighandler on Windows. - test-server.c - ifdef syslog parts on Windows.
2013-02-06 15:26:58 +09:00
if(WIN32)
set(OPENSSL_BIN_FOUND 0)
CMake support + fixed windows build. - Finalized CMake support (tested on windows only so far). - Uses a generated lws_config.h that is included in private-libwebsocket to pass defines, only used if CMAKE_BUILD is set. - Support for SSL on Windows. - Initial support for CyaSSL replacement of OpenSSL (This has been added to my older CMake-fork but haven't been tested on this version yet). - Fixed windows build (see below for details). - Fixed at least the 32-bit Debug build for the existing Visual Studio Project. (Not to keen fixing all the others when we have CMake support anyway (which can generate much better project files)...) - BUGFIXES: - handshake.c - used C99 definition of handshake_0405 function - libwebsocket.c - syslog not available on windows, put in ifdefs. - Fixed previous known crash bug on Windows where WSAPoll in Ws2_32.dll would not be present, causing the poll function pointer being set to NULL. - Uninitialized variable context->listen_service_extraseen would result in stack overflow because of infinite recursion. Fixed by initializing in libwebsocket_create_context - SO_REUSADDR means something different on Windows compared to Unix. - Setting a socket to nonblocking is done differently on Windows. (This should probably broken out into a helper function instead) - lwsl_emit_syslog -> lwsl_emit_stderr on Windows. - private-libwebsocket.h - PATH_MAX is not available on Windows, define as MAX_PATH - Always define LWS_NO_DAEMONIZE on windows. - Don't define lws_latency as inline that does nothing. inline is not support by the Microsoft compiler, replaced with an empty define instead. (It's __inline in MSVC) - server.c - Fixed nonblock call on windows - test-ping.c - Don't use C99 features (Microsoft compiler does not support it). - Move non-win32 headers into ifdefs. - Skip use of sighandler on Windows. - test-server.c - ifdef syslog parts on Windows.
2013-02-06 15:26:58 +09:00
find_file(LIBEAY_BIN
NAMES
libeay32.dll
HINTS
${_OPENSSL_ROOT_HINTS}
PATH_SUFFIXES
bin)
find_file(SSLEAY_BIN
NAMES
ssleay32.dll
HINTS
${_OPENSSL_ROOT_HINTS}
PATH_SUFFIXES
bin)
if(LIBEAY_BIN)
if(SSLEAY_BIN)
set(OPENSSL_BIN_FOUND 1)
endif(SSLEAY_BIN)
endif(LIBEAY_BIN)
endif(WIN32)
endif(OPENSSL_FOUND)