1 cmake_minimum_required(VERSION 2.8)
3 if(NOT DEFINED CMAKE_BUILD_TYPE)
4 set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
7 project(libwebsockets C)
9 set(PACKAGE "libwebsockets")
10 set(CPACK_PACKAGE_NAME "${PACKAGE}")
11 set(CPACK_PACKAGE_VERSION_MAJOR "1")
12 set(CPACK_PACKAGE_VERSION_MINOR "6")
13 set(CPACK_PACKAGE_VERSION_PATCH "0")
14 set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
15 set(CPACK_PACKAGE_VENDOR "andy@warmcat.com")
16 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE} ${PACKAGE_VERSION}")
18 set(CPACK_SOURCE_GENERATOR "TGZ")
19 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
20 set(VERSION "${CPACK_PACKAGE_VERSION}")
22 set(LWS_LIBRARY_VERSION ${CPACK_PACKAGE_VERSION})
23 set(LWS_LIBRARY_VERSION_MAJOR ${CPACK_PACKAGE_VERSION_MAJOR})
24 set(LWS_LIBRARY_VERSION_MINOR ${CPACK_PACKAGE_VERSION_MINOR})
25 set(LWS_LIBRARY_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH})
27 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
29 message(STATUS "CMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'")
31 # Try to find the current Git hash.
35 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
36 COMMAND "${GIT_EXECUTABLE}" log -n 1 --pretty=%h
37 OUTPUT_VARIABLE GIT_HASH
38 OUTPUT_STRIP_TRAILING_WHITESPACE
41 set(LWS_BUILD_HASH ${GIT_HASH})
42 message("Git commit hash: ${LWS_BUILD_HASH}")
45 set(LWS_USE_BUNDLED_ZLIB_DEFAULT OFF)
47 set(LWS_USE_BUNDLED_ZLIB_DEFAULT ON)
50 option(LWS_WITH_STATIC "Build the static version of the library" ON)
51 option(LWS_WITH_SHARED "Build the shared version of the library" ON)
52 option(LWS_WITH_SSL "Include SSL support (default OpenSSL, wolfSSL if LWS_USE_WOLFSSL is set)" ON)
53 option(LWS_USE_CYASSL "Use CyaSSL replacement for OpenSSL. When setting this, you also need to specify LWS_CYASSL_LIBRARIES and LWS_CYASSL_INCLUDE_DIRS" OFF)
54 option(LWS_USE_WOLFSSL "Use wolfSSL replacement for OpenSSL. When setting this, you also need to specify LWS_WOLFSSL_LIBRARIES and LWS_WOLFSSL_INCLUDE_DIRS" OFF)
55 option(LWS_WITH_ZLIB "Include zlib support (required for extensions)" ON)
56 option(LWS_WITH_LIBEV "Compile with support for libev" OFF)
57 option(LWS_USE_BUNDLED_ZLIB "Use bundled zlib version (Windows only)" ${LWS_USE_BUNDLED_ZLIB_DEFAULT})
58 option(LWS_SSL_CLIENT_USE_OS_CA_CERTS "SSL support should make use of the OS-installed CA root certs" ON)
59 option(LWS_WITHOUT_BUILTIN_GETIFADDRS "Don't use the BSD getifaddrs implementation from libwebsockets if it is missing (this will result in a compilation error) ... The default is to assume that your libc provides it. On some systems such as uclibc it doesn't exist." OFF)
60 option(LWS_WITHOUT_BUILTIN_SHA1 "Don't build the lws sha-1 (eg, because openssl will provide it" OFF)
61 option(LWS_WITHOUT_CLIENT "Don't build the client part of the library" OFF)
62 option(LWS_WITHOUT_SERVER "Don't build the server part of the library" OFF)
63 option(LWS_LINK_TESTAPPS_DYNAMIC "Link the test apps to the shared version of the library. Default is to link statically" OFF)
64 option(LWS_WITHOUT_TESTAPPS "Don't build the libwebsocket-test-apps" OFF)
65 option(LWS_WITHOUT_TEST_SERVER "Don't build the test server" OFF)
66 option(LWS_WITHOUT_TEST_SERVER_EXTPOLL "Don't build the test server version that uses external poll" OFF)
67 option(LWS_WITHOUT_TEST_PING "Don't build the ping test application" OFF)
68 option(LWS_WITHOUT_TEST_ECHO "Don't build the echo test application" OFF)
69 option(LWS_WITHOUT_TEST_CLIENT "Don't build the client test application" OFF)
70 option(LWS_WITHOUT_TEST_FRAGGLE "Don't build the ping test application" OFF)
71 option(LWS_WITHOUT_EXTENSIONS "Don't compile with extensions" OFF)
72 option(LWS_WITH_LATENCY "Build latency measuring code into the library" OFF)
73 option(LWS_WITHOUT_DAEMONIZE "Don't build the daemonization api" ON)
74 option(LWS_IPV6 "Compile with support for ipv6" OFF)
75 option(LWS_WITH_HTTP2 "Compile with support for http2" OFF)
76 option(LWS_MBED3 "Platform is MBED3" OFF)
77 option(LWS_SSL_SERVER_WITH_ECDH_CERT "Include SSL server use ECDH certificate" OFF)
80 if (DEFINED YOTTA_WEBSOCKETS_VERSION_STRING)
82 set(LWS_WITH_SHARED OFF)
84 set(LWS_WITH_ZLIB OFF)
85 set(LWS_WITHOUT_CLIENT ON)
86 set(LWS_WITHOUT_TESTAPPS ON)
87 set(LWS_WITHOUT_EXTENSIONS ON)
92 if (DEFINED YOTTA_WEBSOCKETS_VERSION_STRING)
94 set(LWS_WITH_SHARED OFF)
96 set(LWS_WITH_ZLIB OFF)
97 set(LWS_WITHOUT_CLIENT ON)
98 set(LWS_WITHOUT_TESTAPPS ON)
99 set(LWS_WITHOUT_EXTENSIONS ON)
105 # Allow the user to override installation directories.
106 set(LWS_INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
107 set(LWS_INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
108 set(LWS_INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")
109 set(LWS_INSTALL_EXAMPLES_DIR bin CACHE PATH "Installation directory for example files")
111 # Allow the user to use the old CyaSSL options/library in stead of wolfSSL
112 if (LWS_USE_CYASSL AND LWS_USE_WOLFSSL)
113 message(FATAL_ERROR "LWS_USE_CYASSL and LWS_USE_WOLFSSL are mutually exclusive!")
116 # Copy CyaSSL options to the wolfSSL options
117 set(LWS_USE_WOLFSSL ${LWS_USE_CYASSL} CACHE BOOL "Use wolfSSL/CyaSSL instead of OpenSSL" FORCE)
118 set(LWS_WOLFSSL_LIBRARIES ${LWS_CYASSL_LIBRARIES} CACHE PATH "Path to wolfSSL/CyaSSL libraries" FORCE)
119 set(LWS_WOLFSSL_INCLUDE_DIRS ${LWS_CYASSL_INCLUDE_DIRS} CACHE PATH "Path to wolfSSL/CyaSSL header files" FORCE)
122 if (LWS_WITHOUT_CLIENT AND LWS_WITHOUT_SERVER)
123 message(FATAL_ERROR "Makes no sense to compile with neither client nor server.")
126 if (NOT (LWS_WITH_STATIC OR LWS_WITH_SHARED))
127 message(FATAL_ERROR "Makes no sense to compile with neither static nor shared libraries.")
130 if (NOT LWS_WITHOUT_EXTENSIONS)
131 if (NOT LWS_WITH_ZLIB)
132 message(FATAL_ERROR "zlib is required for extensions.")
136 set(LWS_ZLIB_LIBRARIES CACHE PATH "Path to the zlib library")
137 set(LWS_ZLIB_INCLUDE_DIRS CACHE PATH "Path to the zlib include directory")
138 set(LWS_OPENSSL_LIBRARIES CACHE PATH "Path to the OpenSSL library")
139 set(LWS_OPENSSL_INCLUDE_DIRS CACHE PATH "Path to the OpenSSL include directory")
140 set(LWS_WOLFSSL_LIBRARIES CACHE PATH "Path to the wolfSSL library")
141 set(LWS_WOLFSSL_INCLUDE_DIRS CACHE PATH "Path to the wolfSSL include directory")
142 set(LWS_LIBEV_LIBRARIES CACHE PATH "Path to the libev library")
143 set(LWS_LIBEV_INCLUDE_DIRS CACHE PATH "Path to the libev include directory")
145 if (NOT LWS_WITH_SSL)
146 set(LWS_WITHOUT_BUILTIN_SHA1 OFF)
149 if (LWS_WITH_SSL AND NOT LWS_USE_WOLFSSL)
150 if ("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "")
152 set(OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES})
153 set(OPENSSL_INCLUDE_DIRS ${LWS_OPENSSL_INCLUDE_DIRS})
158 if (LWS_WITH_SSL AND LWS_USE_WOLFSSL)
159 if ("${LWS_WOLFSSL_LIBRARIES}" STREQUAL "" OR "${LWS_WOLFSSL_INCLUDE_DIRS}" STREQUAL "")
160 if (NOT WOLFSSL_FOUND)
162 message(FATAL_ERROR "You must set LWS_CYASSL_LIBRARIES and LWS_CYASSL_INCLUDE_DIRS when LWS_USE_CYASSL is turned on.")
164 message(FATAL_ERROR "You must set LWS_WOLFSSL_LIBRARIES and LWS_WOLFSSL_INCLUDE_DIRS when LWS_USE_WOLFSSL is turned on.")
168 set(WOLFSSL_LIBRARIES ${LWS_WOLFSSL_LIBRARIES})
169 set(WOLFSSL_INCLUDE_DIRS ${LWS_WOLFSSL_INCLUDE_DIRS})
174 set(USE_OLD_CYASSL 1)
178 if (LWS_WITH_ZLIB AND NOT LWS_USE_BUNDLED_ZLIB)
179 if ("${LWS_ZLIB_LIBRARIES}" STREQUAL "" OR "${LWS_ZLIB_INCLUDE_DIRS}" STREQUAL "")
181 set(ZLIB_LIBRARIES ${LWS_ZLIB_LIBRARIES})
182 set(ZLIB_INCLUDE_DIRS ${LWS_ZLIB_INCLUDE_DIRS})
188 if ("${LWS_LIBEV_LIBRARIES}" STREQUAL "" OR "${LWS_LIBEV_INCLUDE_DIRS}" STREQUAL "")
190 set(LIBEV_LIBRARIES ${LWS_LIBEV_LIBRARIES})
191 set(LIBEV_INCLUDE_DIRS ${LWS_LIBEV_INCLUDE_DIRS})
196 # FIXME: This must be runtime-only option.
197 # The base dir where the test-apps look for the SSL certs.
198 set(LWS_OPENSSL_CLIENT_CERTS ../share CACHE PATH "Server SSL certificate directory")
200 set(LWS_OPENSSL_CLIENT_CERTS . CACHE PATH "Client SSL certificate directory")
204 message(WARNING "IPv6 does not currently work on Windows!")
207 set(LWS_OPENSSL_CLIENT_CERTS /etc/pki/tls/certs/ CACHE PATH "Client SSL certificate directory")
210 if (LWS_WITHOUT_EXTENSIONS)
211 set(LWS_NO_EXTENSIONS 1)
215 set(LWS_OPENSSL_SUPPORT 1)
218 if (LWS_SSL_CLIENT_USE_OS_CA_CERTS)
219 set(LWS_SSL_CLIENT_USE_OS_CA_CERTS 1)
222 if (LWS_WITH_LATENCY)
226 if (LWS_WITHOUT_DAEMONIZE OR WIN32)
227 set(LWS_NO_DAEMONIZE 1)
230 if (LWS_WITHOUT_SERVER)
234 if (LWS_WITHOUT_CLIENT)
251 # set(CMAKE_C_FLAGS "-D_DEBUG ${CMAKE_C_FLAGS}")
255 set(LWS_MINGW_SUPPORT 1)
256 set(CMAKE_C_FLAGS "-D__USE_MINGW_ANSI_STDIO ${CMAKE_C_FLAGS}")
259 if (LWS_SSL_SERVER_WITH_ECDH_CERT)
260 set(LWS_SSL_SERVER_WITH_ECDH_CERT 1)
263 include_directories("${PROJECT_BINARY_DIR}")
265 include(CheckCSourceCompiles)
267 # Check for different inline keyword versions.
268 foreach(KEYWORD "inline" "__inline__" "__inline")
269 set(CMAKE_REQUIRED_DEFINITIONS "-DKEYWORD=${KEYWORD}")
270 CHECK_C_SOURCE_COMPILES(
273 static KEYWORD void a() {}
274 int main(int argc, char **argv) { a(); return 0; }
275 " LWS_HAVE_${KEYWORD})
278 if (NOT LWS_HAVE_inline)
279 if (LWS_HAVE___inline__)
280 set(inline __inline__)
281 elseif(LWS_HAVE___inline)
286 # Put the libaries and binaries that get built into directories at the
287 # top of the build tree rather than in hard-to-find leaf directories.
288 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
289 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
290 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
292 # Put absolute path of dynamic libraries into the object code. Some
293 # architectures, notably Mac OS X, need this.
294 SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}")
296 include(CheckFunctionExists)
297 include(CheckIncludeFile)
298 include(CheckIncludeFiles)
299 include(CheckLibraryExists)
300 include(CheckTypeSize)
302 if (LWS_WITHOUT_BUILTIN_SHA1)
303 set(LWS_SHA1_USE_OPENSSL_NAME 1)
306 CHECK_FUNCTION_EXISTS(bzero LWS_HAVE_BZERO)
307 CHECK_FUNCTION_EXISTS(fork LWS_HAVE_FORK)
308 CHECK_FUNCTION_EXISTS(getenv LWS_HAVE_GETENV)
309 CHECK_FUNCTION_EXISTS(malloc LWS_HAVE_MALLOC)
310 CHECK_FUNCTION_EXISTS(memset LWS_HAVE_MEMSET)
311 CHECK_FUNCTION_EXISTS(realloc LWS_HAVE_REALLOC)
312 CHECK_FUNCTION_EXISTS(socket LWS_HAVE_SOCKET)
313 CHECK_FUNCTION_EXISTS(strerror LWS_HAVE_STRERROR)
314 CHECK_FUNCTION_EXISTS(vfork LWS_HAVE_VFORK)
315 CHECK_FUNCTION_EXISTS(getifaddrs LWS_HAVE_GETIFADDRS)
317 if (NOT LWS_HAVE_GETIFADDRS)
318 if (LWS_WITHOUT_BUILTIN_GETIFADDRS)
319 message(FATAL_ERROR "No getifaddrs was found on the system. Turn off the LWS_WITHOUT_BUILTIN_GETIFADDRS compile option to use the supplied BSD version.")
321 set(LWS_BUILTIN_GETIFADDRS 1)
324 CHECK_INCLUDE_FILE(dlfcn.h LWS_HAVE_DLFCN_H)
325 CHECK_INCLUDE_FILE(fcntl.h LWS_HAVE_FCNTL_H)
326 CHECK_INCLUDE_FILE(in6addr.h LWS_HAVE_IN6ADDR_H)
327 CHECK_INCLUDE_FILE(inttypes.h LWS_HAVE_INTTYPES_H)
328 CHECK_INCLUDE_FILE(memory.h LWS_HAVE_MEMORY_H)
329 CHECK_INCLUDE_FILE(netinet/in.h LWS_HAVE_NETINET_IN_H)
330 CHECK_INCLUDE_FILE(stdint.h LWS_HAVE_STDINT_H)
331 CHECK_INCLUDE_FILE(stdlib.h LWS_HAVE_STDLIB_H)
332 CHECK_INCLUDE_FILE(strings.h LWS_HAVE_STRINGS_H)
333 CHECK_INCLUDE_FILE(string.h LWS_HAVE_STRING_H)
334 CHECK_INCLUDE_FILE(sys/prctl.h LWS_HAVE_SYS_PRCTL_H)
335 CHECK_INCLUDE_FILE(sys/socket.h LWS_HAVE_SYS_SOCKET_H)
336 CHECK_INCLUDE_FILE(sys/stat.h LWS_HAVE_SYS_STAT_H)
337 CHECK_INCLUDE_FILE(sys/types.h LWS_HAVE_SYS_TYPES_H)
338 CHECK_INCLUDE_FILE(unistd.h LWS_HAVE_UNISTD_H)
339 CHECK_INCLUDE_FILE(vfork.h LWS_HAVE_VFORK_H)
341 if (LWS_WITH_ZLIB AND NOT LWS_USE_BUNDLED_ZLIB)
342 CHECK_INCLUDE_FILE(zlib.h LWS_HAVE_ZLIB_H)
345 # TODO: These can also be tested to see whether they actually work...
346 set(LWS_HAVE_WORKING_FORK LWS_HAVE_FORK)
347 set(LWS_HAVE_WORKING_VFORK LWS_HAVE_VFORK)
349 CHECK_INCLUDE_FILES("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
351 # These don't work Cross...
352 #CHECK_TYPE_SIZE(pid_t PID_T_SIZE)
353 #CHECK_TYPE_SIZE(size_t SIZE_T_SIZE)
354 #CHECK_TYPE_SIZE("void *" LWS_SIZEOFPTR LANGUAGE C)
361 set(size_t "unsigned int")
364 if (NOT LWS_HAVE_MALLOC)
365 set(malloc rpl_malloc)
368 if (NOT LWS_HAVE_REALLOC)
369 set(realloc rpl_realloc)
372 # Generate the lws_config.h that includes all the public compilation settings.
374 "${PROJECT_SOURCE_DIR}/lws_config.h.in"
375 "${PROJECT_BINARY_DIR}/lws_config.h")
377 # Generate the lws_config.h that includes all the private compilation settings.
379 "${PROJECT_SOURCE_DIR}/lws_config_private.h.in"
380 "${PROJECT_BINARY_DIR}/lws_config_private.h")
383 # Turn off stupid microsoft security warnings.
384 add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
387 include_directories("${PROJECT_SOURCE_DIR}/lib")
389 # Group headers and sources.
390 # Some IDEs use this for nicer file structure.
392 lib/private-libwebsockets.h)
395 "${PROJECT_SOURCE_DIR}/lib/libwebsockets.h"
396 "${PROJECT_BINARY_DIR}/lws_config.h")
410 if (NOT LWS_WITHOUT_CLIENT)
413 lib/client-handshake.c
422 if (NOT LWS_WITHOUT_BUILTIN_SHA1)
433 # select the active platform files
441 lib/lws-plat-mbed3.cpp
442 lib/lws-plat-mbed3.c)
449 if (NOT LWS_WITHOUT_SERVER)
452 lib/server-handshake.c)
455 if (NOT LWS_WITHOUT_EXTENSIONS)
456 list(APPEND HDR_PRIVATE
457 lib/extension-permessage-deflate.h)
460 lib/extension-permessage-deflate.c)
466 endif(LWS_WITH_LIBEV)
468 # Add helper files for Windows.
470 set(WIN32_HELPERS_PATH win32port/win32helpers)
471 include_directories(${WIN32_HELPERS_PATH})
474 if (NOT LWS_WITHOUT_DAEMONIZE)
481 if (NOT LWS_HAVE_GETIFADDRS)
482 list(APPEND HDR_PRIVATE lib/getifaddrs.h)
483 list(APPEND SOURCES lib/getifaddrs.c)
487 if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
488 include (CheckCCompilerFlag)
489 CHECK_C_COMPILER_FLAG(-fvisibility=hidden LWS_HAVE_VISIBILITY)
490 if (LWS_HAVE_VISIBILITY)
491 set(VISIBILITY_FLAG -fvisibility=hidden)
494 set(CMAKE_C_FLAGS "-Wall -Werror ${VISIBILITY_FLAG} ${CMAKE_C_FLAGS}" )
496 set(CMAKE_C_FLAGS "-Wall ${VISIBILITY_FLAG} ${CMAKE_C_FLAGS}" )
500 if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
502 # jeez clang understands -pthread but dies if he sees it at link time!
503 # http://stackoverflow.com/questions/2391194/what-is-gs-pthread-equiv-in-clang
504 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread" )
508 if ((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
509 # otherwise osx blows a bunch of openssl deprecated api errors
510 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations" )
513 source_group("Headers Private" FILES ${HDR_PRIVATE})
514 source_group("Headers Public" FILES ${HDR_PUBLIC})
515 source_group("Sources" FILES ${SOURCES})
523 add_library(websockets STATIC
527 list(APPEND LWS_LIBRARIES websockets)
530 # Windows uses the same .lib ending for static libraries and shared
531 # library linker files, so rename the static library.
532 set_target_properties(websockets
534 OUTPUT_NAME websockets_static)
539 add_library(websockets_shared SHARED
543 list(APPEND LWS_LIBRARIES websockets_shared)
545 # We want the shared lib to be named "libwebsockets"
546 # not "libwebsocket_shared".
547 set_target_properties(websockets_shared
549 OUTPUT_NAME websockets)
552 # Compile as DLL (export function declarations)
554 TARGET websockets_shared
555 PROPERTY COMPILE_DEFINITIONS
561 set_property(TARGET websockets_shared PROPERTY MACOSX_RPATH YES)
565 # Set the so version of the lib.
566 # Equivalent to LDFLAGS=-version-info x:x:x
567 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
568 foreach(lib ${LWS_LIBRARIES})
569 set_target_properties(${lib}
571 SOVERSION ${SOVERSION})
582 # ZLIB (Only needed for deflate extensions).
585 if (LWS_USE_BUNDLED_ZLIB)
587 set(WIN32_ZLIB_PATH "win32port/zlib")
589 ${WIN32_ZLIB_PATH}/adler32.c
590 ${WIN32_ZLIB_PATH}/compress.c
591 ${WIN32_ZLIB_PATH}/crc32.c
592 ${WIN32_ZLIB_PATH}/deflate.c
593 ${WIN32_ZLIB_PATH}/gzclose.c
594 ${WIN32_ZLIB_PATH}/gzio.c
595 ${WIN32_ZLIB_PATH}/gzlib.c
596 ${WIN32_ZLIB_PATH}/gzread.c
597 ${WIN32_ZLIB_PATH}/gzwrite.c
598 ${WIN32_ZLIB_PATH}/infback.c
599 ${WIN32_ZLIB_PATH}/inffast.c
600 ${WIN32_ZLIB_PATH}/inflate.c
601 ${WIN32_ZLIB_PATH}/inftrees.c
602 ${WIN32_ZLIB_PATH}/trees.c
603 ${WIN32_ZLIB_PATH}/uncompr.c
604 ${WIN32_ZLIB_PATH}/zutil.c)
605 add_library(zlib_internal STATIC ${ZLIB_SRCS})
606 set(ZLIB_INCLUDE_DIRS ${WIN32_ZLIB_PATH})
607 get_property(ZLIB_LIBRARIES TARGET zlib_internal PROPERTY LOCATION)
609 # Make sure zlib_internal is compiled before the libs.
610 foreach (lib ${LWS_LIBRARIES})
611 add_dependencies(${lib} zlib_internal)
614 message(FATAL_ERROR "Don't have bundled zlib for that platform")
616 elseif (NOT ZLIB_FOUND)
617 find_package(ZLIB REQUIRED)
619 message("zlib include dirs: ${ZLIB_INCLUDE_DIRS}")
620 message("zlib libraries: ${ZLIB_LIBRARIES}")
621 include_directories(${ZLIB_INCLUDE_DIRS})
622 list(APPEND LIB_LIST ${ZLIB_LIBRARIES})
629 message("Compiling with SSL support")
632 # Use wolfSSL as OpenSSL replacement.
633 # TODO: Add a find_package command for this also.
634 message("wolfSSL include dir: ${WOLFSSL_INCLUDE_DIRS}")
635 message("wolfSSL libraries: ${WOLFSSL_LIBRARIES}")
637 # Additional to the root directory we need to include
638 # the wolfssl/ subdirectory which contains the OpenSSL
639 # compatibility layer headers.
642 foreach(inc ${WOLFSSL_INCLUDE_DIRS})
643 include_directories("${inc}" "${inc}/cyassl")
646 foreach(inc ${WOLFSSL_INCLUDE_DIRS})
647 include_directories("${inc}" "${inc}/wolfssl")
651 list(APPEND LIB_LIST "${WOLFSSL_LIBRARIES}")
653 if (NOT OPENSSL_FOUND)
654 # TODO: Add support for STATIC also.
655 find_package(OpenSSL REQUIRED)
656 set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}")
659 message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIRS}")
660 message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
662 include_directories("${OPENSSL_INCLUDE_DIRS}")
663 list(APPEND LIB_LIST ${OPENSSL_LIBRARIES})
669 find_path(LIBEV_INCLUDE_DIRS NAMES ev.h)
670 find_library(LIBEV_LIBRARIES NAMES ev)
671 if(LIBEV_INCLUDE_DIRS AND LIBEV_LIBRARIES)
675 message("libev include dir: ${LIBEV_INCLUDE_DIRS}")
676 message("libev libraries: ${LIBEV_LIBRARIES}")
677 include_directories("${LIBEV_INCLUDE_DIRS}")
678 list(APPEND LIB_LIST ${LIBEV_LIBRARIES})
679 endif(LWS_WITH_LIBEV)
682 # Platform specific libs.
685 list(APPEND LIB_LIST ws2.lib)
687 list(APPEND LIB_LIST ws2_32.lib)
691 list(APPEND LIB_LIST m)
694 # Setup the linking for all libs.
695 foreach (lib ${LWS_LIBRARIES})
696 target_link_libraries(${lib} ${LIB_LIST})
703 if (NOT LWS_WITHOUT_TESTAPPS)
705 # Helper function for adding a test app.
707 macro(create_test_app TEST_NAME MAIN_SRC S2 S3 S4 S5)
709 set(TEST_SRCS ${MAIN_SRC})
711 if ("${S2}" STREQUAL "")
713 list(APPEND TEST_SRCS ${S2})
715 if ("${S3}" STREQUAL "")
717 list(APPEND TEST_SRCS ${S3})
719 if ("${S4}" STREQUAL "")
721 list(APPEND TEST_SRCS ${S4})
723 if ("${S5}" STREQUAL "")
725 list(APPEND TEST_SRCS ${S5})
728 list(APPEND TEST_SRCS
729 ${WIN32_HELPERS_PATH}/getopt.c
730 ${WIN32_HELPERS_PATH}/getopt_long.c
731 ${WIN32_HELPERS_PATH}/gettimeofday.c
735 ${WIN32_HELPERS_PATH}/getopt.h
736 ${WIN32_HELPERS_PATH}/gettimeofday.h
740 source_group("Headers Private" FILES ${TEST_HDR})
741 source_group("Sources" FILES ${TEST_SRCS})
742 add_executable(${TEST_NAME} ${TEST_SRCS} ${TEST_HDR})
744 if (LWS_LINK_TESTAPPS_DYNAMIC)
745 if (NOT LWS_WITH_SHARED)
746 message(FATAL_ERROR "Build of the shared library is disabled. LWS_LINK_TESTAPPS_DYNAMIC must be combined with LWS_WITH_SHARED.")
748 target_link_libraries(${TEST_NAME} websockets_shared)
749 add_dependencies(${TEST_NAME} websockets_shared)
751 if (NOT LWS_WITH_STATIC)
752 message(FATAL_ERROR "Build of the static library is disabled. Disabled LWS_LINK_TESTAPPS_DYNAMIC must be combined with LWS_WITH_STATIC.")
754 target_link_libraries(${TEST_NAME} websockets)
755 add_dependencies(${TEST_NAME} websockets)
758 # Set test app specific defines.
759 set_property(TARGET ${TEST_NAME}
760 PROPERTY COMPILE_DEFINITIONS
761 INSTALL_DATADIR="${CMAKE_INSTALL_PREFIX}/share"
764 # Prefix the binary names with libwebsockets.
765 set_target_properties(${TEST_NAME}
767 OUTPUT_NAME libwebsockets-${TEST_NAME})
769 # Add to the list of tests.
770 list(APPEND TEST_APP_LIST ${TEST_NAME})
773 if (LWS_WITH_SSL AND NOT LWS_USE_WOLFSSL)
774 message("Searching for OpenSSL executable and dlls")
775 find_package(OpenSSLbins)
776 message("OpenSSL executable: ${OPENSSL_EXECUTABLE}")
779 if (NOT LWS_WITHOUT_SERVER)
783 if (NOT LWS_WITHOUT_TEST_SERVER)
784 create_test_app(test-server "test-server/test-server.c"
785 "test-server/test-server-http.c"
786 "test-server/test-server-dumb-increment.c"
787 "test-server/test-server-mirror.c"
788 "test-server/test-server-echogen.c")
790 create_test_app(test-fuzxy "test-server/fuzxy.c"
796 if (UNIX AND NOT ((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))
797 create_test_app(test-server-pthreads
798 "test-server/test-server-pthreads.c"
799 "test-server/test-server-http.c"
800 "test-server/test-server-dumb-increment.c"
801 "test-server/test-server-mirror.c"
802 "test-server/test-server-echogen.c")
804 if (UNIX AND NOT ((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
806 create_test_app(test-server-libev
807 "test-server/test-server-libev.c"
808 "test-server/test-server-http.c"
809 "test-server/test-server-dumb-increment.c"
810 "test-server/test-server-mirror.c"
811 "test-server/test-server-echogen.c")
816 # test-server-extpoll
818 if (NOT LWS_WITHOUT_TEST_SERVER_EXTPOLL)
819 create_test_app(test-server-extpoll "test-server/test-server.c"
820 "test-server/test-server-http.c"
821 "test-server/test-server-dumb-increment.c"
822 "test-server/test-server-mirror.c"
823 "test-server/test-server-echogen.c")
824 # Set defines for this executable only.
826 TARGET test-server-extpoll
827 PROPERTY COMPILE_DEFINITIONS
829 INSTALL_DATADIR="${CMAKE_INSTALL_PREFIX}/share"
832 # We need to link against winsock code.
834 target_link_libraries(test-server-extpoll ws2_32.lib)
838 # Data files for running the test server.
840 "${PROJECT_SOURCE_DIR}/test-server/favicon.ico"
841 "${PROJECT_SOURCE_DIR}/test-server/leaf.jpg"
842 "${PROJECT_SOURCE_DIR}/test-server/libwebsockets.org-logo.png"
843 "${PROJECT_SOURCE_DIR}/test-server/test.html")
845 # Generate self-signed SSL certs for the test-server.
846 if (LWS_WITH_SSL AND OPENSSL_EXECUTABLE AND NOT LWS_WITHOUT_TEST_SERVER)
847 message("Generating SSL Certificates for the test-server...")
849 set(TEST_SERVER_SSL_KEY "${PROJECT_BINARY_DIR}/libwebsockets-test-server.key.pem")
850 set(TEST_SERVER_SSL_CERT "${PROJECT_BINARY_DIR}/libwebsockets-test-server.pem")
854 message("cmd = \"${OPENSSL_EXECUTABLE}\" req -new -newkey rsa:1024 -days 10000 -nodes -x509 -subj \"/C=GB/ST=Erewhon/L=All around/O=libwebsockets-test/CN=localhost\" -keyout \"${TEST_SERVER_SSL_KEY}\" -out \"${TEST_SERVER_SSL_CERT}\"")
856 COMMAND "${OPENSSL_EXECUTABLE}" req -new -newkey rsa:1024 -days 10000 -nodes -x509 -subj "/C=GB/ST=Erewhon/L=All around/O=libwebsockets-test/CN=localhost" -keyout "${TEST_SERVER_SSL_KEY}" -out "${TEST_SERVER_SSL_CERT}"
857 RESULT_VARIABLE OPENSSL_RETURN_CODE)
859 file(WRITE "${PROJECT_BINARY_DIR}/openssl_input.txt"
863 "libwebsockets-test\n"
865 "none@invalid.org\n\n"
868 # The "type" command is a bit picky with paths.
869 file(TO_NATIVE_PATH "${PROJECT_BINARY_DIR}/openssl_input.txt" OPENSSL_INPUT_WIN_PATH)
870 message("OPENSSL_INPUT_WIN_PATH = ${OPENSSL_INPUT_WIN_PATH}")
871 message("cmd = \"${OPENSSL_EXECUTABLE}\" req -new -newkey rsa:1024 -days 10000 -nodes -x509 -keyout \"${TEST_SERVER_SSL_KEY}\" -out \"${TEST_SERVER_SSL_CERT}\"")
874 COMMAND cmd /c type "${OPENSSL_INPUT_WIN_PATH}"
875 COMMAND "${OPENSSL_EXECUTABLE}" req -new -newkey rsa:1024 -days 10000 -nodes -x509 -keyout "${TEST_SERVER_SSL_KEY}" -out "${TEST_SERVER_SSL_CERT}"
876 RESULT_VARIABLE OPENSSL_RETURN_CODE
877 OUTPUT_QUIET ERROR_QUIET)
882 if (OPENSSL_RETURN_CODE)
883 message(WARNING "!!! Failed to generate SSL certificate for Test Server using cmd.exe !!!:\nOpenSSL return code = ${OPENSSL_RETURN_CODE}")
885 message("SUCCSESFULLY generated SSL certificate")
890 COMMAND printf "GB\\nErewhon\\nAll around\\nlibwebsockets-test\\n\\nlocalhost\\nnone@invalid.org\\n"
891 COMMAND "${OPENSSL_EXECUTABLE}"
892 req -new -newkey rsa:1024 -days 10000 -nodes -x509 -keyout "${TEST_SERVER_SSL_KEY}" -out "${TEST_SERVER_SSL_CERT}"
893 RESULT_VARIABLE OPENSSL_RETURN_CODE
894 OUTPUT_QUIET ERROR_QUIET)
896 if (OPENSSL_RETURN_CODE)
897 message(WARNING "!!! Failed to generate SSL certificate for Test Server!!!:\nOpenSSL return code = ${OPENSSL_RETURN_CODE}")
899 message("SUCCESSFULLY generated SSL certificate")
903 list(APPEND TEST_SERVER_DATA
904 "${TEST_SERVER_SSL_KEY}"
905 "${TEST_SERVER_SSL_CERT}")
908 add_custom_command(TARGET test-server
910 COMMAND "${CMAKE_COMMAND}" -E make_directory "$<TARGET_FILE_DIR:test-server>/../share/libwebsockets-test-server")
912 # Copy the file needed to run the server so that the test apps can
913 # reach them from their default output location
914 foreach (TEST_FILE ${TEST_SERVER_DATA})
915 if (EXISTS ${TEST_FILE})
916 add_custom_command(TARGET test-server
918 COMMAND "${CMAKE_COMMAND}" -E copy "${TEST_FILE}" "$<TARGET_FILE_DIR:test-server>/../share/libwebsockets-test-server" VERBATIM)
921 endif(NOT LWS_WITHOUT_SERVER)
923 if (NOT LWS_WITHOUT_CLIENT)
927 if (NOT LWS_WITHOUT_TEST_CLIENT)
928 create_test_app(test-client "test-server/test-client.c" "" "" "" "")
934 if (NOT LWS_WITHOUT_TEST_FRAGGLE)
935 create_test_app(test-fraggle "test-server/test-fraggle.c" "" "" "" "")
941 if (NOT LWS_WITHOUT_TEST_PING)
942 create_test_app(test-ping "test-server/test-ping.c" "" "" "" "")
947 if (NOT LWS_WITHOUT_TEST_ECHO)
948 create_test_app(test-echo "test-server/test-echo.c" "" "" "" "")
951 endif(NOT LWS_WITHOUT_CLIENT)
954 # Copy OpenSSL dlls to the output directory on Windows.
955 # (Otherwise we'll get an error when trying to run)
957 if (WIN32 AND LWS_WITH_SSL AND NOT LWS_USE_WOLFSSL)
958 if(OPENSSL_BIN_FOUND)
959 message("OpenSSL dlls found:")
960 message(" Libeay: ${LIBEAY_BIN}")
961 message(" SSLeay: ${SSLEAY_BIN}")
963 foreach(TARGET_BIN ${TEST_APP_LIST})
964 add_custom_command(TARGET ${TARGET_BIN}
966 COMMAND "${CMAKE_COMMAND}" -E copy "${LIBEAY_BIN}" "$<TARGET_FILE_DIR:${TARGET_BIN}>" VERBATIM)
967 add_custom_command(TARGET ${TARGET_BIN}
969 COMMAND "${CMAKE_COMMAND}" -E copy "${SSLEAY_BIN}" "$<TARGET_FILE_DIR:${TARGET_BIN}>" VERBATIM)
973 endif(NOT LWS_WITHOUT_TESTAPPS)
976 # Generate documentation.
977 # TODO: Fix this on Windows.
978 message("Generating API documentation")
979 file(GLOB C_FILES "${PROJECT_SOURCE_DIR}/lib/*.c")
981 execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${PROJECT_BINARY_DIR}/doc/")
984 COMMAND "${PROJECT_SOURCE_DIR}/scripts/kernel-doc" -html ${C_FILES} ${HDR_PUBLIC}
985 OUTPUT_FILE "${PROJECT_BINARY_DIR}/doc/libwebsockets-api-doc.html"
989 COMMAND "${PROJECT_SOURCE_DIR}/scripts/kernel-doc" -text ${C_FILES} ${HDR_PUBLIC}
990 OUTPUT_FILE "${PROJECT_BINARY_DIR}/doc/libwebsockets-api-doc.txt"
993 # Generate and install pkgconfig.
994 # (This is not indented, because the tabs will be part of the output)
995 file(WRITE "${PROJECT_BINARY_DIR}/libwebsockets.pc"
996 "prefix=\"${CMAKE_INSTALL_PREFIX}\"
997 exec_prefix=\${prefix}
998 libdir=\${exec_prefix}/lib${LIB_SUFFIX}
999 includedir=\${prefix}/include
1002 Description: Websockets server and client library
1003 Version: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
1005 Libs: -L\${libdir} -lwebsockets
1006 Cflags: -I\${includedir}"
1009 install(FILES "${PROJECT_BINARY_DIR}/libwebsockets.pc"
1010 DESTINATION lib${LIB_SUFFIX}/pkgconfig)
1014 # Installation preparations.
1017 if(WIN32 AND NOT CYGWIN)
1018 set(DEF_INSTALL_CMAKE_DIR cmake)
1020 set(DEF_INSTALL_CMAKE_DIR lib${LIB_SUFFIX}/cmake/libwebsockets)
1023 set(LWS_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
1025 # Export targets (This is used for other CMake projects to easily find the libraries and include files).
1026 export(TARGETS ${LWS_LIBRARIES}
1027 FILE "${PROJECT_BINARY_DIR}/LibwebsocketsTargets.cmake")
1028 export(PACKAGE libwebsockets)
1030 # Generate the config file for the build-tree.
1031 set(LWS__INCLUDE_DIRS
1032 "${PROJECT_SOURCE_DIR}/lib"
1033 "${PROJECT_BINARY_DIR}")
1034 set(LIBWEBSOCKETS_INCLUDE_DIRS ${LWS__INCLUDE_DIRS} CACHE PATH "Libwebsockets include directories")
1035 configure_file(${PROJECT_SOURCE_DIR}/cmake/LibwebsocketsConfig.cmake.in
1036 ${PROJECT_BINARY_DIR}/LibwebsocketsConfig.cmake
1039 # Generate the config file for the installation tree.
1040 get_filename_component(LWS_ABSOLUTE_INSTALL_CMAKE_DIR ${LWS_INSTALL_CMAKE_DIR} ABSOLUTE)
1041 get_filename_component(LWS_ABSOLUTE_INSTALL_INCLUDE_DIR ${LWS_INSTALL_INCLUDE_DIR} ABSOLUTE)
1044 "${LWS_ABSOLUTE_INSTALL_CMAKE_DIR}"
1045 "${LWS_ABSOLUTE_INSTALL_INCLUDE_DIR}") # Calculate the relative directory from the cmake dir.
1047 # Note the EVENT_CMAKE_DIR is defined in JanssonConfig.cmake.in,
1048 # we escape it here so it's evaluated when it is included instead
1049 # so that the include dirs are given relative to where the
1050 # config file is located.
1051 set(LWS__INCLUDE_DIRS
1052 "\${LWS_CMAKE_DIR}/${REL_INCLUDE_DIR}")
1053 configure_file(${PROJECT_SOURCE_DIR}/cmake/LibwebsocketsConfig.cmake.in
1054 ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/LibwebsocketsConfig.cmake
1057 # Generate version info for both build-tree and install-tree.
1058 configure_file(${PROJECT_SOURCE_DIR}/cmake/LibwebsocketsConfigVersion.cmake.in
1059 ${PROJECT_BINARY_DIR}/LibwebsocketsConfigVersion.cmake
1062 set_target_properties(${LWS_LIBRARIES}
1063 PROPERTIES PUBLIC_HEADER "${HDR_PUBLIC}")
1069 # Install libs and headers.
1070 install(TARGETS ${LWS_LIBRARIES}
1071 EXPORT LibwebsocketsTargets
1072 LIBRARY DESTINATION "${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}" COMPONENT libraries
1073 ARCHIVE DESTINATION "${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}" COMPONENT libraries
1074 RUNTIME DESTINATION "${LWS_INSTALL_BIN_DIR}" COMPONENT libraries # Windows DLLs
1075 PUBLIC_HEADER DESTINATION "${LWS_INSTALL_INCLUDE_DIR}" COMPONENT dev)
1076 set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
1077 set(CPACK_COMPONENT_DEV_DISPLAY_NAME "Development files")
1079 # Install test apps.
1080 if (NOT LWS_WITHOUT_TESTAPPS AND NOT LWS_WITHOUT_CLIENT)
1081 install(TARGETS test-client ${TEST_APP_LIST}
1082 RUNTIME DESTINATION ${LWS_INSTALL_EXAMPLES_DIR}
1084 set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Example files")
1087 # Programs shared files used by the test-server.
1088 if (NOT LWS_WITHOUT_TESTAPPS AND NOT LWS_WITHOUT_SERVER)
1089 install(FILES ${TEST_SERVER_DATA}
1090 DESTINATION share/libwebsockets-test-server
1094 # Install the LibwebsocketsConfig.cmake and LibwebsocketsConfigVersion.cmake
1096 "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/LibwebsocketsConfig.cmake"
1097 "${PROJECT_BINARY_DIR}/LibwebsocketsConfigVersion.cmake"
1098 DESTINATION "${LWS_INSTALL_CMAKE_DIR}" COMPONENT dev)
1100 # build subdir is not part of sources
1101 set(CPACK_SOURCE_IGNORE_FILES $(CPACK_SOURCE_IGNORE_FILES) ".git" "build" "tgz" "tar.gz")
1103 # Most people are more used to "make dist" compared to "make package_source"
1104 add_custom_target(dist COMMAND "${CMAKE_MAKE_PROGRAM}" package_source)
1106 include(UseRPMTools)
1108 RPMTools_ADD_RPM_TARGETS(libwebsockets libwebsockets.spec)
1111 message("---------------------------------------------------------------------")
1112 message(" Settings: (For more help do cmake -LH <srcpath>)")
1113 message("---------------------------------------------------------------------")
1114 message(" LWS_WITH_STATIC = ${LWS_WITH_STATIC}")
1115 message(" LWS_WITH_SHARED = ${LWS_WITH_SHARED}")
1116 message(" LWS_WITH_SSL = ${LWS_WITH_SSL} (SSL Support)")
1117 message(" LWS_SSL_CLIENT_USE_OS_CA_CERTS = ${LWS_SSL_CLIENT_USE_OS_CA_CERTS}")
1118 message(" LWS_USE_WOLFSSL = ${LWS_USE_WOLFSSL} (wolfSSL/CyaSSL replacement for OpenSSL)")
1119 if (LWS_USE_WOLFSSL)
1120 message(" LWS_WOLFSSL_LIBRARIES = ${LWS_WOLFSSL_LIBRARIES}")
1121 message(" LWS_WOLFSSL_INCLUDE_DIRS = ${LWS_WOLFSSL_INCLUDE_DIRS}")
1123 message(" LWS_WITHOUT_BUILTIN_SHA1 = ${LWS_WITHOUT_BUILTIN_SHA1}")
1124 message(" LWS_WITHOUT_BUILTIN_GETIFADDRS = ${LWS_WITHOUT_BUILTIN_GETIFADDRS}")
1125 message(" LWS_WITHOUT_CLIENT = ${LWS_WITHOUT_CLIENT}")
1126 message(" LWS_WITHOUT_SERVER = ${LWS_WITHOUT_SERVER}")
1127 message(" LWS_LINK_TESTAPPS_DYNAMIC = ${LWS_LINK_TESTAPPS_DYNAMIC}")
1128 message(" LWS_WITHOUT_TESTAPPS = ${LWS_WITHOUT_TESTAPPS}")
1129 message(" LWS_WITHOUT_TEST_SERVER = ${LWS_WITHOUT_TEST_SERVER}")
1130 message(" LWS_WITHOUT_TEST_SERVER_EXTPOLL = ${LWS_WITHOUT_TEST_SERVER_EXTPOLL}")
1131 message(" LWS_WITHOUT_TEST_PING = ${LWS_WITHOUT_TEST_PING}")
1132 message(" LWS_WITHOUT_TEST_ECHO = ${LWS_WITHOUT_TEST_ECHO}")
1133 message(" LWS_WITHOUT_TEST_CLIENT = ${LWS_WITHOUT_TEST_CLIENT}")
1134 message(" LWS_WITHOUT_TEST_FRAGGLE = ${LWS_WITHOUT_TEST_FRAGGLE}")
1135 message(" LWS_WITHOUT_EXTENSIONS = ${LWS_WITHOUT_EXTENSIONS}")
1136 message(" LWS_WITH_LATENCY = ${LWS_WITH_LATENCY}")
1137 message(" LWS_WITHOUT_DAEMONIZE = ${LWS_WITHOUT_DAEMONIZE}")
1138 message(" LWS_USE_LIBEV = ${LWS_USE_LIBEV}")
1139 message(" LWS_IPV6 = ${LWS_IPV6}")
1140 message(" LWS_WITH_HTTP2 = ${LWS_WITH_HTTP2}")
1141 message(" LWS_MBED3 = ${LWS_MBED3}")
1142 message(" LWS_SSL_SERVER_WITH_ECDH_CERT = ${LWS_SSL_SERVER_WITH_ECDH_CERT}")
1143 message("---------------------------------------------------------------------")
1145 # These will be available to parent projects including libwebsockets using add_subdirectory()
1146 set(LIBWEBSOCKETS_LIBRARIES ${LWS_LIBRARIES} CACHE STRING "Libwebsocket libraries")
1147 if (LWS_WITH_STATIC)
1148 set(LIBWEBSOCKETS_LIBRARIES_STATIC websocket CACHE STRING "Libwebsocket static library")
1150 if (LWS_WITH_SHARED)
1151 set(LIBWEBSOCKETS_LIBRARIES_SHARED websockets_shared CACHE STRING "Libwebsocket shared library")
1154 # This must always be last!