Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"en-US,en;q\u003d0.5", "gen_ut":1571480111, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets", "f":3, "items": [ {"schema":"libjg2-1", "cid":"03184cff148fb2b33c6d6883ed1a0e98", "oid":{ "oid": "b7a04a67d15efd0f17bf795b8d3648425b604581", "alias": [ "refs/heads/master"]},"blobname": "CMakeLists.txt", "blob": "cmake_minimum_required(VERSION 2.8.9)\n\n# General Advice\n#\n# For selecting between DEBUG / RELEASE, use -DCMAKE_BUILD_TYPE\u003dDEBUG or \u003dRELEASE\n# debug builds include source level debug info and extra logging\n\nset(LWS_WITH_BUNDLED_ZLIB_DEFAULT OFF)\nif(WIN32)\n\tset(LWS_WITH_BUNDLED_ZLIB_DEFAULT ON)\nendif()\n\nset(LWS_ROLE_RAW 1)\nset(LWS_WITH_POLL 1)\n\n#\n# Select features recommended for PC distro packaging\n#\noption(LWS_WITH_DISTRO_RECOMMENDED \u0022Enable features recommended for distro packaging\u0022 OFF)\noption(LWS_FOR_GITOHASHI \u0022Enable features recommended for use with gitohashi\u0022 OFF)\n\n#\n# Major individual features\n#\noption(LWS_WITH_NETWORK \u0022Compile with network-related code\u0022 ON)\noption(LWS_ROLE_H1 \u0022Compile with support for http/1 (needed for ws)\u0022 ON)\noption(LWS_ROLE_WS \u0022Compile with support for websockets\u0022 ON)\noption(LWS_ROLE_DBUS \u0022Compile with support for DBUS\u0022 OFF)\noption(LWS_ROLE_RAW_PROXY \u0022Raw packet proxy\u0022 OFF)\noption(LWS_WITH_HTTP2 \u0022Compile with server support for HTTP/2\u0022 ON)\noption(LWS_WITH_LWSWS \u0022Libwebsockets Webserver\u0022 OFF)\noption(LWS_WITH_CGI \u0022Include CGI (spawn process with network-connected stdin/out/err) APIs\u0022 OFF)\noption(LWS_IPV6 \u0022Compile with support for ipv6\u0022 OFF)\noption(LWS_UNIX_SOCK \u0022Compile with support for UNIX domain socket\u0022 OFF)\noption(LWS_WITH_PLUGINS \u0022Support plugins for protocols and extensions\u0022 OFF)\noption(LWS_WITH_HTTP_PROXY \u0022Support for active HTTP proxying\u0022 OFF)\noption(LWS_WITH_ZIP_FOPS \u0022Support serving pre-zipped files\u0022 OFF)\noption(LWS_WITH_SOCKS5 \u0022Allow use of SOCKS5 proxy on client connections\u0022 OFF)\noption(LWS_WITH_GENERIC_SESSIONS \u0022With the Generic Sessions plugin\u0022 OFF)\noption(LWS_WITH_PEER_LIMITS \u0022Track peers and restrict resources a single peer can allocate\u0022 OFF)\noption(LWS_WITH_ACCESS_LOG \u0022Support generating Apache-compatible access logs\u0022 OFF)\noption(LWS_WITH_RANGES \u0022Support http ranges (RFC7233)\u0022 OFF)\noption(LWS_WITH_SERVER_STATUS \u0022Support json + jscript server monitoring\u0022 OFF)\noption(LWS_WITH_THREADPOOL \u0022Managed worker thread pool support (relies on pthreads)\u0022 OFF)\noption(LWS_WITH_HTTP_STREAM_COMPRESSION \u0022Support HTTP stream compression\u0022 OFF)\noption(LWS_WITH_HTTP_BROTLI \u0022Also offer brotli http stream compression (requires LWS_WITH_HTTP_STREAM_COMPRESSION)\u0022 OFF)\noption(LWS_WITH_ACME \u0022Enable support for ACME automatic cert acquisition + maintenance (letsencrypt etc)\u0022 OFF)\noption(LWS_WITH_HUBBUB \u0022Enable libhubbub rewriting support\u0022 OFF)\noption(LWS_WITH_ALSA \u0022Enable alsa audio example\u0022 OFF)\noption(LWS_WITH_FTS \u0022Full Text Search support\u0022 OFF)\noption(LWS_WITH_SYS_ASYNC_DNS \u0022Nonblocking internal IPv4 + IPv6 DNS resolver\u0022 OFF)\noption(LWS_WITH_SYS_NTPCLIENT \u0022Build in tiny ntpclient good for tls date validation and run via lws_system\u0022 OFF)\noption(LWS_WITH_SYS_DHCP_CLIENT \u0022Build in tiny DHCP client\u0022 OFF)\n#\n# TLS library options... all except mbedTLS are basically OpenSSL variants.\n#\noption(LWS_WITH_SSL \u0022Include SSL support (defaults to OpenSSL or similar, mbedTLS if LWS_WITH_MBEDTLS is set)\u0022 ON)\noption(LWS_WITH_MBEDTLS \u0022Use mbedTLS (\u003e\u003d2.0) replacement for OpenSSL. When setting this, you also may need to specify LWS_MBEDTLS_LIBRARIES and LWS_MBEDTLS_INCLUDE_DIRS\u0022 OFF)\noption(LWS_WITH_BORINGSSL \u0022Use BoringSSL replacement for OpenSSL\u0022 OFF)\noption(LWS_WITH_CYASSL \u0022Use CyaSSL replacement for OpenSSL. When setting this, you also need to specify LWS_CYASSL_LIBRARIES and LWS_CYASSL_INCLUDE_DIRS\u0022 OFF)\noption(LWS_WITH_WOLFSSL \u0022Use wolfSSL replacement for OpenSSL. When setting this, you also need to specify LWS_WOLFSSL_LIBRARIES and LWS_WOLFSSL_INCLUDE_DIRS\u0022 OFF)\noption(LWS_SSL_CLIENT_USE_OS_CA_CERTS \u0022SSL support should make use of the OS-installed CA root certs\u0022 ON)\n#\n# Event library options (may select multiple, or none for default poll()\n#\noption(LWS_WITH_LIBEV \u0022Compile with support for libev\u0022 OFF)\noption(LWS_WITH_LIBUV \u0022Compile with support for libuv\u0022 OFF)\noption(LWS_WITH_LIBEVENT \u0022Compile with support for libevent\u0022 OFF)\n#\n# Static / Dynamic build options\n#\noption(LWS_WITH_STATIC \u0022Build the static version of the library\u0022 ON)\noption(LWS_WITH_SHARED \u0022Build the shared version of the library\u0022 ON)\noption(LWS_LINK_TESTAPPS_DYNAMIC \u0022Link the test apps to the shared version of the library. Default is to link statically\u0022 OFF)\noption(LWS_STATIC_PIC \u0022Build the static version of the library with position-independent code\u0022 OFF)\n#\n# Specific platforms\n#\noption(LWS_WITH_ESP32 \u0022Build for ESP32\u0022 OFF)\noption(LWS_WITH_ESP32_HELPER \u0022Build ESP32 helper\u0022 OFF)\noption(LWS_PLAT_OPTEE \u0022Build for OPTEE\u0022 OFF)\noption(LWS_PLAT_FREERTOS \u0022Build for FreeRTOS\u0022 OFF)\noption(LWS_PLAT_ANDROID \u0022Android flavour of unix platform\u0022 OFF)\n\n#\n# Client / Server / Test Apps build control\n#\noption(LWS_WITHOUT_CLIENT \u0022Don't build the client part of the library\u0022 OFF)\noption(LWS_WITHOUT_SERVER \u0022Don't build the server part of the library\u0022 OFF)\noption(LWS_WITHOUT_TESTAPPS \u0022Don't build the libwebsocket-test-apps\u0022 OFF)\noption(LWS_WITHOUT_TEST_SERVER \u0022Don't build the test server\u0022 OFF)\noption(LWS_WITHOUT_TEST_SERVER_EXTPOLL \u0022Don't build the test server version that uses external poll\u0022 OFF)\noption(LWS_WITHOUT_TEST_PING \u0022Don't build the ping test application\u0022 OFF)\noption(LWS_WITHOUT_TEST_CLIENT \u0022Don't build the client test application\u0022 OFF)\n#\n# Extensions (permessage-deflate)\n#\noption(LWS_WITHOUT_EXTENSIONS \u0022Don't compile with extensions\u0022 ON)\n#\n# Helpers + misc\n#\noption(LWS_WITHOUT_BUILTIN_GETIFADDRS \u0022Don'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.\u0022 OFF)\noption(LWS_FALLBACK_GETHOSTBYNAME \u0022Also try to do dns resolution using gethostbyname if getaddrinfo fails\u0022 OFF)\noption(LWS_WITHOUT_BUILTIN_SHA1 \u0022Don't build the lws sha-1 (eg, because openssl will provide it\u0022 OFF)\noption(LWS_WITHOUT_DAEMONIZE \u0022Don't build the daemonization api\u0022 ON)\noption(LWS_SSL_SERVER_WITH_ECDH_CERT \u0022Include SSL server use ECDH certificate\u0022 OFF)\noption(LWS_WITH_LEJP \u0022With the Lightweight JSON Parser\u0022 ON)\noption(LWS_WITH_SQLITE3 \u0022Require SQLITE3 support\u0022 OFF)\noption(LWS_WITH_STRUCT_JSON \u0022Generic struct serialization to and from JSON\u0022 OFF)\noption(LWS_WITH_STRUCT_SQLITE3 \u0022Generic struct serialization to and from SQLITE3\u0022 OFF)\noption(LWS_WITH_SMTP \u0022Provide SMTP support\u0022 OFF)\nif (WIN32 OR LWS_WITH_ESP32)\noption(LWS_WITH_DIR \u0022Directory scanning api support\u0022 OFF)\noption(LWS_WITH_LEJP_CONF \u0022With LEJP configuration parser as used by lwsws\u0022 OFF)\nelse()\noption(LWS_WITH_DIR \u0022Directory scanning api support\u0022 ON)\noption(LWS_WITH_LEJP_CONF \u0022With LEJP configuration parser as used by lwsws\u0022 ON)\nendif()\noption(LWS_WITH_NO_LOGS \u0022Disable all logging from being compiled in\u0022 OFF)\noption(LWS_AVOID_SIGPIPE_IGN \u0022Android 7+ reportedly needs this\u0022 OFF)\noption(LWS_WITH_STATS \u0022Keep statistics of lws internal operations\u0022 OFF)\noption(LWS_WITH_JOSE \u0022JSON Web Signature / Encryption / Keys (RFC7515/6/) API\u0022 OFF)\noption(LWS_WITH_GENCRYPTO \u0022Enable support for Generic Crypto apis independent of TLS backend\u0022 OFF)\noption(LWS_WITH_SELFTESTS \u0022Selftests run at context creation\u0022 OFF)\noption(LWS_WITH_GCOV \u0022Build with gcc gcov coverage instrumentation\u0022 OFF)\noption(LWS_WITH_EXPORT_LWSTARGETS \u0022Export libwebsockets CMake targets. Disable if they conflict with an outer cmake project.\u0022 ON)\noption(LWS_REPRODUCIBLE \u0022Build libwebsockets reproducible. It removes the build user and hostname from the build\u0022 ON)\noption(LWS_WITH_MINIMAL_EXAMPLES \u0022Also build the normally standalone minimal examples, for QA\u0022 OFF)\noption(LWS_WITH_LWSAC \u0022lwsac Chunk Allocation api\u0022 ON)\noption(LWS_WITH_CUSTOM_HEADERS \u0022Store and allow querying custom HTTP headers (H1 only)\u0022 ON)\noption(LWS_WITH_DISKCACHE \u0022Hashed cache directory with lazy LRU deletion to size limit\u0022 OFF)\noption(LWS_WITH_ASAN \u0022Build with gcc runtime sanitizer options enabled (needs libasan)\u0022 OFF)\noption(LWS_WITH_DIR \u0022Directory scanning api support\u0022 OFF)\noption(LWS_WITH_LEJP_CONF \u0022With LEJP configuration parser as used by lwsws\u0022 OFF)\noption(LWS_WITH_ZLIB \u0022Include zlib support (required for extensions)\u0022 OFF)\noption(LWS_WITH_BUNDLED_ZLIB \u0022Use bundled zlib version (Windows only)\u0022 ${LWS_WITH_BUNDLED_ZLIB_DEFAULT})\noption(LWS_WITH_MINIZ \u0022Use miniz instead of zlib\u0022 OFF)\noption(LWS_WITH_DEPRECATED_LWS_DLL \u0022Migrate to lws_dll2 instead ASAP\u0022 OFF)\noption(LWS_WITH_SEQUENCER \u0022lws_seq_t support\u0022 ON)\noption(LWS_WITH_EXTERNAL_POLL \u0022Support external POLL integration using callback messages (not recommended)\u0022 OFF)\noption(LWS_WITH_LWS_DSH \u0022Support lws_dsh_t Disordered Shared Heap\u0022 OFF)\noption(LWS_CLIENT_HTTP_PROXYING \u0022Support external http proxies for client connections\u0022 ON)\noption(LWS_WITH_FILE_OPS \u0022Support file operations vfs\u0022 ON)\noption(LWS_WITH_DETAILED_LATENCY \u0022Record detailed latency stats for each read and write\u0022 OFF)\noption(LWS_WITH_UDP \u0022Platform supports UDP\u0022 ON)\n\n#\n# to use miniz, enable both LWS_WITH_ZLIB and LWS_WITH_MINIZ\n#\n# End of user settings\n#\n\n# Workaround for ESP-IDF\n# Detect ESP_PLATFORM environment flag, if exist, set LWS_WITH_ESP32.\n# Otherwise the user may not be able to run configuration ESP-IDF in the first time.\nif(ESP_PLATFORM)\n\tmessage(STATUS \u0022ESP-IDF enabled\u0022)\n\tset(LWS_WITH_ESP32 ON)\nelse()\n\tset(LWS_WITH_ESP32_HELPER OFF)\nendif()\n\nif (LWS_WITH_ESP32)\n\tset(LWS_PLAT_FREERTOS 1)\nendif()\n\nif (LWS_PLAT_FREERTOS OR LWS_PLAT_OPTEE)\n\tset(LWS_WITH_UDP 0)\nendif()\n\nif (WIN32 OR LWS_PLAT_FREERTOS)\n\tmessage(STATUS \u0022No LWS_WITH_DIR and LWS_WITH_DIR\u0022)\n\tset(LWS_WITH_DIR OFF)\n\tset(LWS_WITH_LEJP_CONF OFF)\n\tmessage(\u0022LWS_WITH_DIR ${LWS_WITH_DIR}\u0022)\nelse()\n\tmessage(STATUS \u0022Compiled with LWS_WITH_DIR and LWS_WITH_DIR\u0022)\n\tset(LWS_WITH_DIR ON)\n\tset(LWS_WITH_LEJP_CONF ON)\nendif()\n\nif (LWS_FOR_GITOHASHI)\n\tset(LWS_WITH_THREADPOOL 1)\n\tset(LWS_WITH_HTTP2 1)\n\tset(LWS_UNIX_SOCK 1)\n\tset(LWS_WITH_HTTP_PROXY 1)\n\tset(LWS_WITH_FTS 1)\n\tset(LWS_WITH_DISKCACHE 1)\n\tset(LWS_WITH_LWSAC 1)\n\tset(LWS_WITH_LEJP_CONF 1)\nendif()\n\nif(LWS_WITH_DISTRO_RECOMMENDED)\n\tset(LWS_WITH_HTTP2 1)\n\tset(LWS_WITH_LWSWS 1)\n\tset(LWS_WITH_CGI 1)\n\tset(LWS_IPV6 1)\n\tset(LWS_WITH_ZIP_FOPS 1)\n\tset(LWS_WITH_SOCKS5 1)\n\tset(LWS_WITH_RANGES 1)\n\tset(LWS_WITH_ACME 1)\n\tset(LWS_WITH_SERVER_STATUS 1)\n\tset(LWS_WITH_LIBUV 1)\n\tset(LWS_WITH_LIBEV 1)\n\t# libev + libevent cannot coexist at build-time\n\tset(LWS_WITH_LIBEVENT 0)\n\tset(LWS_WITHOUT_EXTENSIONS 0)\n\tset(LWS_ROLE_DBUS 1)\n\tset(LWS_WITH_FTS 1)\n\tset(LWS_WITH_THREADPOOL 1)\n\tset(LWS_UNIX_SOCK 1)\n\tset(LWS_WITH_HTTP_PROXY 1)\n\tset(LWS_WITH_DISKCACHE 1)\n\tset(LWS_WITH_LWSAC 1)\n\tset(LWS_WITH_LEJP_CONF 1)\n\tset(LWS_WITH_PLUGINS 1)\n\tset(LWS_ROLE_RAW_PROXY 1)\n\tset(LWS_WITH_GENCRYPTO 1)\n\tset(LWS_WITH_JOSE 1)\nendif()\n\nif (NOT LWS_WITH_NETWORK)\n\tset(LWS_ROLE_H1 0)\n\tset(LWS_ROLE_WS 0)\n\tset(LWS_ROLE_RAW 0)\n\tset(LWS_WITHOUT_EXTENSIONS 1)\n\tset(LWS_WITHOUT_SERVER 1)\n\tset(LWS_WITHOUT_CLIENT 1)\n\tset(LWS_WITH_HTTP2 0)\n\tset(LWS_WITH_SOCKS5 0)\n\tset(LWS_UNIX_SOCK 0)\n\tset(LWS_WITH_HTTP_PROXY 0)\n\tset(LWS_WITH_PLUGINS 0)\n\tset(LWS_WITH_LWSWS 0)\n\tset(LWS_WITH_CGI 0)\n\tset(LWS_ROLE_RAW_PROXY 0)\n\tset(LWS_WITH_PEER_LIMITS 0)\n\tset(LWS_WITH_GENERIC_SESSIONS 0)\n\tset(LWS_WITH_HTTP_STREAM_COMPRESSION 0)\n\tset(LWS_WITH_HTTP_BROTLI 0)\n\tset(LWS_WITH_POLL 0)\n\tset(LWS_WITH_SEQUENCER 0)\n\tset(LWS_ROLE_DBUS 0)\n\tset(LWS_WITH_LWS_DSH 0)\nendif()\n\nif (LWS_WITH_STRUCT_SQLITE3)\n\tset(LWS_WITH_SQLITE3 1)\nendif()\n\n# do you care about this? Then send me a patch where it disables it on travis\n# but allows it on APPLE\nif (APPLE)\n\tset(LWS_ROLE_DBUS 0)\nendif()\n\nif(NOT DEFINED CMAKE_BUILD_TYPE)\n\tset(CMAKE_BUILD_TYPE Release CACHE STRING \u0022Build type\u0022)\nendif()\n\n# microsoft... that's why you can't have nice things\n\nif (WIN32 OR LWS_PLAT_FREERTOS)\n\tset(LWS_UNIX_SOCK 0)\nendif()\n\nif (LWS_PLAT_FREERTOS)\n\tset(LWS_WITH_LWSAC 0)\n\tset(LWS_WITH_FTS 0)\nendif()\n\nproject(libwebsockets C)\n\nset(PACKAGE \u0022libwebsockets\u0022)\nset(CPACK_PACKAGE_NAME \u0022${PACKAGE}\u0022)\nset(CPACK_PACKAGE_VERSION_MAJOR \u00223\u0022)\nset(CPACK_PACKAGE_VERSION_MINOR \u00222\u0022)\nset(CPACK_PACKAGE_VERSION_PATCH \u002299\u0022)\nset(CPACK_PACKAGE_RELEASE 1)\nset(CPACK_GENERATOR \u0022RPM\u0022)\nset(CPACK_PACKAGE_VERSION \u0022${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\u0022)\nset(CPACK_PACKAGE_VENDOR \u0022andy@warmcat.com\u0022)\nset(CPACK_PACKAGE_CONTACT \u0022andy@warmcat.com\u0022)\nset(CPACK_PACKAGE_DESCRIPTION_SUMMARY \u0022${PACKAGE} ${PACKAGE_VERSION}\u0022)\nset(SOVERSION \u002215\u0022)\nif(NOT CPACK_GENERATOR)\n if(UNIX)\n set(CPACK_GENERATOR \u0022TGZ\u0022)\n else()\n set(CPACK_GENERATOR \u0022ZIP\u0022)\n endif()\nendif()\nset(CPACK_SOURCE_GENERATOR \u0022TGZ\u0022)\nset(CPACK_SOURCE_PACKAGE_FILE_NAME \u0022${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}\u0022)\nset(VERSION \u0022${CPACK_PACKAGE_VERSION}\u0022)\n\nset(LWS_LIBRARY_VERSION ${CPACK_PACKAGE_VERSION})\nset(LWS_LIBRARY_VERSION_MAJOR ${CPACK_PACKAGE_VERSION_MAJOR})\nset(LWS_LIBRARY_VERSION_MINOR ${CPACK_PACKAGE_VERSION_MINOR})\nset(LWS_LIBRARY_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH})\n\nset(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} \u0022${PROJECT_SOURCE_DIR}/cmake/\u0022)\n\n\nmessage(STATUS \u0022CMAKE_TOOLCHAIN_FILE\u003d'${CMAKE_TOOLCHAIN_FILE}'\u0022)\n\nif(WIN32)\n\tconfigure_file(${CMAKE_CURRENT_SOURCE_DIR}/win32port/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/win32port/version.rc @ONLY)\n\tset(RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/win32port/version.rc)\nendif()\n\n# Try to find the current Git hash.\nfind_package(Git)\nif(GIT_EXECUTABLE)\n\texecute_process(\n\t\tWORKING_DIRECTORY \u0022${CMAKE_CURRENT_SOURCE_DIR}\u0022\n\t\tCOMMAND \u0022${GIT_EXECUTABLE}\u0022 describe --tags\n\t\tOUTPUT_VARIABLE GIT_HASH\n\t\tOUTPUT_STRIP_TRAILING_WHITESPACE\n\t\t)\n\tset(LWS_BUILD_HASH ${GIT_HASH})\n\n\t# append the build user and hostname\n\tif(NOT LWS_REPRODUCIBLE)\n\t\texecute_process(\n\t\t\tWORKING_DIRECTORY \u0022${CMAKE_CURRENT_SOURCE_DIR}\u0022\n\t\t\tCOMMAND \u0022whoami\u0022\n\t\t\tOUTPUT_VARIABLE GIT_USER\n\t\t\tOUTPUT_STRIP_TRAILING_WHITESPACE\n\t\t\t)\n\t\texecute_process(\n\t\t\tWORKING_DIRECTORY \u0022${CMAKE_CURRENT_SOURCE_DIR}\u0022\n\t\t\tCOMMAND \u0022hostname\u0022\n\t\t\tOUTPUT_VARIABLE GIT_HOST\n\t\t\tOUTPUT_STRIP_TRAILING_WHITESPACE\n\t\t\t)\n\t\tstring(REGEX REPLACE \u0022([^\u005c\u005c])[\u005c\u005c]([^\u005c\u005c])\u0022 \u0022\u005c\u005c1\u005c\u005c\u005c\u005c\u005c\u005c\u005c\u005c\u005c\u005c2\u0022 GIT_USER ${GIT_USER})\n\t\tset(LWS_BUILD_HASH ${GIT_USER}@${GIT_HOST}-${GIT_HASH})\n\tendif()\n\n\tmessage(\u0022Git commit hash: ${LWS_BUILD_HASH}\u0022)\nendif()\n\n# translate old functionality enables to set up ROLE enables so nothing changes\nif (LWS_WITH_HTTP2 AND LWS_WITHOUT_SERVER)\n\tset(LWS_WITH_HTTP2 0)\n\tmessage(\u0022HTTP2 disabled due to LWS_WITHOUT_SERVER\u0022)\nendif()\n\nif (LWS_WITH_HTTP2)\n\tset(LWS_ROLE_H2 1)\nendif()\nif (LWS_WITH_CGI)\n\tset(LWS_ROLE_CGI 1)\nendif()\n\nif (NOT LWS_ROLE_WS)\n\tset(LWS_WITHOUT_EXTENSIONS 1)\nendif()\n\nif (LWS_WITH_MBEDTLS)\n\tinclude_directories(lib/tls/mbedtls/wrapper/include)\nendif()\n\ninclude_directories(include plugins lib/core lib/core-net lib/event-libs include/abstract lib/tls lib/roles lib/event-libs/libuv lib/event-libs/poll lib/event-libs/libevent lib/event-libs/libev lib/jose/jwe lib/jose/jws lib/jose lib/misc lib/roles/http lib/roles/http/compression lib/roles/h1 lib/roles/h2 lib/roles/ws lib/roles/cgi lib/roles/dbus lib/roles/raw-proxy lib/abstract lib/system/async-dns)\n\nif (LWS_PLAT_FREERTOS)\n\tinclude_directories(lib/plat/freertos lib/plat/freertos/esp32)\nelse()\n\tif (WIN32)\n\t\tinclude_directories(lib/plat/windows)\n\telse()\n\t\tif (LWS_WITH_OPTEE)\n\t\t\tinclude_directories(lib/plat/optee)\n\t\telse()\n\t\t\tinclude_directories(lib/plat/unix)\n\t\tendif()\n\tendif()\nendif()\n\n\nif (LWS_WITH_LWSWS)\n message(STATUS \u0022LWS_WITH_LWSWS --\u003e Enabling LWS_WITH_PLUGINS and LWS_WITH_LIBUV\u0022)\n set(LWS_WITH_PLUGINS 1)\n set(LWS_WITH_LIBUV 1)\n set(LWS_WITH_ACCESS_LOG 1)\n set(LWS_WITH_SERVER_STATUS 1)\n set(LWS_WITH_LEJP 1)\n set(LWS_WITH_LEJP_CONF 1)\n set(LWS_WITH_PEER_LIMITS 1)\n set(LWS_ROLE_RAW_PROXY 1)\nendif()\n\n# sshd plugin\nif (LWS_WITH_PLUGINS)\n set(LWS_WITH_GENCRYPTO 1)\nendif()\n\nif (LWS_ROLE_RAW_PROXY)\n set (LWS_WITH_CLIENT 1)\n set (LWS_WITH_SERVER 1)\nendif()\n\nif (LWS_WITH_ACME)\n set (LWS_WITH_CLIENT 1)\n set (LWS_WITH_SERVER 1)\n set (LWS_WITH_JOSE 1)\nendif()\n\nif (LWS_WITH_JOSE)\n set(LWS_WITH_LEJP 1)\n set(LWS_WITH_GENCRYPTO 1)\nendif()\n\nif (LWS_WITH_PLUGINS AND NOT LWS_WITH_LIBUV)\nmessage(STATUS \u0022LWS_WITH_PLUGINS --\u003e Enabling LWS_WITH_LIBUV\u0022)\n set(LWS_WITH_LIBUV 1)\nendif()\n\nif (LWS_WITH_PLUGINS OR LWS_WITH_CGI)\n\t# sshd plugin\n set(LWS_WITH_GENCRYPTO 1)\nendif()\n\nif (LWS_WITH_GENERIC_SESSIONS)\n set(LWS_WITH_SQLITE3 1)\n set(LWS_WITH_SMTP 1)\n set(LWS_WITH_STRUCT_SQLITE3 1)\nendif()\n\nif (LWS_PLAT_FREERTOS)\n set(LWS_WITH_SHARED OFF)\n set(LWS_WITH_MBEDTLS ON)\n # set(LWS_WITHOUT_CLIENT ON)\n set(LWS_WITHOUT_TESTAPPS ON)\n set(LWS_WITHOUT_EXTENSIONS ON)\n set(LWS_WITH_PLUGINS OFF)\n set(LWS_WITH_RANGES ON)\n # this implies no pthreads in the lib\n set(LWS_MAX_SMP 1)\n set(LWS_HAVE_MALLOC 1)\n set(LWS_HAVE_REALLOC 1)\n set(LWS_HAVE_GETIFADDRS 1)\n set(LWS_WITH_ZIP_FOPS 1)\n set(LWS_WITH_CUSTOM_HEADERS 0)\nendif()\n\n\nif (WIN32)\nset(LWS_MAX_SMP 1)\nset(LWS_WITH_THREADPOOL 0)\nendif()\n\nif (LWS_WITHOUT_SERVER)\nset(LWS_WITH_LWSWS OFF)\nendif()\n\nif (LWS_WITH_LEJP_CONF)\n\tset(LWS_WITH_DIR 1)\nendif()\n\n# confirm H1 relationships\n\nif (NOT LWS_ROLE_H1 AND LWS_ROLE_H2)\n\tmessage(FATAL_ERROR \u0022H2 requires LWS_ROLE_H1\u0022)\nendif()\n\nif (NOT LWS_ROLE_H1 AND LWS_ROLE_WS)\n\tmessage(FATAL_ERROR \u0022WS requires LWS_ROLE_H1\u0022)\nendif()\n\nif (NOT LWS_ROLE_H1 AND LWS_ROLE_CGI)\n\tmessage(FATAL_ERROR \u0022CGI requires LWS_ROLE_H1\u0022)\nendif()\n\n# confirm HTTP relationships\n\nif (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_HTTP_PROXY)\n\tmessage(FATAL_ERROR \u0022LWS_WITH_LWSWS requires LWS_ROLE_H1\u0022)\nendif()\n\nif (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_HTTP_PROXY)\n\tmessage(FATAL_ERROR \u0022LWS_WITH_HTTP_PROXY requires LWS_ROLE_H1\u0022)\nendif()\n\nif (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_RANGES)\n\tmessage(FATAL_ERROR \u0022LWS_WITH_RANGES requires LWS_ROLE_H1\u0022)\nendif()\n\nif (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_ACCESS_LOG)\n\tmessage(FATAL_ERROR \u0022LWS_WITH_ACCESS_LOG requires LWS_ROLE_H1\u0022)\nendif()\n\n\nif (LWS_WITH_HTTP_PROXY AND (LWS_WITHOUT_CLIENT OR LWS_WITHOUT_SERVER))\n\tmessage(\u0022You have to enable both client and server for http proxy\u0022)\n\tset(LWS_WITH_HTTP_PROXY 0)\nendif()\n\n# Allow the user to override installation directories.\nset(LWS_INSTALL_LIB_DIR lib CACHE PATH \u0022Installation directory for libraries\u0022)\nset(LWS_INSTALL_BIN_DIR bin CACHE PATH \u0022Installation directory for executables\u0022)\nset(LWS_INSTALL_INCLUDE_DIR include CACHE PATH \u0022Installation directory for header files\u0022)\nset(LWS_INSTALL_EXAMPLES_DIR bin CACHE PATH \u0022Installation directory for example files\u0022)\n\n# Allow the user to use the old CyaSSL options/library in stead of wolfSSL\nif (LWS_WITH_CYASSL AND LWS_WITH_WOLFSSL)\n\tmessage(FATAL_ERROR \u0022LWS_WITH_CYASSL and LWS_WITH_WOLFSSL are mutually exclusive!\u0022)\nendif()\nif (LWS_WITH_CYASSL)\n\t# Copy CyaSSL options to the wolfSSL options\n\tset(LWS_WITH_WOLFSSL ${LWS_WITH_CYASSL} CACHE BOOL \u0022Use wolfSSL/CyaSSL instead of OpenSSL\u0022 FORCE)\n\tset(LWS_WOLFSSL_LIBRARIES ${LWS_CYASSL_LIBRARIES} CACHE PATH \u0022Path to wolfSSL/CyaSSL libraries\u0022 FORCE)\n\tset(LWS_WOLFSSL_INCLUDE_DIRS ${LWS_CYASSL_INCLUDE_DIRS} CACHE PATH \u0022Path to wolfSSL/CyaSSL header files\u0022 FORCE)\nendif()\n\nif (NOT (LWS_WITH_STATIC OR LWS_WITH_SHARED))\n\tmessage(FATAL_ERROR \u0022Makes no sense to compile with neither static nor shared libraries.\u0022)\nendif()\n\nif (NOT LWS_WITHOUT_EXTENSIONS OR LWS_WITH_ZIP_FOPS)\n\tset(LWS_WITH_ZLIB 1)\nendif()\n\n# if you gave LWS_WITH_MINIZ, point to MINIZ here if not found\n# automatically\n\nset(LWS_ZLIB_LIBRARIES CACHE PATH \u0022Path to the zlib/miniz library\u0022)\nset(LWS_ZLIB_INCLUDE_DIRS CACHE PATH \u0022Path to the zlib/miniz include directory\u0022)\nset(LWS_OPENSSL_LIBRARIES CACHE PATH \u0022Path to the OpenSSL library\u0022)\nset(LWS_OPENSSL_INCLUDE_DIRS CACHE PATH \u0022Path to the OpenSSL include directory\u0022)\nset(LWS_WOLFSSL_LIBRARIES CACHE PATH \u0022Path to the wolfSSL library\u0022)\nset(LWS_WOLFSSL_INCLUDE_DIRS CACHE PATH \u0022Path to the wolfSSL include directory\u0022)\nset(LWS_LIBEV_LIBRARIES CACHE PATH \u0022Path to the libev library\u0022)\nset(LWS_LIBEV_INCLUDE_DIRS CACHE PATH \u0022Path to the libev include directory\u0022)\nset(LWS_LIBUV_LIBRARIES CACHE PATH \u0022Path to the libuv library\u0022)\nset(LWS_LIBUV_INCLUDE_DIRS CACHE PATH \u0022Path to the libuv include directory\u0022)\nset(LWS_SQLITE3_LIBRARIES CACHE PATH \u0022Path to the sqlite3 library\u0022)\nset(LWS_SQLITE3_INCLUDE_DIRS CACHE PATH \u0022Path to the sqlite3 include directory\u0022)\nset(LWS_LIBEVENT_INCLUDE_DIRS CACHE PATH \u0022Path to the libevent include directory\u0022)\nset(LWS_LIBEVENT_LIBRARIES CACHE PATH \u0022Path to the libevent library\u0022)\n\n\nif (NOT LWS_WITH_SSL)\n\tset(LWS_WITHOUT_BUILTIN_SHA1 OFF)\nendif()\n\nif (LWS_WITH_BORINGSSL)\n\t# boringssl deprecated EVP_PKEY\n\tset (LWS_WITH_GENHASH OFF)\nendif()\n\nif (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL AND NOT LWS_WITH_MBEDTLS)\n\tif (\u0022${LWS_OPENSSL_LIBRARIES}\u0022 STREQUAL \u0022\u0022 OR \u0022${LWS_OPENSSL_INCLUDE_DIRS}\u0022 STREQUAL \u0022\u0022)\n\telse()\n\t\tif (NOT LWS_PLAT_FREERTOS)\n\t\t\tset(OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES})\n\t\tendif()\n\t\tset(OPENSSL_INCLUDE_DIRS ${LWS_OPENSSL_INCLUDE_DIRS})\n\t\tset(OPENSSL_FOUND 1)\n\tendif()\nendif()\n\nif (LWS_WITH_SSL AND LWS_WITH_WOLFSSL)\n\tif (\u0022${LWS_WOLFSSL_LIBRARIES}\u0022 STREQUAL \u0022\u0022 OR \u0022${LWS_WOLFSSL_INCLUDE_DIRS}\u0022 STREQUAL \u0022\u0022)\n\t\tif (NOT WOLFSSL_FOUND)\n\t\t\tif (LWS_WITH_CYASSL)\n\t\t\t\tmessage(FATAL_ERROR \u0022You must set LWS_CYASSL_LIBRARIES and LWS_CYASSL_INCLUDE_DIRS when LWS_WITH_CYASSL is turned on.\u0022)\n\t\t\telse()\n\t\t\t\tmessage(FATAL_ERROR \u0022You must set LWS_WOLFSSL_LIBRARIES and LWS_WOLFSSL_INCLUDE_DIRS when LWS_WITH_WOLFSSL is turned on.\u0022)\n\t\t\tendif()\n\t\tendif()\n\telse()\n\t\tset(WOLFSSL_LIBRARIES ${LWS_WOLFSSL_LIBRARIES})\n\t\tset(WOLFSSL_INCLUDE_DIRS ${LWS_WOLFSSL_INCLUDE_DIRS})\n\t\tset(WOLFSSL_FOUND 1)\n\tendif()\n\tset(USE_WOLFSSL 1)\n\tset(LWS_WITH_TLS 1)\n\tif (LWS_WITH_CYASSL)\n\t\tset(USE_OLD_CYASSL 1)\n\tendif()\nendif()\n\nif (LWS_WITH_SSL AND LWS_WITH_MBEDTLS)\n\tif (\u0022${LWS_MBEDTLS_LIBRARIES}\u0022 STREQUAL \u0022\u0022 OR \u0022${LWS_MBEDTLS_INCLUDE_DIRS}\u0022 STREQUAL \u0022\u0022 AND NOT LWS_PLAT_FREERTOS)\n\n\t\tfind_path(LWS_MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h)\n\n\t\tfind_library(MBEDTLS_LIBRARY mbedtls)\n\t\tfind_library(MBEDX509_LIBRARY mbedx509)\n\t\tfind_library(MBEDCRYPTO_LIBRARY mbedcrypto)\n\n\t\tset(LWS_MBEDTLS_LIBRARIES \u0022${MBEDTLS_LIBRARY}\u0022 \u0022${MBEDX509_LIBRARY}\u0022 \u0022${MBEDCRYPTO_LIBRARY}\u0022)\n\n\t\tinclude(FindPackageHandleStandardArgs)\n\t\tfind_package_handle_standard_args(MBEDTLS DEFAULT_MSG\n\t\t\tLWS_MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)\n\n\t\tmark_as_advanced(LWS_MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)\n\n\t\tif (\u0022${LWS_MBEDTLS_LIBRARIES}\u0022 STREQUAL \u0022\u0022 OR \u0022${LWS_MBEDTLS_INCLUDE_DIRS}\u0022 STREQUAL \u0022\u0022)\n\t\t\tmessage(FATAL_ERROR \u0022You must set LWS_MBEDTLS_LIBRARIES and LWS_MBEDTLS_INCLUDE_DIRS when LWS_WITH_MBEDTLS is turned on.\u0022)\n\t\tendif()\n\tendif()\n\tset(MBEDTLS_LIBRARIES ${LWS_MBEDTLS_LIBRARIES})\n\tset(MBEDTLS_INCLUDE_DIRS ${LWS_MBEDTLS_INCLUDE_DIRS})\n\tset(MBEDTLS_FOUND 1)\n\tset(USE_MBEDTLS 1)\nendif()\n\nif (LWS_WITH_HTTP_STREAM_COMPRESSION)\n\tset(LWS_WITH_ZLIB 1)\nendif()\n\nif (LWS_WITH_ZLIB AND NOT LWS_WITH_BUNDLED_ZLIB)\n\tif (\u0022${LWS_ZLIB_LIBRARIES}\u0022 STREQUAL \u0022\u0022 OR \u0022${LWS_ZLIB_INCLUDE_DIRS}\u0022 STREQUAL \u0022\u0022)\n\telse()\n\t\tset(ZLIB_LIBRARIES ${LWS_ZLIB_LIBRARIES})\n\t\tset(ZLIB_INCLUDE_DIRS ${LWS_ZLIB_INCLUDE_DIRS})\n\t\tset(ZLIB_FOUND 1)\n\tendif()\nendif()\n\nif (LWS_WITH_LIBEV)\n\tif (\u0022${LWS_LIBEV_LIBRARIES}\u0022 STREQUAL \u0022\u0022 OR \u0022${LWS_LIBEV_INCLUDE_DIRS}\u0022 STREQUAL \u0022\u0022)\n\telse()\n\t\tset(LIBEV_LIBRARIES ${LWS_LIBEV_LIBRARIES})\n\t\tset(LIBEV_INCLUDE_DIRS ${LWS_LIBEV_INCLUDE_DIRS})\n\t\tset(LIBEV_FOUND 1)\n\tendif()\nendif()\n\nif (LWS_WITH_LIBUV)\n\tif (\u0022${LWS_LIBUV_LIBRARIES}\u0022 STREQUAL \u0022\u0022 OR \u0022${LWS_LIBUV_INCLUDE_DIRS}\u0022 STREQUAL \u0022\u0022)\n\telse()\n\t\tset(LIBUV_LIBRARIES ${LWS_LIBUV_LIBRARIES})\n\t\tset(LIBUV_INCLUDE_DIRS ${LWS_LIBUV_INCLUDE_DIRS})\n\t\tset(LIBUV_FOUND 1)\n\tendif()\nendif()\n\nif (LWS_WITH_LIBEVENT)\n\tif (\u0022${LWS_LIBEVENT_LIBRARIES}\u0022 STREQUAL \u0022\u0022 OR \u0022${LWS_LIBEVENT_INCLUDE_DIRS}\u0022 STREQUAL \u0022\u0022)\n\telse()\n\t\tset(LIBEVENT_LIBRARIES ${LWS_LIBEVENT_LIBRARIES})\n\t\tset(LIBEVENT_INCLUDE_DIRS ${LWS_LIBEVENT_INCLUDE_DIRS})\n\t\tset(LIBEVENT_FOUND 1)\n\tendif()\nendif()\n\nif (LWS_WITH_SQLITE3)\n\tif (\u0022${LWS_SQLITE3_LIBRARIES}\u0022 STREQUAL \u0022\u0022 OR \u0022${LWS_SQLITE3_INCLUDE_DIRS}\u0022 STREQUAL \u0022\u0022)\n\telse()\n\t\tset(SQLITE3_LIBRARIES ${LWS_SQLITE3_LIBRARIES})\n\t\tset(SQLITE3_INCLUDE_DIRS ${LWS_SQLITE3_INCLUDE_DIRS})\n\t\tset(SQLITE3_FOUND 1)\n\tendif()\nendif()\n\n\nif (LWS_WITH_LIBEV AND LWS_WITH_LIBEVENT)\n\tmessage(FATAL_ERROR \u0022Sorry libev and libevent conflict with each others' namespace, you can only have one or the other\u0022)\nendif()\n\n# The base dir where the test-apps look for the SSL certs.\nset(LWS_OPENSSL_CLIENT_CERTS ../share CACHE PATH \u0022Server SSL certificate directory\u0022)\nif (WIN32)\n\tset(LWS_OPENSSL_CLIENT_CERTS . CACHE PATH \u0022Client SSL certificate directory\u0022)\n\n\tif (LWS_UNIX_SOCK)\n\t\tset(LWS_UNIX_SOCK OFF)\n\t\tmessage(WARNING \u0022Windows does not support UNIX domain sockets\u0022)\n\tendif()\nelse()\n\tset(LWS_OPENSSL_CLIENT_CERTS /etc/pki/tls/certs/ CACHE PATH \u0022Client SSL certificate directory\u0022)\nendif()\n\n# LWS_OPENSSL_SUPPORT deprecated... use LWS_WITH_TLS\nif (LWS_WITH_SSL OR LWS_WITH_MBEDTLS)\n\tset(LWS_OPENSSL_SUPPORT 1)\n\tset(LWS_WITH_TLS 1)\nendif()\n\nif (LWS_SSL_CLIENT_USE_OS_CA_CERTS)\n\tset(LWS_SSL_CLIENT_USE_OS_CA_CERTS 1)\nendif()\n\nif (LWS_WITHOUT_DAEMONIZE OR WIN32)\n\tset(LWS_NO_DAEMONIZE 1)\nendif()\n\nif (LWS_WITHOUT_SERVER)\n\tset(LWS_WITHOUT_SERVER 1)\nendif()\n\nif (LWS_WITHOUT_CLIENT)\n\tset(LWS_WITHOUT_CLIENT 1)\nendif()\n\nif (LWS_WITH_LIBEV)\n\tset(LWS_WITH_LIBEV 1)\nendif()\n\nif (LWS_WITH_LIBUV)\n\tset(LWS_WITH_LIBUV 1)\nendif()\n\nif (LWS_WITH_LIBEVENT)\n\tset(LWS_WITH_LIBEVENT 1)\nendif()\n\nif (LWS_IPV6)\n\tset(LWS_WITH_IPV6 1)\nendif()\n\nif (LWS_UNIX_SOCK)\n set(LWS_WITH_UNIX_SOCK 1)\nendif()\n\nif (LWS_WITH_HTTP2)\n\tset(LWS_WITH_HTTP2 1)\nendif()\n\nif (\u0022${LWS_MAX_SMP}\u0022 STREQUAL \u0022\u0022)\n\tset(LWS_MAX_SMP 1)\nendif()\n\nset(LWS_WITH_CLIENT 1)\nif (LWS_WITHOUT_CLIENT)\n\tset(LWS_WITH_CLIENT 0)\nendif()\nset(LWS_WITH_SERVER 1)\nif (LWS_WITHOUT_SERVER)\n\tset(LWS_WITH_SERVER 0)\nendif()\n\n# using any abstract protocol enables LWS_WITH_ABSTRACT\n\nif (LWS_WITH_SMTP)\n\tset(LWS_WITH_ABSTRACT 1)\nendif()\n\n\n\nif (MINGW)\n\tset(LWS_MINGW_SUPPORT 1)\n\tset(CMAKE_C_FLAGS \u0022-D__USE_MINGW_ANSI_STDIO ${CMAKE_C_FLAGS}\u0022)\n\tadd_definitions(-DWINVER\u003d0x0601 -D_WIN32_WINNT\u003d0x0601)\nendif()\n\nif (LWS_SSL_SERVER_WITH_ECDH_CERT)\n\tset(LWS_SSL_SERVER_WITH_ECDH_CERT 1)\nendif()\n\ninclude_directories(\u0022${PROJECT_BINARY_DIR}\u0022)\n\ninclude(CheckCSourceCompiles)\n\n# Check for different inline keyword versions.\nforeach(KEYWORD \u0022inline\u0022 \u0022__inline__\u0022 \u0022__inline\u0022)\n\tset(CMAKE_REQUIRED_DEFINITIONS \u0022-DKEYWORD\u003d${KEYWORD}\u0022)\n\tCHECK_C_SOURCE_COMPILES(\n\t\t\u0022\n\t\t#include \u003cstdio.h\u003e\n\t\tstatic KEYWORD void a() {}\n\t\tint main(int argc, char **argv) { a(); return 0; }\n\t\t\u0022 LWS_HAVE_${KEYWORD})\nendforeach()\n\nif (NOT LWS_HAVE_inline)\n\tif (LWS_HAVE___inline__)\n\t\tset(inline __inline__)\n\telseif(LWS_HAVE___inline)\n\t\tset(inline __inline)\n\tendif()\nendif()\n\n# Put the libraries and binaries that get built into directories at the\n# top of the build tree rather than in hard-to-find leaf directories. \nSET(CMAKE_RUNTIME_OUTPUT_DIRECTORY \u0022${PROJECT_BINARY_DIR}/bin\u0022)\nSET(CMAKE_LIBRARY_OUTPUT_DIRECTORY \u0022${PROJECT_BINARY_DIR}/lib\u0022)\nSET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY \u0022${PROJECT_BINARY_DIR}/lib\u0022)\n\nSET(LWS_INSTALL_PATH \u0022${CMAKE_INSTALL_PREFIX}\u0022)\n\n# Put absolute path of dynamic libraries into the object code. Some\n# architectures, notably Mac OS X, need this.\nSET(CMAKE_INSTALL_NAME_DIR \u0022${CMAKE_INSTALL_PREFIX}/${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}\u0022)\n\ninclude(CheckFunctionExists)\ninclude(CheckSymbolExists)\ninclude(CheckIncludeFile)\ninclude(CheckIncludeFiles)\ninclude(CheckLibraryExists)\ninclude(CheckTypeSize)\ninclude(CheckCSourceCompiles)\n\nif (LWS_WITHOUT_BUILTIN_SHA1)\n\tset(LWS_SHA1_USE_OPENSSL_NAME 1)\nendif()\n\nif (HAIKU)\n\tset(CMAKE_REQUIRED_LIBRARIES network)\nendif()\n\nCHECK_C_SOURCE_COMPILES(\n\t\u0022#include \u003cmalloc.h\u003e\n\tint main(int argc, char **argv) { return malloc_trim(0); }\n\t\u0022 LWS_HAVE_MALLOC_TRIM)\nCHECK_C_SOURCE_COMPILES(\n\t\u0022#include \u003cmalloc.h\u003e\n\tint main(int argc, char **argv) { return (int)malloc_usable_size((void *)0); }\n\t\u0022 LWS_HAVE_MALLOC_USABLE_SIZE)\n\nCHECK_FUNCTION_EXISTS(fork LWS_HAVE_FORK)\nCHECK_FUNCTION_EXISTS(getenv LWS_HAVE_GETENV)\nCHECK_FUNCTION_EXISTS(malloc LWS_HAVE_MALLOC)\nCHECK_FUNCTION_EXISTS(memset LWS_HAVE_MEMSET)\nCHECK_FUNCTION_EXISTS(realloc LWS_HAVE_REALLOC)\nCHECK_FUNCTION_EXISTS(socket LWS_HAVE_SOCKET)\nCHECK_FUNCTION_EXISTS(strerror LWS_HAVE_STRERROR)\nCHECK_FUNCTION_EXISTS(vfork LWS_HAVE_VFORK)\nCHECK_FUNCTION_EXISTS(execvpe LWS_HAVE_EXECVPE)\nCHECK_FUNCTION_EXISTS(getifaddrs LWS_HAVE_GETIFADDRS)\nCHECK_FUNCTION_EXISTS(snprintf LWS_HAVE_SNPRINTF)\nCHECK_FUNCTION_EXISTS(_snprintf LWS_HAVE__SNPRINTF)\nCHECK_FUNCTION_EXISTS(_vsnprintf LWS_HAVE__VSNPRINTF)\nCHECK_FUNCTION_EXISTS(getloadavg LWS_HAVE_GETLOADAVG)\nCHECK_FUNCTION_EXISTS(atoll LWS_HAVE_ATOLL)\nCHECK_FUNCTION_EXISTS(_atoi64 LWS_HAVE__ATOI64)\nCHECK_FUNCTION_EXISTS(_stat32i64 LWS_HAVE__STAT32I64)\nCHECK_FUNCTION_EXISTS(clock_gettime LWS_HAVE_CLOCK_GETTIME)\n\nif (NOT LWS_HAVE_GETIFADDRS)\n\tif (LWS_WITHOUT_BUILTIN_GETIFADDRS)\n\t\tmessage(FATAL_ERROR \u0022No getifaddrs was found on the system. Turn off the LWS_WITHOUT_BUILTIN_GETIFADDRS compile option to use the supplied BSD version.\u0022)\n\tendif()\n\tset(LWS_BUILTIN_GETIFADDRS 1)\nendif()\n\nCHECK_INCLUDE_FILE(dlfcn.h LWS_HAVE_DLFCN_H)\nCHECK_INCLUDE_FILE(fcntl.h LWS_HAVE_FCNTL_H)\nCHECK_INCLUDE_FILE(in6addr.h LWS_HAVE_IN6ADDR_H)\nCHECK_INCLUDE_FILE(memory.h LWS_HAVE_MEMORY_H)\nCHECK_INCLUDE_FILE(netinet/in.h LWS_HAVE_NETINET_IN_H)\nCHECK_INCLUDE_FILE(stdint.h LWS_HAVE_STDINT_H)\nCHECK_INCLUDE_FILE(stdlib.h LWS_HAVE_STDLIB_H)\nCHECK_INCLUDE_FILE(strings.h LWS_HAVE_STRINGS_H)\nCHECK_INCLUDE_FILE(string.h LWS_HAVE_STRING_H)\nCHECK_INCLUDE_FILE(sys/prctl.h LWS_HAVE_SYS_PRCTL_H)\nCHECK_INCLUDE_FILE(sys/socket.h LWS_HAVE_SYS_SOCKET_H)\nCHECK_INCLUDE_FILE(sys/sockio.h LWS_HAVE_SYS_SOCKIO_H)\nCHECK_INCLUDE_FILE(sys/stat.h LWS_HAVE_SYS_STAT_H)\nCHECK_INCLUDE_FILE(sys/types.h LWS_HAVE_SYS_TYPES_H)\nCHECK_INCLUDE_FILE(unistd.h LWS_HAVE_UNISTD_H)\nCHECK_INCLUDE_FILE(vfork.h LWS_HAVE_VFORK_H)\nCHECK_INCLUDE_FILE(sys/capability.h LWS_HAVE_SYS_CAPABILITY_H)\nCHECK_INCLUDE_FILE(malloc.h LWS_HAVE_MALLOC_H)\nCHECK_INCLUDE_FILE(pthread.h LWS_HAVE_PTHREAD_H)\nCHECK_INCLUDE_FILE(inttypes.h LWS_HAVE_INTTYPES_H)\n\nCHECK_LIBRARY_EXISTS(cap cap_set_flag \u0022\u0022 LWS_HAVE_LIBCAP)\n\nif (LWS_ROLE_DBUS)\n\n\tif (NOT LWS_DBUS_LIB)\n\t\tset(LWS_DBUS_LIB \u0022dbus-1\u0022)\n\tendif()\n\n\tCHECK_LIBRARY_EXISTS(${LWS_DBUS_LIB} dbus_connection_set_watch_functions \u0022\u0022 LWS_HAVE_LIBDBUS)\n\tif (NOT LWS_HAVE_LIBDBUS)\n\t\tmessage(FATAL_ERROR \u0022Install dbus-devel, or libdbus-1-dev etc\u0022)\n\tendif()\n\n\tif (NOT LWS_DBUS_INCLUDE1)\n\t\t# look in fedora and debian / ubuntu place\n\t\tif (EXISTS \u0022/usr/include/dbus-1.0\u0022)\n\t\t\tset(LWS_DBUS_INCLUDE1 \u0022/usr/include/dbus-1.0\u0022)\n\t\telse()\n\t\t\tmessage(FATAL_ERROR \u0022Set LWS_DBUS_INCLUDE1 to /usr/include/dbus-1.0 or wherever the main dbus includes are\u0022)\n\t\tendif()\n\tendif()\n\n\tif (NOT LWS_DBUS_INCLUDE2)\n\t\t# look in fedora... debian / ubuntu has the ARCH in the path...\n\t\tif (EXISTS \u0022/usr/lib64/dbus-1.0/include\u0022)\n\t\t\tset(LWS_DBUS_INCLUDE2 \u0022/usr/lib64/dbus-1.0/include\u0022)\n\t\telse()\n\t\t\tmessage(FATAL_ERROR \u0022Set LWS_DBUS_INCLUDE2 to /usr/lib/ARCH-linux-gnu/dbus-1.0/include or wherever dbus-arch-deps.h is on your system\u0022)\n\t\tendif()\n\tendif()\n\n\tset(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${LWS_DBUS_INCLUDE1};${LWS_DBUS_INCLUDE2})\n\n\tCHECK_C_SOURCE_COMPILES(\u0022#include \u003cdbus/dbus.h\u003e\n\tint main(void) {\n\t\treturn 0;\n\t}\u0022 LWS_DBUS_CHECK_OK)\nendif()\n\nif (LWS_WITH_LIBUV)\nCHECK_INCLUDE_FILE(uv-version.h LWS_HAVE_UV_VERSION_H)\n # libuv changed the location in 1.21.0. Retain both\n # checks temporarily to ensure a smooth transition.\n if (NOT LWS_HAVE_UV_VERSION_H)\n CHECK_INCLUDE_FILE(uv/version.h LWS_HAVE_NEW_UV_VERSION_H)\n endif()\nendif()\n\n\nif (LWS_WITH_ZLIB AND NOT LWS_WITH_BUNDLED_ZLIB)\n\tif (LWS_WITH_MINIZ)\n\t\tCHECK_INCLUDE_FILE(miniz.h LWS_HAVE_ZLIB_H)\n\telse()\n\t\tCHECK_INCLUDE_FILE(zlib.h LWS_HAVE_ZLIB_H)\n\tendif()\nendif()\n\n# TODO: These can also be tested to see whether they actually work...\nset(LWS_HAVE_WORKING_FORK LWS_HAVE_FORK)\nset(LWS_HAVE_WORKING_VFORK LWS_HAVE_VFORK)\n\nCHECK_INCLUDE_FILES(\u0022stdlib.h;stdarg.h;string.h;float.h\u0022 STDC_HEADERS)\n\nCHECK_C_SOURCE_COMPILES(\u0022#include \u003cstdint.h\u003e \n\tint main(void) {\n\t\tintptr_t test \u003d 1;\n\t\treturn 0;\n\t}\u0022 LWS_HAS_INTPTR_T)\n\nset(CMAKE_REQUIRED_FLAGS \u0022-pthread\u0022)\t\nCHECK_C_SOURCE_COMPILES(\u0022#define _GNU_SOURCE \n\t#include \u003cpthread.h\u003e \n\tint main(void) { \n\t\tpthread_t th \u003d 0;\n\t\tpthread_setname_np(th, NULL);\n\t\treturn 0;\n\t}\u0022 LWS_HAS_PTHREAD_SETNAME_NP)\n\nCHECK_C_SOURCE_COMPILES(\u0022#include \u003cstddef.h\u003e\n\t#include \u003cgetopt.h\u003e \n\tint main(void) { \n\t\tvoid *p \u003d (void *)getopt_long;\n\t\treturn p !\u003d NULL;\n\t}\u0022 LWS_HAS_GETOPT_LONG)\n\n\nif (NOT PID_T_SIZE)\n\tset(pid_t int)\nendif()\n\nif (NOT SIZE_T_SIZE)\n\tset(size_t \u0022unsigned int\u0022)\nendif()\n\nif (NOT LWS_HAVE_MALLOC)\n\tset(malloc rpl_malloc)\nendif()\n\nif (NOT LWS_HAVE_REALLOC)\n\tset(realloc rpl_realloc)\nendif()\n\nif (UNIX)\n\texecute_process( COMMAND grep -c illumos /lib/ld.so.1 \n\t\t\t OUTPUT_VARIABLE ILLUMOS ERROR_QUIET )\n\t# Chomp the \u005cn at end of output.\n\tstring(REGEX REPLACE \u0022[\u005cn]+\u0022 \u0022\u0022 ILLUMOS \u0022${ILLUMOS}\u0022)\n\t\n\tif(NOT ${ILLUMOS} MATCHES \u00220\u0022)\n\t\tadd_definitions( \u0022-D__illumos__\u0022 )\n\t\tset(ILLUMOS 1)\n\tendif()\nendif()\n\nif (MSVC)\n\t# Turn off stupid microsoft security warnings.\n\tadd_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)\nendif(MSVC)\n\ninclude_directories(\u0022${PROJECT_SOURCE_DIR}/lib\u0022)\n\n# Group headers and sources.\n# Some IDEs use this for nicer file structure.\nset(HDR_PRIVATE\n\tlib/core/private-lib-core.h)\n\nset(HDR_PUBLIC\n\t\u0022${PROJECT_SOURCE_DIR}/include/libwebsockets.h\u0022\n\t\u0022${PROJECT_BINARY_DIR}/lws_config.h\u0022\n\t\u0022${PROJECT_SOURCE_DIR}/plugins/ssh-base/include/lws-plugin-ssh.h\u0022\n\t)\n\nset(SOURCES\n\tlib/core/alloc.c\n\tlib/core/buflist.c\n\tlib/core/context.c\n\tlib/core/lws_dll2.c\n\tlib/core/libwebsockets.c\n\tlib/core/logs.c\n\tlib/system/system.c\n\tlib/misc/base64-decode.c\n\tlib/misc/lws-ring.c\n)\n\nif (LWS_WITH_FILE_OPS)\n\tlist(APPEND SOURCES lib/core/vfs.c)\nendif()\n\nif (LWS_WITH_DEPRECATED_LWS_DLL)\n\tlist(APPEND SOURCES\n\t\tlib/core/lws_dll.c)\nendif()\n\t\nif (LWS_WITH_NETWORK)\n\tlist(APPEND SOURCES\n\t\tlib/core-net/dummy-callback.c\n\t\tlib/core-net/output.c\n\t\tlib/core-net/close.c\n\t\tlib/core-net/network.c\n\t\tlib/core-net/vhost.c\n\t\tlib/core-net/pollfd.c\n\t\tlib/core-net/service.c\n\t\tlib/core-net/sorted-usec-list.c\n\t\tlib/core-net/state.c\n\t\tlib/core-net/stats.c\n\t\tlib/core-net/wsi.c\n\t\tlib/core-net/wsi-timeout.c\n\t\tlib/core-net/adopt.c\n\t\tlib/roles/pipe/ops-pipe.c\n\t)\n\n\tif (LWS_WITH_SYS_ASYNC_DNS)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/system/async-dns/async-dns.c\n\t\t\tlib/system/async-dns/async-dns-parse.c)\n\tendif()\n\n\tif (LWS_WITH_SYS_NTPCLIENT)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/system/ntpclient/ntpclient.c)\n\tendif()\n\n\tif (LWS_WITH_SYS_DHCP_CLIENT)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/system/dhcpclient/dhcpclient.c)\n\tendif()\n\n\n\tif (LWS_WITH_DETAILED_LATENCY)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/core-net/detailed-latency.c)\n\tendif()\n\n\tif (LWS_WITH_LWS_DSH)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/core-net/lws-dsh.c)\n\tendif()\n\n\tif (LWS_WITH_SEQUENCER)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/core-net/sequencer.c)\n\tendif()\n\n\tif (LWS_WITH_ABSTRACT)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/abstract/abstract.c\n\t\t)\n\t\tif (LWS_WITH_SEQUENCER)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/abstract/test-sequencer.c)\n\t\tendif()\n\tendif()\n\n\tif (LWS_WITH_STATS)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/core-net/stats.c\n\t\t)\n\tendif()\nendif()\n\nif (LWS_WITH_DIR)\n\tlist(APPEND SOURCES lib/misc/dir.c)\nendif()\n\t\nif (LWS_WITH_THREADPOOL AND UNIX AND LWS_HAVE_PTHREAD_H)\n\tlist(APPEND SOURCES lib/misc/threadpool/threadpool.c)\nendif()\n\nif (LWS_ROLE_H1 OR LWS_ROLE_H2)\n\tlist(APPEND SOURCES\n\t\tlib/roles/http/header.c\n\t\tlib/roles/http/parsers.c)\n\tif (LWS_WITH_HTTP_STREAM_COMPRESSION)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/roles/http/compression/stream.c\n\t\t\tlib/roles/http/compression/deflate/deflate.c)\n\t\tif (LWS_WITH_HTTP_BROTLI)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/roles/http/compression/brotli/brotli.c)\n\t\tendif()\n\tendif()\nendif()\n\nif (LWS_ROLE_H1)\n\tlist(APPEND SOURCES\n\t\tlib/roles/h1/ops-h1.c)\nendif()\n\nif (LWS_ROLE_WS)\n\tlist(APPEND SOURCES\n\t\tlib/roles/ws/ops-ws.c)\n\tif (NOT LWS_WITHOUT_CLIENT)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/roles/ws/client-ws.c\n\t\t\tlib/roles/ws/client-parser-ws.c)\n\tendif()\n\tif (NOT LWS_WITHOUT_SERVER)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/roles/ws/server-ws.c)\n\tendif()\nendif()\n\nif (LWS_ROLE_RAW)\n\tlist(APPEND SOURCES\n\t\tlib/roles/raw-skt/ops-raw-skt.c\n\t\tlib/roles/raw-file/ops-raw-file.c)\n\t\t\n\tif (LWS_WITH_ABSTRACT)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/abstract/transports/raw-skt.c)\n\tendif()\nendif()\n\nif (LWS_ROLE_RAW_PROXY)\n\tlist(APPEND SOURCES\n\t\tlib/roles/raw-proxy/ops-raw-proxy.c)\nendif()\n\nif (LWS_ROLE_CGI)\n\tlist(APPEND SOURCES\n\t\tlib/roles/cgi/cgi-server.c\n\t\tlib/roles/cgi/ops-cgi.c)\nendif()\n\nif (LWS_ROLE_DBUS)\n\tlist(APPEND SOURCES\n\t\tlib/roles/dbus/dbus.c)\nendif()\n\nif (LWS_WITH_ACCESS_LOG)\n\tlist(APPEND SOURCES\n\t\tlib/roles/http/server/access-log.c)\nendif()\n\nif (LWS_WITH_PEER_LIMITS)\n\tlist(APPEND SOURCES\n\t\tlib/misc/peer-limits.c)\nendif()\n\nif (LWS_WITH_LWSAC)\n\tlist(APPEND SOURCES\n\t\tlib/misc/lwsac/lwsac.c\n\t\tlib/misc/lwsac/cached-file.c)\nendif()\n\nif (LWS_WITH_FTS)\n\tlist(APPEND SOURCES\n\t\tlib/misc/fts/trie.c\n\t\tlib/misc/fts/trie-fd.c)\nendif()\n\nif (LWS_WITH_DISKCACHE)\n\tlist(APPEND SOURCES\n\t\tlib/misc/diskcache.c)\nendif()\n\nif (LWS_WITH_STRUCT_JSON)\n\tlist(APPEND SOURCES\n\t\tlib/misc/lws-struct-lejp.c)\nendif()\n\nif (LWS_WITH_STRUCT_SQLITE3)\n\tlist(APPEND SOURCES\n\t\tlib/misc/lws-struct-sqlite.c)\nendif()\n\nif (NOT LWS_WITHOUT_CLIENT)\n\tlist(APPEND SOURCES\n\t\tlib/core-net/connect.c\n\t\tlib/core-net/client.c\n\t\tlib/roles/http/client/client-http.c\n\t\tlib/roles/http/client/client-handshake.c)\nendif()\n\nif (NOT LWS_WITHOUT_SERVER)\n\tlist(APPEND SOURCES\n\t\tlib/core-net/server.c\n\t\tlib/roles/listen/ops-listen.c)\nendif()\n\nif (LWS_WITH_MBEDTLS)\n \tset(LWS_WITH_SSL ON)\n \t\n\tinclude_directories(lib/tls/mbedtls/wrapper/include)\n\tinclude_directories(lib/tls/mbedtls/wrapper/include/platform)\n\tinclude_directories(lib/tls/mbedtls/wrapper/include/internal)\n\tinclude_directories(lib/tls/mbedtls/wrapper/include/openssl)\n \t\n \tif (LWS_WITH_NETWORK)\n\t\tlist(APPEND HDR_PRIVATE\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/ssl3.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/ssl_cert.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/ssl_code.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/ssl_dbg.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/ssl_lib.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/ssl_methods.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/ssl_pkey.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/ssl_stack.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/ssl_types.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/ssl_x509.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/tls1.h\n\t\t\tlib/tls/mbedtls/wrapper/include/internal/x509_vfy.h)\n\t\n\t\tlist(APPEND HDR_PRIVATE\n\t\t\tlib/tls/mbedtls/wrapper/include/openssl/ssl.h)\n\t\n\t\tlist(APPEND HDR_PRIVATE\n\t\t\tlib/tls/mbedtls/wrapper/include/platform/ssl_pm.h\n\t\t\tlib/tls/mbedtls/wrapper/include/platform/ssl_port.h)\n\t\n\t\tlist(APPEND SOURCES\n\t\t\tlib/tls/mbedtls/wrapper/library/ssl_cert.c\n\t\t\tlib/tls/mbedtls/wrapper/library/ssl_lib.c\n\t\t\tlib/tls/mbedtls/wrapper/library/ssl_methods.c\n\t\t\tlib/tls/mbedtls/wrapper/library/ssl_pkey.c\n\t\t\tlib/tls/mbedtls/wrapper/library/ssl_stack.c\n\t\t\tlib/tls/mbedtls/wrapper/library/ssl_x509.c)\n\t\n\t\tlist(APPEND SOURCES\n\t\t\tlib/tls/mbedtls/wrapper/platform/ssl_pm.c\n\t\t\tlib/tls/mbedtls/wrapper/platform/ssl_port.c)\n\tendif()\nendif()\n\nif (LWS_WITH_SSL)\n\tlist(APPEND SOURCES\n\t\tlib/tls/tls.c\n\t)\n\tif (LWS_WITH_NETWORK)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/tls/tls-network.c\n\t\t)\n\tendif()\n\t\t\n\tif (LWS_WITH_MBEDTLS)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/tls/mbedtls/mbedtls-tls.c\n\t\t\tlib/tls/mbedtls/mbedtls-x509.c\n\t\t)\n\t\tif (LWS_WITH_NETWORK)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/tls/mbedtls/mbedtls-ssl.c\n\t\t\t)\n\t\tendif()\n\t\tif (LWS_WITH_GENCRYPTO)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/tls/mbedtls/lws-genhash.c\n\t\t\t\tlib/tls/mbedtls/lws-genrsa.c\n\t\t\t\tlib/tls/mbedtls/lws-genaes.c\n\t\t\t\tlib/tls/lws-genec-common.c\n\t\t\t\tlib/tls/mbedtls/lws-genec.c\n\t\t\t\tlib/tls/mbedtls/lws-gencrypto.c\n\t\t\t)\n\t\tendif()\n\telse()\n\t\tlist(APPEND SOURCES\n\t\t\tlib/tls/openssl/openssl-tls.c\n\t\t\tlib/tls/openssl/openssl-x509.c\n\t\t)\n\t\tif (LWS_WITH_NETWORK)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/tls/openssl/openssl-ssl.c\n\t\t\t)\n\t\tendif()\n\t\tif (LWS_WITH_GENCRYPTO)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/tls/openssl/lws-genhash.c\n\t\t\t\tlib/tls/openssl/lws-genrsa.c\n\t\t\t\tlib/tls/openssl/lws-genaes.c\n\t\t\t\tlib/tls/lws-genec-common.c\n\t\t\t\tlib/tls/openssl/lws-genec.c\n\t\t\t\tlib/tls/openssl/lws-gencrypto.c\n\t\t\t)\n\t\tendif()\n\tendif()\n\t\t\n\tif (NOT LWS_WITHOUT_SERVER)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/tls/tls-server.c)\n\t\tif (LWS_WITH_MBEDTLS)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/tls/mbedtls/mbedtls-server.c)\n\t\telse()\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/tls/openssl/openssl-server.c)\n\t\tendif()\n\tendif()\n\tif (NOT LWS_WITHOUT_CLIENT)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/tls/tls-client.c)\n\t\tif (LWS_WITH_MBEDTLS)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/tls/mbedtls/mbedtls-client.c)\n\t\telse()\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/tls/openssl/openssl-client.c)\n\t\tendif()\n\t\t\n\tendif()\nendif()\n\nif (NOT LWS_WITHOUT_BUILTIN_SHA1)\n\tlist(APPEND SOURCES\n\t\tlib/misc/sha-1.c)\nendif()\n\nif (LWS_WITH_HTTP2 AND NOT LWS_WITHOUT_SERVER)\n\tlist(APPEND SOURCES\n\t\tlib/roles/h2/http2.c\n\t\tlib/roles/h2/hpack.c\n\t\tlib/roles/h2/ops-h2.c)\nendif()\n# select the active platform files\n\nif (WIN32)\n\tlist(APPEND SOURCES\n\t\tlib/plat/windows/windows-fds.c\n\t\tlib/plat/windows/windows-file.c\n\t\tlib/plat/windows/windows-init.c\n\t\tlib/plat/windows/windows-misc.c\n\t\tlib/plat/windows/windows-pipe.c\n\t\tlib/plat/windows/windows-plugins.c\n\t\tlib/plat/windows/windows-service.c\n\t\tlib/plat/windows/windows-sockets.c\n\t\t)\nelse()\n\n\tif (LWS_PLAT_OPTEE)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/plat/optee/lws-plat-optee.c\n\t\t)\n\t\tif (LWS_WITH_NETWORK)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/plat/optee/network.c\n\t\t\t)\n\t\tendif()\n\telse()\n\t\tif (LWS_PLAT_FREERTOS)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/plat/freertos/freertos-fds.c\n\t\t\t\tlib/plat/freertos/freertos-init.c\n\t\t\t\tlib/plat/freertos/freertos-misc.c\n\t\t\t\tlib/plat/freertos/freertos-pipe.c\n\t\t\t\tlib/plat/freertos/freertos-service.c\n\t\t\t\tlib/plat/freertos/freertos-sockets.c\n\t\t\t\tlib/plat/freertos/freertos-resolv.c\n\t\t\t\tlib/misc/romfs.c)\n\t\t\tif (LWS_WITH_ESP32_HELPER)\n\t\t\t\tlist(APPEND SOURCES lib/plat/freertos/esp32/esp32-helpers.c)\n\t\t\tendif()\n\t\t\tif (LWS_WITH_FILE_OPS)\n\t\t\t\tlist(APPEND SOURCES lib/plat/freertos/freertos-file.c)\n\t\t\tendif()\n\t\telse()\n\t\t\tset(LWS_PLAT_UNIX 1)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\tlib/plat/unix/unix-caps.c\n\t\t\t\tlib/plat/unix/unix-misc.c\n\t\t\t\tlib/plat/unix/unix-init.c\n\t\t\t)\n\t\t\tif (LWS_WITH_FILE_OPS)\n\t\t\t\tlist(APPEND SOURCES lib/plat/unix/unix-file.c)\n\t\t\tendif()\n\t\t\tif (LWS_WITH_NETWORK)\n\t\t\t\tlist(APPEND SOURCES\n\t\t\t\t\tlib/plat/unix/unix-pipe.c\n\t\t\t\t\tlib/plat/unix/unix-service.c\n\t\t\t\t\tlib/plat/unix/unix-sockets.c\n\t\t\t\t\tlib/plat/unix/unix-fds.c\n\t\t\t\t)\n\t\t\t\tif (LWS_WITH_SYS_ASYNC_DNS)\n\t\t\t\t\tif (LWS_PLAT_ANDROID)\n\t\t\t\t\t\tlist(APPEND SOURCES lib/plat/unix/android/android-resolv.c)\n\t\t\t\t\telse()\n\t\t\t\t\t\tlist(APPEND SOURCES lib/plat/unix/unix-resolv.c)\n\t\t\t\t\tendif()\n\t\t\t\tendif()\n\t\t\tendif()\n\t\t\t\t\n\t\t\tif (LWS_WITH_PLUGINS AND LWS_WITH_LIBUV)\n\t\t\t\tlist(APPEND SOURCES lib/plat/unix/unix-plugins.c)\n\t\t\tendif()\n\t\tendif()\n\tendif()\nendif()\n\nif ((LWS_ROLE_H1 OR LWS_ROLE_H2) AND NOT LWS_WITHOUT_SERVER)\n\tlist(APPEND SOURCES\n\t\tlib/roles/http/server/server.c\n\t\tlib/roles/http/server/lws-spa.c)\nendif()\n\nif (LWS_ROLE_WS AND NOT LWS_WITHOUT_EXTENSIONS)\n\tlist(APPEND HDR_PRIVATE\n\t\tlib/roles/ws/ext/extension-permessage-deflate.h)\n\tlist(APPEND SOURCES\n\t\tlib/roles/ws/ext/extension.c\n\t\tlib/roles/ws/ext/extension-permessage-deflate.c)\nendif()\n\nif (LWS_WITH_HTTP_PROXY)\n\tlist(APPEND SOURCES\n\t\tlib/roles/http/server/rewrite.c)\nendif()\n\nif (LWS_WITH_POLL AND LWS_WITH_NETWORK)\n\tlist(APPEND SOURCES\n\t\tlib/event-libs/poll/poll.c)\nendif()\n\nif (LWS_WITH_LIBUV AND LWS_WITH_NETWORK)\n\tlist(APPEND SOURCES\n\t\tlib/event-libs/libuv/libuv.c)\nendif()\n\nif (LWS_WITH_LIBEVENT AND LWS_WITH_NETWORK)\n\tlist(APPEND SOURCES\n\t\tlib/event-libs/libevent/libevent.c)\nendif()\n\nif (LWS_WITH_LIBEV AND LWS_WITH_NETWORK)\n\tlist(APPEND SOURCES\n\t\tlib/event-libs/libev/libev.c)\n\t# libev generates a big mess of warnings with gcc, maintainer claims gcc to blame\n\tset_source_files_properties( lib/event-libs/libev/libev.c PROPERTIES COMPILE_FLAGS \u0022-Wno-error\u0022 )\nendif()\n\nif (LWS_WITH_LEJP)\n\tlist(APPEND SOURCES\n\t\tlib/misc/lejp.c)\nendif()\t\nif (LWS_WITH_LEJP_CONF AND LWS_WITH_NETWORK AND NOT LWS_PLAT_OPTEE)\n\t\tlist(APPEND SOURCES\n\t\t\t\u0022lib/roles/http/server/lejp-conf.c\u0022\n\t\t)\nendif()\n\nif (LWS_WITH_ABSTRACT)\n\tlist(APPEND SOURCES\n\t\tlib/abstract/transports/unit-test.c)\nendif()\n\nif (LWS_WITH_SMTP)\n\tlist(APPEND SOURCES\n\t\tlib/abstract/protocols/smtp/smtp.c\n\t\tlib/abstract/protocols/smtp/smtp-sequencer.c\n\t\t)\nendif()\n\nif (LWS_WITH_RANGES)\n\tlist(APPEND SOURCES\n\t\tlib/roles/http/server/ranges.c)\nendif()\n\nif (LWS_WITH_ZIP_FOPS)\n if (LWS_WITH_ZLIB)\n list(APPEND SOURCES\n lib/roles/http/server/fops-zip.c)\n else()\n message(FATAL_ERROR \u0022Pre-zipped file support (LWS_WITH_ZIP_FOPS) requires ZLIB (LWS_WITH_ZLIB)\u0022)\n endif()\nendif()\n\nif (LWS_WITH_JOSE)\n\tlist(APPEND SOURCES\n\t\tlib/jose/jwk/jwk.c\n\t\tlib/jose/jws/jose.c\n\t\tlib/jose/jws/jws.c\n\t\tlib/jose/jwe/jwe.c\n\t\tlib/jose/jwe/enc/aescbc.c\n\t\tlib/jose/jwe/enc/aesgcm.c\n\t\tlib/jose/jwe/enc/aeskw.c\n\t\tlib/jose/jwe/jwe-rsa-aescbc.c\n\t\tlib/jose/jwe/jwe-rsa-aesgcm.c\n\t\tlib/jose/jwe/jwe-ecdh-es-aeskw.c\n\t\t)\nendif()\n\nif (LWS_WITH_JOSE OR LWS_WITH_GENCRYPTO)\n\tlist(APPEND SOURCES\n\t\tlib/tls/lws-gencrypto-common.c)\nendif()\n\n# Add helper files for Windows.\nif (WIN32)\n\tset(WIN32_HELPERS_PATH win32port/win32helpers)\n\tinclude_directories(${WIN32_HELPERS_PATH})\n\n\t\tif (WIN32)\n\t\t\tlist(APPEND SOURCES\n\t\t\t\t${WIN32_HELPERS_PATH}/gettimeofday.c\n\t\t\t)\n\n\t\t\tlist(APPEND HDR_PRIVATE\n\t\t\t\t${WIN32_HELPERS_PATH}/gettimeofday.h\n\t\t\t)\n\t\tendif(WIN32)\n\nelse()\n\t# Unix.\n\tif (NOT LWS_WITHOUT_DAEMONIZE)\n\t\tlist(APPEND SOURCES\n\t\t\tlib/misc/daemonize.c)\n\tendif()\nendif()\n\nif (UNIX)\n\tif (NOT LWS_HAVE_GETIFADDRS)\n\t\tlist(APPEND HDR_PRIVATE lib/misc/getifaddrs.h)\n\t\tlist(APPEND SOURCES lib/misc/getifaddrs.c)\n\tendif()\nendif()\n\nif ((CMAKE_C_COMPILER_ID MATCHES \u0022Clang\u0022) OR (CMAKE_CXX_COMPILER_ID MATCHES \u0022Clang\u0022))\n\tset(COMPILER_IS_CLANG ON)\nendif()\n\nif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)\n include (CheckCCompilerFlag)\n CHECK_C_COMPILER_FLAG(-fvisibility\u003dhidden LWS_HAVE_VISIBILITY)\n if (LWS_HAVE_VISIBILITY)\n set(VISIBILITY_FLAG -fvisibility\u003dhidden)\n endif()\n if (LWS_WITH_GCOV)\n\t set (GCOV_FLAGS \u0022-fprofile-arcs -ftest-coverage \u0022)\n endif()\n\n\tif (LWS_WITH_ASAN)\n\t\tset (ASAN_FLAGS \u0022-fsanitize\u003daddress -fsanitize\u003dundefined -fsanitize-address-use-after-scope -fsanitize-undefined-trap-on-error\u0022)\n\t\tif (NOT COMPILER_IS_CLANG)\n\t\t\tset (ASAN_FLAGS \u0022${ASAN_FLAGS} -fsanitize\u003dpointer-compare -fsanitize\u003dpointer-subtract -fsanitize\u003dleak\u0022)\n\t\tendif()\n\t\tmessage(\u0022Enabling ASAN\u0022)\n\tendif()\n\n\tcheck_c_compiler_flag(\u0022-Wignored-qualifiers\u0022 LWS_GCC_HAS_IGNORED_QUALIFIERS)\n\tcheck_c_compiler_flag(\u0022-Wtype-limits\u0022 LWS_GCC_HAS_TYPE_LIMITS)\n\n\tif (LWS_GCC_HAS_IGNORED_QUALIFIERS)\n\t\tset(CMAKE_C_FLAGS \u0022-Wignored-qualifiers ${CMAKE_C_FLAGS}\u0022 )\n\tendif()\n\n\tif (LWS_GCC_HAS_TYPE_LIMITS)\n\t\tset(CMAKE_C_FLAGS \u0022-Wtype-limits ${CMAKE_C_FLAGS}\u0022 )\n\tendif()\n\n if (UNIX AND NOT LWS_PLAT_FREERTOS)\n\t set(CMAKE_C_FLAGS \u0022-Wall -Wsign-compare -Wuninitialized -Werror ${VISIBILITY_FLAG} -Wundef ${GCOV_FLAGS} ${CMAKE_C_FLAGS} ${ASAN_FLAGS}\u0022 )\n else()\n\t set(CMAKE_C_FLAGS \u0022-Wall -Wsign-compare -Wuninitialized -Werror ${VISIBILITY_FLAG} ${GCOV_FLAGS} ${CMAKE_C_FLAGS}\u0022 )\n endif()\nendif ()\n\nif (LWS_PLAT_OPTEE)\n\tset(CMAKE_C_FLAGS \u0022${CMAKE_C_FLAGS} --sysroot ../../../../lib/libutils/isoc/include -I../../../../lib/libutils/isoc/include -I../../../../lib/libutils/ext/include\u0022 )\nendif()\n\nif ((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND NOT LWS_WITHOUT_TESTAPPS)\n\tif (UNIX AND LWS_HAVE_PTHREAD_H)\n\t# jeez clang understands -pthread but dies if he sees it at link time!\n\t# http://stackoverflow.com/questions/2391194/what-is-gs-pthread-equiv-in-clang\n\tset(CMAKE_C_FLAGS \u0022${CMAKE_C_FLAGS} -pthread\u0022 )\n endif()\nendif()\n\nif (COMPILER_IS_CLANG)\n\n\t# otherwise osx blows a bunch of openssl deprecated api errors\n\tset(CMAKE_C_FLAGS \u0022${CMAKE_C_FLAGS} -Wno-deprecated-declarations\u0022 )\n\tif (UNIX AND LWS_HAVE_PTHREAD_H)\n\t\tset(CMAKE_C_FLAGS \u0022${CMAKE_C_FLAGS} -pthread\u0022 )\n\tendif()\nendif()\n\nsource_group(\u0022Headers Private\u0022 FILES ${HDR_PRIVATE})\nsource_group(\u0022Headers Public\u0022 FILES ${HDR_PUBLIC})\nsource_group(\u0022Sources\u0022 FILES ${SOURCES})\nsource_group(\u0022Resources\u0022 FILES ${RESOURCES})\n\n#\n# Create the lib.\n#\nset(LWS_LIBRARIES)\n\nif (LWS_WITH_STATIC)\n if (LWS_STATIC_PIC)\n set(CMAKE_POSITION_INDEPENDENT_CODE ON)\n endif()\n\tadd_library(websockets STATIC\n\t\t\t\t${HDR_PRIVATE}\n\t\t\t\t${HDR_PUBLIC}\n\t\t\t\t${SOURCES})\n\tlist(APPEND LWS_LIBRARIES websockets)\n\n\tif (WIN32)\n\t\t# Windows uses the same .lib ending for static libraries and shared\n\t\t# library linker files, so rename the static library.\n\t\tset_target_properties(websockets\n\t\t\tPROPERTIES\n\t\t\tOUTPUT_NAME websockets_static)\n\tendif()\n\tadd_custom_command(\n\t\t TARGET websockets\n\t\t COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets.h\n\t\t \t\t\t\t\t ${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets.h\n\t)\n\n\tadd_custom_command(\n\t\t TARGET websockets\n\t\t COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets/\n\t\t\t\t\t\t\t\t\t${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets\n\t)\n\n\tadd_custom_command(\n\t\t TARGET websockets\n\t\t COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/lws_config.h\n\t\t \t\t\t\t\t ${CMAKE_CURRENT_BINARY_DIR}/include/lws_config.h\n\t)\n\nendif()\n\nif (LWS_WITH_SHARED)\n\tadd_library(websockets_shared SHARED\n\t\t\t\t${HDR_PRIVATE}\n\t\t\t\t${HDR_PUBLIC}\n\t\t\t\t${SOURCES}\n\t\t\t\t${RESOURCES})\n\tlist(APPEND LWS_LIBRARIES websockets_shared)\n\n\t# We want the shared lib to be named \u0022libwebsockets\u0022\n\t# not \u0022libwebsocket_shared\u0022.\n\tset_target_properties(websockets_shared\n\t\tPROPERTIES\n\t\tOUTPUT_NAME websockets)\n\n\tif (WIN32)\n\t\t# Compile as DLL (export function declarations)\n\t\tset_property(\n\t\t\tTARGET websockets_shared\n\t\t\tPROPERTY COMPILE_DEFINITIONS\n\t\t\tLWS_DLL\n\t\t\tLWS_INTERNAL)\n\tendif()\n\n\tif (APPLE)\n\t\tset_property(TARGET websockets_shared PROPERTY MACOSX_RPATH YES)\n\tendif()\n\n\tadd_custom_command(\n\t\t TARGET websockets_shared\n\t\t COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets.h\n\t\t \t\t\t\t\t ${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets.h\n\t)\n\n\tadd_custom_command(\n\t\t TARGET websockets\n\t\t COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/libwebsockets\n\t\t\t\t\t\t\t\t\t${CMAKE_CURRENT_BINARY_DIR}/include/libwebsockets\n\t)\n\n\tadd_custom_command(\n\t\t TARGET websockets_shared\n\t\t COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/lws_config.h\n\t\t \t\t\t\t\t ${CMAKE_CURRENT_BINARY_DIR}/include/lws_config.h\n\t)\n\n\nendif()\n\n# Set the so version of the lib.\n# Equivalent to LDFLAGS\u003d-version-info x:x:x\nif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)\n\tforeach(lib ${LWS_LIBRARIES})\n\t\tset_target_properties(${lib}\n\t\t\tPROPERTIES\n\t\t\tSOVERSION ${SOVERSION})\n\tendforeach()\nendif()\n\nset(LIB_LIST)\n\n#\n# Find libraries.\n#\n\n#\n# ZLIB (needed for deflate extension and if LWS_WITH_HTTP_STREAM_COMPRESSION)\n#\nif (LWS_WITH_ZLIB)\n\tif (LWS_WITH_BUNDLED_ZLIB)\n\t\tif (WIN32)\n\t\t\tset(WIN32_ZLIB_PATH \u0022win32port/zlib\u0022)\n\t\t\tset(ZLIB_SRCS\n\t\t\t\t${WIN32_ZLIB_PATH}/adler32.c\n\t\t\t\t${WIN32_ZLIB_PATH}/compress.c\n\t\t\t\t${WIN32_ZLIB_PATH}/crc32.c\n\t\t\t\t${WIN32_ZLIB_PATH}/deflate.c\n\t\t\t\t${WIN32_ZLIB_PATH}/gzlib.c\n\t\t\t\t${WIN32_ZLIB_PATH}/gzread.c\n\t\t\t\t${WIN32_ZLIB_PATH}/gzwrite.c\n\t\t\t\t${WIN32_ZLIB_PATH}/infback.c\n\t\t\t\t${WIN32_ZLIB_PATH}/inffast.c\n\t\t\t\t${WIN32_ZLIB_PATH}/inflate.c\n\t\t\t\t${WIN32_ZLIB_PATH}/inftrees.c\n\t\t\t\t${WIN32_ZLIB_PATH}/trees.c\n\t\t\t\t${WIN32_ZLIB_PATH}/uncompr.c\n\t\t\t\t${WIN32_ZLIB_PATH}/zutil.c)\n\t\t\tadd_library(zlib_internal STATIC ${ZLIB_SRCS})\n\t\t\tset(ZLIB_INCLUDE_DIRS ${WIN32_ZLIB_PATH})\n\t\t\tget_property(ZLIB_LIBRARIES TARGET zlib_internal PROPERTY LOCATION)\n\t\t\tset(ZLIB_FOUND 1)\n\t\t\t# Make sure zlib_internal is compiled before the libs.\n\t\t\tforeach (lib ${LWS_LIBRARIES})\n\t\t\t\tadd_dependencies(${lib} zlib_internal)\n\t\t\tendforeach()\n\t\telse()\n\t\t\tmessage(FATAL_ERROR \u0022Don't have bundled zlib for that platform\u0022)\n\t\tendif()\n\telseif (NOT ZLIB_FOUND)\n\t\tif (LWS_WITH_MINIZ)\n\t\t\tfind_package(Miniz REQUIRED)\n\t\t\tset(ZLIB_INCLUDE_DIRS ${MINIZ_INCLUDE_DIRS})\n\t\t\tset(ZLIB_LIBRARIES ${MINIZ_LIBRARIES})\n\t\telse()\n\t\t\tfind_package(ZLIB REQUIRED)\n\t\tendif()\n\tendif()\n\tmessage(\u0022zlib/miniz include dirs: ${ZLIB_INCLUDE_DIRS}\u0022)\n\tmessage(\u0022zlib/miniz libraries: ${ZLIB_LIBRARIES}\u0022)\n\tinclude_directories(${ZLIB_INCLUDE_DIRS})\n\tlist(APPEND LIB_LIST ${ZLIB_LIBRARIES})\nendif()\n\nif (LWS_WITH_HTTP_BROTLI)\n\tlist(APPEND LIB_LIST brotlienc brotlidec brotlidec)\nendif()\n\n#\n# OpenSSL\n#\nif (LWS_WITH_SSL)\n\tmessage(\u0022Compiling with SSL support\u0022)\n\tset(chose_ssl 0)\n\tif (LWS_WITH_WOLFSSL)\n\t\t# Use wolfSSL as OpenSSL replacement.\n\t\t# TODO: Add a find_package command for this also.\n\t\tmessage(\u0022wolfSSL include dir: ${WOLFSSL_INCLUDE_DIRS}\u0022)\n\t\tmessage(\u0022wolfSSL libraries: ${WOLFSSL_LIBRARIES}\u0022)\n\n\t\t# Additional to the root directory we need to include\n\t\t# the wolfssl/ subdirectory which contains the OpenSSL\n\t\t# compatibility layer headers.\n\n\t\tif (LWS_WITH_CYASSL)\n\t\t\tforeach(inc ${WOLFSSL_INCLUDE_DIRS})\n\t\t\t\tinclude_directories(\u0022${inc}\u0022 \u0022${inc}/cyassl\u0022)\n\t\t\tendforeach()\n\t\telse()\n\t\t\tforeach(inc ${WOLFSSL_INCLUDE_DIRS})\n\t\t\t\tinclude_directories(\u0022${inc}\u0022 \u0022${inc}/wolfssl\u0022)\n\t\t\tendforeach()\n\t\tendif()\n\n\t\tlist(APPEND LIB_LIST \u0022${WOLFSSL_LIBRARIES}\u0022)\n\t\tset(chose_ssl 1)\n\tendif()\n\n\tif (LWS_WITH_MBEDTLS)\n\t\tmessage(\u0022MBEDTLS include dir: ${MBEDTLS_INCLUDE_DIRS}\u0022)\n\t\tmessage(\u0022MBEDTLS libraries: ${MBEDTLS_LIBRARIES}\u0022)\n\n\t\tforeach(inc ${MBEDTLS_INCLUDE_DIRS})\n\t\t\tinclude_directories(\u0022${inc}\u0022 \u0022${inc}/mbedtls\u0022)\n\t\tendforeach()\n\n\t\tlist(APPEND LIB_LIST \u0022${MBEDTLS_LIBRARIES}\u0022)\n\t\tset(chose_ssl 1)\n\tendif()\n\n\tif (NOT chose_ssl)\n\t\tif (NOT OPENSSL_FOUND AND NOT LWS_WITH_BORINGSSL)\n\t\t\t# TODO: Add support for STATIC also.\n\t\tif (NOT LWS_PLAT_FREERTOS)\n\t\t\tfind_package(PkgConfig QUIET)\n\t\t\tpkg_check_modules(PC_OPENSSL openssl QUIET)\n\t\t\tfind_package(OpenSSL REQUIRED)\n\t\t\tlist(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES})\n\t\tendif()\n\t\t\tset(OPENSSL_INCLUDE_DIRS \u0022${OPENSSL_INCLUDE_DIR}\u0022)\n\t\tendif()\n\n\t\tmessage(\u0022OpenSSL include dir: ${OPENSSL_INCLUDE_DIRS}\u0022)\n\t\tif (NOT LWS_PLAT_FREERTOS)\n\t\t\tmessage(\u0022OpenSSL libraries: ${OPENSSL_LIBRARIES}\u0022)\n\t\tendif()\n\n\t\tinclude_directories(\u0022${OPENSSL_INCLUDE_DIRS}\u0022)\n\t\tif (NOT LWS_PLAT_FREERTOS)\n\t\t\tlist(APPEND LIB_LIST ${OPENSSL_LIBRARIES})\n\t\tendif()\n\n\tif (NOT LWS_WITH_MBEDTLS)\n\t\t# older (0.98) Openssl lacks this\n\t\tset(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})\n\t\tcheck_include_file(openssl/ecdh.h LWS_HAVE_OPENSSL_ECDH_H)\n\n\t\tif (LWS_SSL_SERVER_WITH_ECDH_CERT AND NOT LWS_HAVE_OPENSSL_ECDH_H)\n\t\t\tmessage(FATAL_ERROR \u0022Missing openssl/ecdh.h, so cannot use LWS_SSL_SERVER_WITH_ECDH_CERT\u0022)\n\t\tendif()\n\telse()\n\t\tunset(LWS_HAVE_OPENSSL_ECDH_H)\n\tendif(NOT LWS_WITH_MBEDTLS)\n\tendif()\n\nendif(LWS_WITH_SSL)\n\nif (LWS_WITH_LIBEV)\n\tif (NOT LIBEV_FOUND)\n\t\tfind_path(LIBEV_INCLUDE_DIRS NAMES ev.h)\n\t\tfind_library(LIBEV_LIBRARIES NAMES ev)\n\t\tif(LIBEV_INCLUDE_DIRS AND LIBEV_LIBRARIES)\n\t\t\tset(LIBEV_FOUND 1)\n\t\tendif()\n\tendif()\n\tmessage(\u0022libev include dir: ${LIBEV_INCLUDE_DIRS}\u0022)\n\tmessage(\u0022libev libraries: ${LIBEV_LIBRARIES}\u0022)\n\tinclude_directories(\u0022${LIBEV_INCLUDE_DIRS}\u0022)\n\tlist(APPEND LIB_LIST ${LIBEV_LIBRARIES})\nendif(LWS_WITH_LIBEV)\n\nif (LWS_WITH_LIBUV)\n\tif (NOT LIBUV_FOUND)\n\t\tfind_path(LIBUV_INCLUDE_DIRS NAMES uv.h)\n\t\tfind_library(LIBUV_LIBRARIES NAMES uv)\n\t\tif(LIBUV_INCLUDE_DIRS AND LIBUV_LIBRARIES)\n\t\t\tset(LIBUV_FOUND 1)\n\t\tendif()\n\tendif()\n\tmessage(\u0022libuv include dir: ${LIBUV_INCLUDE_DIRS}\u0022)\n\tmessage(\u0022libuv libraries: ${LIBUV_LIBRARIES}\u0022)\n\tinclude_directories(\u0022${LIBUV_INCLUDE_DIRS}\u0022)\n\tlist(APPEND LIB_LIST ${LIBUV_LIBRARIES})\nendif()\n\nif (LWS_WITH_LIBEVENT)\n\tif (NOT LIBEVENT_FOUND)\n\t\tfind_path(LIBEVENT_INCLUDE_DIRS NAMES event2/event.h)\n\t\tfind_library(LIBEVENT_LIBRARIES NAMES event)\n\t\tif(LIBEVENT_INCLUDE_DIRS AND LIBEVENT_LIBRARIES)\n\t\t\tset(LIBEVENT_FOUND 1)\n\t\tendif()\n\tendif()\n\tmessage(\u0022libevent include dir: ${LIBEVENT_INCLUDE_DIRS}\u0022)\n\tmessage(\u0022libevent libraries: ${LIBEVENT_LIBRARIES}\u0022)\n\tinclude_directories(\u0022${LIBEVENT_INCLUDE_DIRS}\u0022)\n\tlist(APPEND LIB_LIST ${LIBEVENT_LIBRARIES})\nendif(LWS_WITH_LIBEVENT)\n\nif (LWS_WITH_SQLITE3)\n\tif (NOT SQLITE3_FOUND)\n\t\tfind_path(SQLITE3_INCLUDE_DIRS NAMES sqlite3.h)\n\t\tfind_library(SQLITE3_LIBRARIES NAMES sqlite3)\n\t\tif(SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)\n\t\t\tset(SQLITE3_FOUND 1)\n\t\tendif()\n\tendif()\n\tmessage(\u0022sqlite3 include dir: ${SQLITE3_INCLUDE_DIRS}\u0022)\n\tmessage(\u0022sqlite3 libraries: ${SQLITE3_LIBRARIES}\u0022)\n\tinclude_directories(\u0022${SQLITE3_INCLUDE_DIRS}\u0022)\n\tlist(APPEND LIB_LIST ${SQLITE3_LIBRARIES})\nendif()\n\n\nif (LWS_WITH_HUBBUB)\n\tfind_library(LIBHUBBUB_LIBRARIES NAMES hubbub)\n\tlist(APPEND LIB_LIST ${LIBHUBBUB_LIBRARIES} )\nendif()\n\nif (LWS_ROLE_DBUS)\n\tmessage(\u0022dbus include dir 1: ${LWS_DBUS_INCLUDE1}\u0022)\n\tmessage(\u0022dbus include dir 2: ${LWS_DBUS_INCLUDE2}\u0022)\n\tinclude_directories(\u0022${LWS_DBUS_INCLUDE1}\u0022)\n\tinclude_directories(\u0022${LWS_DBUS_INCLUDE2}\u0022)\n\tlist(APPEND LIB_LIST ${LWS_DBUS_LIB})\nendif()\n\n#\n# Platform specific libs.\n#\nif (WINCE)\n\tlist(APPEND LIB_LIST ws2.lib)\nelseif (WIN32)\n\tlist(APPEND LIB_LIST ws2_32.lib userenv.lib psapi.lib iphlpapi.lib)\nendif()\n\nif (${CMAKE_SYSTEM_NAME} MATCHES \u0022QNX\u0022)\n\tlist(APPEND LIB_LIST socket)\nendif()\n\nif (UNIX)\n\tlist(APPEND LIB_LIST m)\nendif()\n\nif(ILLUMOS)\n\tlist(APPEND LIB_LIST socket)\nendif()\n\nif (HAIKU)\n\tlist(APPEND LIB_LIST network)\nendif()\n\nif (LWS_HAVE_LIBCAP)\n\tlist(APPEND LIB_LIST cap )\nendif()\n\n# Setup the linking for all libs.\nforeach (lib ${LWS_LIBRARIES})\n\ttarget_link_libraries(${lib} ${LIB_LIST})\nendforeach()\n\nset (temp ${CMAKE_REQUIRED_LIBRARIES})\nset(CMAKE_REQUIRED_LIBRARIES ${LIB_LIST})\n\nif (LWS_WITH_ZLIB)\n\tif (LWS_WITH_BUNDLED_ZLIB)\n\t\tif (WIN32)\n\t\t\t# it's trying to delete internal zlib entry\n\t\t\tLIST(REMOVE_AT CMAKE_REQUIRED_LIBRARIES 0 )\n\t\tendif()\n\tendif()\nendif()\n\nif (UNIX)\n\tlist(APPEND LIB_LIST dl)\nendif()\n\nCHECK_FUNCTION_EXISTS(SSL_CTX_set1_param LWS_HAVE_SSL_CTX_set1_param)\nCHECK_FUNCTION_EXISTS(SSL_set_info_callback LWS_HAVE_SSL_SET_INFO_CALLBACK)\nCHECK_FUNCTION_EXISTS(X509_VERIFY_PARAM_set1_host LWS_HAVE_X509_VERIFY_PARAM_set1_host)\nCHECK_FUNCTION_EXISTS(RSA_set0_key LWS_HAVE_RSA_SET0_KEY)\nCHECK_FUNCTION_EXISTS(X509_get_key_usage LWS_HAVE_X509_get_key_usage)\nCHECK_FUNCTION_EXISTS(EVP_PKEY_new_raw_private_key LWS_HAVE_SSL_CTX_EVP_PKEY_new_raw_private_key)\nCHECK_FUNCTION_EXISTS(SSL_CTX_get0_certificate LWS_HAVE_SSL_CTX_get0_certificate)\nCHECK_FUNCTION_EXISTS(SSL_get0_alpn_selected LWS_HAVE_SSL_get0_alpn_selected)\nCHECK_FUNCTION_EXISTS(SSL_set_alpn_protos LWS_HAVE_SSL_set_alpn_protos)\nCHECK_FUNCTION_EXISTS(EVP_aes_128_cfb8 LWS_HAVE_EVP_aes_128_cfb8)\nCHECK_FUNCTION_EXISTS(EVP_aes_128_cfb128 LWS_HAVE_EVP_aes_128_cfb128)\nCHECK_FUNCTION_EXISTS(EVP_aes_192_cfb8 LWS_HAVE_EVP_aes_192_cfb8)\nCHECK_FUNCTION_EXISTS(EVP_aes_192_cfb128 LWS_HAVE_EVP_aes_192_cfb128)\nCHECK_FUNCTION_EXISTS(EVP_aes_256_cfb8 LWS_HAVE_EVP_aes_256_cfb8)\nCHECK_FUNCTION_EXISTS(EVP_aes_256_cfb128 LWS_HAVE_EVP_aes_256_cfb128)\nCHECK_FUNCTION_EXISTS(EVP_aes_128_xts LWS_HAVE_EVP_aes_128_xts)\nCHECK_FUNCTION_EXISTS(RSA_verify_pss_mgf1 LWS_HAVE_RSA_verify_pss_mgf1)\nCHECK_FUNCTION_EXISTS(HMAC_CTX_new LWS_HAVE_HMAC_CTX_new)\nCHECK_FUNCTION_EXISTS(SSL_CTX_set_ciphersuites LWS_HAVE_SSL_CTX_set_ciphersuites)\nif (LWS_WITH_SSL AND NOT LWS_WITH_MBEDTLS)\n if (UNIX)\n set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} dl)\n endif()\nCHECK_C_SOURCE_COMPILES(\u0022#include \u003copenssl/ssl.h\u003e\u005cnint main(void) { STACK_OF(X509) *c \u003d NULL; SSL_CTX *ctx \u003d NULL; return (int)SSL_CTX_get_extra_chain_certs_only(ctx, \u0026c); }\u005cn\u0022 LWS_HAVE_SSL_EXTRA_CHAIN_CERTS)\nCHECK_C_SOURCE_COMPILES(\u0022#include \u003copenssl/ssl.h\u003e\u005cnint main(void) { EVP_MD_CTX *md_ctx \u003d NULL; EVP_MD_CTX_free(md_ctx); return 0; }\u005cn\u0022 LWS_HAVE_EVP_MD_CTX_free)\nCHECK_FUNCTION_EXISTS(ECDSA_SIG_set0 LWS_HAVE_ECDSA_SIG_set0)\nCHECK_FUNCTION_EXISTS(BN_bn2binpad LWS_HAVE_BN_bn2binpad)\nCHECK_FUNCTION_EXISTS(EVP_aes_128_wrap LWS_HAVE_EVP_aes_128_wrap)\nCHECK_FUNCTION_EXISTS(EC_POINT_get_affine_coordinates LWS_HAVE_EC_POINT_get_affine_coordinates)\nendif()\nif (LWS_WITH_MBEDTLS)\n\tset(LWS_HAVE_TLS_CLIENT_METHOD 1)\n\tif (NOT LWS_PLAT_FREERTOS)\n\t\t# not supported in esp-idf openssl wrapper yet, but is in our version\n\t\tset(LWS_HAVE_X509_VERIFY_PARAM_set1_host 1)\n\tendif()\n\n\tCHECK_FUNCTION_EXISTS(mbedtls_ssl_conf_alpn_protocols LWS_HAVE_mbedtls_ssl_conf_alpn_protocols)\n\tCHECK_FUNCTION_EXISTS(mbedtls_ssl_get_alpn_protocol LWS_HAVE_mbedtls_ssl_get_alpn_protocol)\n\tCHECK_FUNCTION_EXISTS(mbedtls_ssl_conf_sni LWS_HAVE_mbedtls_ssl_conf_sni)\n\tCHECK_FUNCTION_EXISTS(mbedtls_ssl_set_hs_ca_chain LWS_HAVE_mbedtls_ssl_set_hs_ca_chain)\n\tCHECK_FUNCTION_EXISTS(mbedtls_ssl_set_hs_own_cert LWS_HAVE_mbedtls_ssl_set_hs_own_cert)\n\tCHECK_FUNCTION_EXISTS(mbedtls_ssl_set_hs_authmode LWS_HAVE_mbedtls_ssl_set_hs_authmode)\n\tCHECK_FUNCTION_EXISTS(mbedtls_net_init LWS_HAVE_mbedtls_net_init)\n\nelse()\nCHECK_FUNCTION_EXISTS(TLS_client_method LWS_HAVE_TLS_CLIENT_METHOD)\nCHECK_FUNCTION_EXISTS(TLSv1_2_client_method LWS_HAVE_TLSV1_2_CLIENT_METHOD)\nendif()\n\n# ideally we want to use pipe2()\n\nCHECK_C_SOURCE_COMPILES(\u0022#define _GNU_SOURCE\u005cn#include \u003cunistd.h\u003e\u005cnint main(void) {int fd[2];\u005cn return pipe2(fd, 0);\u005cn}\u005cn\u0022 LWS_HAVE_PIPE2)\n\n# tcp keepalive needs this on linux to work practically... but it only exists\n# after kernel 2.6.37\n\nCHECK_C_SOURCE_COMPILES(\u0022#include \u003cnetinet/tcp.h\u003e\u005cnint main(void) { return TCP_USER_TIMEOUT; }\u005cn\u0022 LWS_HAVE_TCP_USER_TIMEOUT)\n\nset(CMAKE_REQUIRED_LIBRARIES ${temp})\n# Generate the lws_config.h that includes all the public compilation settings.\nconfigure_file(\n \u0022${PROJECT_SOURCE_DIR}/cmake/lws_config.h.in\u0022\n \u0022${PROJECT_BINARY_DIR}/lws_config.h\u0022)\n\n# Generate the lws_config.h that includes all the private compilation settings.\nconfigure_file(\n \u0022${PROJECT_SOURCE_DIR}/cmake/lws_config_private.h.in\u0022\n \u0022${PROJECT_BINARY_DIR}/lws_config_private.h\u0022)\n\n# Generate self-signed SSL certs for the test-server.\n\nif (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL)\n\tmessage(\u0022Searching for OpenSSL executable and dlls\u0022)\n\tfind_package(OpenSSLbins)\n\tmessage(\u0022OpenSSL executable: ${OPENSSL_EXECUTABLE}\u0022)\n\tif (OPENSSL_EXECUTABLE MATCHES \u0022^$\u0022)\n\t\tset(OPENSSL_EXECUTABLE openssl)\n\tendif()\n\tif (NOT OPENSSL_EXECUTABLE)\n\t\tset(OPENSSL_EXECUTABLE openssl)\n\tendif()\n\nendif()\n\nset(GENCERTS 0)\n\nif (LWS_WITH_SSL AND OPENSSL_EXECUTABLE AND NOT LWS_WITHOUT_TEST_SERVER AND NOT LWS_WITHOUT_SERVER AND NOT LWS_WITHOUT_TESTAPPS)\n\tset(GENCERTS 1)\nendif()\nif (LWS_PLAT_FREERTOS)\n\tset(GENCERTS 1)\nendif()\nmessage(\u0022 GENCERTS \u003d ${GENCERTS}\u0022)\nif (GENCERTS)\n\tmessage(\u0022Generating SSL Certificates for the test-server...\u0022)\n\n\tset(TEST_SERVER_SSL_KEY \u0022${PROJECT_BINARY_DIR}/libwebsockets-test-server.key.pem\u0022)\n\tset(TEST_SERVER_SSL_CERT \u0022${PROJECT_BINARY_DIR}/libwebsockets-test-server.pem\u0022)\n\n\tif (WIN32)\n\t\tif (MINGW)\n\t\t\tmessage(\u0022cmd \u003d \u005c\u0022${OPENSSL_EXECUTABLE}\u005c\u0022 req -new -newkey rsa:1024 -days 10000 -nodes -x509 -subj \u005c\u0022/C\u003dGB/ST\u003dErewhon/L\u003dAll around/O\u003dlibwebsockets-test/CN\u003dlocalhost\u005c\u0022 -keyout \u005c\u0022${TEST_SERVER_SSL_KEY}\u005c\u0022 -out \u005c\u0022${TEST_SERVER_SSL_CERT}\u005c\u0022\u0022)\n\t\t\texecute_process(\n\t\t\t\tCOMMAND \u0022${OPENSSL_EXECUTABLE}\u0022 req -new -newkey rsa:1024 -days 10000 -nodes -x509 -subj \u0022/C\u003dGB/ST\u003dErewhon/L\u003dAll around/O\u003dlibwebsockets-test/CN\u003dlocalhost\u0022 -keyout \u0022${TEST_SERVER_SSL_KEY}\u0022 -out \u0022${TEST_SERVER_SSL_CERT}\u0022\n\t\t\t\tRESULT_VARIABLE OPENSSL_RETURN_CODE)\n\t\telse()\n\t\t\tfile(WRITE \u0022${PROJECT_BINARY_DIR}/openssl_input.txt\u0022\n\t\t\t\t\u0022GB\u005cn\u0022\n\t\t\t\t\u0022Erewhon\u005cn\u0022\n\t\t\t\t\u0022All around\u005cn\u0022\n\t\t\t\t\u0022libwebsockets-test\u005cn\u0022\n\t\t\t\t\u0022localhost\u005cn\u0022\n\t\t\t\t\u0022none@invalid.org\u005cn\u005cn\u0022\n\t\t\t\t)\n\n\t\t\t# The \u0022type\u0022 command is a bit picky with paths.\n\t\t\tfile(TO_NATIVE_PATH \u0022${PROJECT_BINARY_DIR}/openssl_input.txt\u0022 OPENSSL_INPUT_WIN_PATH)\n\t\t\tmessage(\u0022OPENSSL_INPUT_WIN_PATH \u003d ${OPENSSL_INPUT_WIN_PATH}\u0022)\n\t\t\tmessage(\u0022cmd \u003d \u005c\u0022${OPENSSL_EXECUTABLE}\u005c\u0022 req -new -newkey rsa:1024 -days 10000 -nodes -x509 -keyout \u005c\u0022${TEST_SERVER_SSL_KEY}\u005c\u0022 -out \u005c\u0022${TEST_SERVER_SSL_CERT}\u005c\u0022\u0022)\n\n\t\t\texecute_process(\n\t\t\t\tCOMMAND cmd /c type \u0022${OPENSSL_INPUT_WIN_PATH}\u0022\n\t\t\t\tCOMMAND \u0022${OPENSSL_EXECUTABLE}\u0022 req -new -newkey rsa:1024 -days 10000 -nodes -x509 -keyout \u0022${TEST_SERVER_SSL_KEY}\u0022 -out \u0022${TEST_SERVER_SSL_CERT}\u0022\n\t\t\t\tRESULT_VARIABLE OPENSSL_RETURN_CODE\n\t\t\t\tOUTPUT_QUIET ERROR_QUIET)\n\n\t\t\tmessage(\u0022\u005cn\u0022)\n\t\tendif()\n\n\t\tif (OPENSSL_RETURN_CODE)\n\t\t\tmessage(WARNING \u0022!!! Failed to generate SSL certificate for Test Server using cmd.exe !!!:\u005cnOpenSSL return code \u003d ${OPENSSL_RETURN_CODE}\u0022)\n\t\telse()\n\t\t\tmessage(\u0022SUCCSESFULLY generated SSL certificate\u0022)\n\t\tendif()\n\telse()\n\t\t# Unix.\n\t\texecute_process(\n\t\t\tCOMMAND printf \u0022GB\u005c\u005cnErewhon\u005c\u005cnAll around\u005c\u005cnlibwebsockets-test\u005c\u005cn\u005c\u005cnlocalhost\u005c\u005cnnone@invalid.org\u005c\u005cn\u0022\n\t\t\tCOMMAND \u0022${OPENSSL_EXECUTABLE}\u0022\n\t\t\t\treq -new -newkey rsa:1024 -days 10000 -nodes -x509 -keyout \u0022${TEST_SERVER_SSL_KEY}\u0022 -out \u0022${TEST_SERVER_SSL_CERT}\u0022\n\t\t\tRESULT_VARIABLE OPENSSL_RETURN_CODE\n\t\t\t#\t\tOUTPUT_QUIET ERROR_QUIET\n\t\t\t)\n\n\t\tif (OPENSSL_RETURN_CODE)\n\t\t\tmessage(WARNING \u0022!!! Failed to generate SSL certificate for Test Server!!!:\u005cnOpenSSL return code \u003d ${OPENSSL_RETURN_CODE}\u0022)\n\t\telse()\n\t\t\tmessage(\u0022SUCCESSFULLY generated SSL certificate\u0022)\n\t\tendif()\n\tendif()\n\n\tlist(APPEND TEST_SERVER_DATA \n\t\t\u0022${TEST_SERVER_SSL_KEY}\u0022\n\t\t\u0022${TEST_SERVER_SSL_CERT}\u0022)\nendif()\n\n\n\n\n#\n# Test applications\n#\nset(TEST_APP_LIST)\nif ((LWS_ROLE_H1 OR LWS_ROLE_H2) AND NOT LWS_WITHOUT_TESTAPPS)\n\t#\n\t# Helper function for adding a test app.\n\t#\n\tmacro(create_test_app TEST_NAME MAIN_SRC S2 S3 S4 S5 S6)\n\n\t\tset(TEST_SRCS ${MAIN_SRC})\n\t\tset(TEST_HDR)\n\t\tif (\u0022${S2}\u0022 STREQUAL \u0022\u0022)\n\t\telse()\n\t\t\tlist(APPEND TEST_SRCS ${S2})\n\t\tendif()\n\t\tif (\u0022${S3}\u0022 STREQUAL \u0022\u0022)\n\t\telse()\n\t\t\tlist(APPEND TEST_SRCS ${S3})\n\t\tendif()\n\t\tif (\u0022${S4}\u0022 STREQUAL \u0022\u0022)\n\t\telse()\n\t\t\tlist(APPEND TEST_SRCS ${S4})\n\t\tendif()\n\t\tif (\u0022${S5}\u0022 STREQUAL \u0022\u0022)\n\t\telse()\n\t\t\tlist(APPEND TEST_SRCS ${S5})\n\t\tendif()\n\t\tif (\u0022${S6}\u0022 STREQUAL \u0022\u0022)\n\t\telse()\n\t\t\tlist(APPEND TEST_SRCS ${S6})\n\t\tendif()\n\t\tif (WIN32)\n\t\t\tlist(APPEND TEST_SRCS\n\t\t\t\t${WIN32_HELPERS_PATH}/getopt.c\n\t\t\t\t${WIN32_HELPERS_PATH}/getopt_long.c\n\t\t\t\t${WIN32_HELPERS_PATH}/gettimeofday.c\n\t\t\t)\n\n\t\t\tlist(APPEND TEST_HDR\n\t\t\t\t${WIN32_HELPERS_PATH}/getopt.h\n\t\t\t\t${WIN32_HELPERS_PATH}/gettimeofday.h\n\t\t\t)\n\t\tendif(WIN32)\n\n\t\tsource_group(\u0022Headers Private\u0022 FILES ${TEST_HDR})\n\t\tsource_group(\u0022Sources\u0022 FILES ${TEST_SRCS})\n\t\tadd_executable(${TEST_NAME} ${TEST_SRCS} ${TEST_HDR})\n\n\t\tif (LWS_LINK_TESTAPPS_DYNAMIC)\n\t\t\tif (NOT LWS_WITH_SHARED)\n\t\t\t\tmessage(FATAL_ERROR \u0022Build of the shared library is disabled. LWS_LINK_TESTAPPS_DYNAMIC must be combined with LWS_WITH_SHARED.\u0022)\n\t\t\tendif()\n\t\t\ttarget_link_libraries(${TEST_NAME} websockets_shared)\n\t\t\tadd_dependencies(${TEST_NAME} websockets_shared)\n\t\telse()\n\t\t\tif (NOT LWS_WITH_STATIC)\n\t\t\t\tmessage(FATAL_ERROR \u0022Build of the static library is disabled. Disabled LWS_LINK_TESTAPPS_DYNAMIC must be combined with LWS_WITH_STATIC.\u0022)\n\t\t\tendif()\n\t\t\ttarget_link_libraries(${TEST_NAME} websockets)\n\t\t\tadd_dependencies(${TEST_NAME} websockets)\n\t\t\tif (UNIX AND LWS_WITH_SSL AND NOT LWS_WITH_MBEDTLS)\n\t\t\t\ttarget_link_libraries(${TEST_NAME} dl)\n\t\t\tendif()\n\t\tendif()\n\n\t\tif (LWS_WITH_HTTP_STREAM_COMPRESSION)\n\t\t\ttarget_link_libraries(${TEST_NAME} z)\n\t\tendif()\n\n\t\t# Set test app specific defines.\n\t\tset_property(TARGET ${TEST_NAME}\n\t\t\t\t\tPROPERTY COMPILE_DEFINITIONS\n\t\t\t\t\t\tINSTALL_DATADIR\u003d\u0022${CMAKE_INSTALL_PREFIX}/share\u0022\n\t\t\t\t\t)\n\n\t\t# Prefix the binary names with libwebsockets.\n\t\tset_target_properties(${TEST_NAME}\n\t\t\tPROPERTIES\n\t\t\tOUTPUT_NAME libwebsockets-${TEST_NAME})\n\n\t\t# Add to the list of tests.\n\t\tlist(APPEND TEST_APP_LIST ${TEST_NAME})\n\tendmacro()\n\n\tif (UNIX AND LWS_WITH_PLUGINS)\n\t\tset(CMAKE_C_FLAGS \u0022-fPIC ${CMAKE_C_FLAGS}\u0022)\n\t\tif(NOT((${CMAKE_SYSTEM_NAME} MATCHES \u0022FreeBSD\u0022) OR (${CMAKE_SYSTEM_NAME} MATCHES \u0022QNX\u0022)))\n\t\t\ttarget_link_libraries(websockets dl)\n\t\tendif()\n\tendif()\n\n\tif (NOT LWS_WITHOUT_SERVER)\n\t\t#\n\t\t# test-server\n\t\t#\n\t\tif (NOT LWS_WITHOUT_TEST_SERVER)\n\t\t\tcreate_test_app(test-server \u0022test-apps/test-server.c\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022)\n\n\t\t\tif (LWS_WITH_CGI)\n\t\t\tcreate_test_app(test-sshd \u0022test-apps/test-sshd.c\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022)\n\t\t\ttarget_include_directories(test-sshd PRIVATE \u0022${PROJECT_SOURCE_DIR}/plugins/ssh-base/include\u0022)\n\n\t\t\tendif()\n\n\t\tendif()\n\n\t\t#\n\t\t# test-server-extpoll\n\t\t#\n\t\tif (NOT LWS_WITHOUT_TEST_SERVER_EXTPOLL AND NOT WIN32)\n\t\t\tcreate_test_app(test-server-extpoll\n\t\t\t\t\u0022test-apps/test-server.c\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022)\n\t\t\t# Set defines for this executable only.\n\t\t\tset_property(\n\t\t\t\tTARGET test-server-extpoll\n\t\t\t\tPROPERTY COMPILE_DEFINITIONS \n\t\t\t\t\tEXTERNAL_POLL \n\t\t\t\t\tINSTALL_DATADIR\u003d\u0022${CMAKE_INSTALL_PREFIX}/share\u0022\n\t\t\t\t)\n\n\t\t\t# We need to link against winsock code.\n\t\t\tif (WIN32)\n\t\t\t\ttarget_link_libraries(test-server-extpoll ws2_32.lib)\n\t\t\tendif(WIN32)\n\t\tendif()\n\n\t\tif (LWS_WITH_LEJP)\n\t\t\tcreate_test_app(\n\t\t\t\ttest-lejp\n\t\t\t\t\u0022test-apps/test-lejp.c\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022\n\t\t\t\t\u0022\u0022)\n\t\tendif()\n\n\t\t# Data files for running the test server.\n\t\tlist(APPEND TEST_SERVER_DATA\n\t\t\t\u0022${PROJECT_SOURCE_DIR}/test-apps/favicon.ico\u0022\n\t\t\t\u0022${PROJECT_SOURCE_DIR}/test-apps/leaf.jpg\u0022\n\t\t\t\u0022${PROJECT_SOURCE_DIR}/test-apps/candide.zip\u0022\n\t\t\t\u0022${PROJECT_SOURCE_DIR}/test-apps/libwebsockets.org-logo.svg\u0022\n\t\t\t\u0022${PROJECT_SOURCE_DIR}/test-apps/http2.png\u0022\n\t\t\t\u0022${PROJECT_SOURCE_DIR}/test-apps/wss-over-h2.png\u0022\n\t\t\t\u0022${PROJECT_SOURCE_DIR}/test-apps/lws-common.js\u0022\n\t\t\t\u0022${PROJECT_SOURCE_DIR}/test-apps/test.html\u0022\n\t\t\t\u0022${PROJECT_SOURCE_DIR}/test-apps/test.css\u0022\n\t\t\t\u0022${PROJECT_SOURCE_DIR}/test-apps/test.js\u0022)\n\n\t\tadd_custom_command(TARGET test-server\n\t\t\t\t\t\tPOST_BUILD \n\t\t\t\t\t\tCOMMAND \u0022${CMAKE_COMMAND}\u0022 -E make_directory \u0022$\u003cTARGET_FILE_DIR:test-server\u003e/../share/libwebsockets-test-server\u0022)\n\n\t\t# Copy the file needed to run the server so that the test apps can\n\t\t# reach them from their default output location\n\t\tforeach (TEST_FILE ${TEST_SERVER_DATA})\n\t\t\tif (EXISTS ${TEST_FILE})\n\t\t\t\tadd_custom_command(TARGET test-server\n\t\t\t\t\t\t\tPOST_BUILD \n\t\t\t\t\t\t\tCOMMAND \u0022${CMAKE_COMMAND}\u0022 -E copy \u0022${TEST_FILE}\u0022 \u0022$\u003cTARGET_FILE_DIR:test-server\u003e/../share/libwebsockets-test-server\u0022 VERBATIM)\n\t\t\tendif()\n\t\tendforeach()\n\tendif(NOT LWS_WITHOUT_SERVER)\n\n\tif (NOT LWS_WITHOUT_CLIENT)\n\t\t#\n\t\t# test-client\n\t\t#\n\t\tif (NOT LWS_WITHOUT_TEST_CLIENT)\n\t\t\tcreate_test_app(test-client \u0022test-apps/test-client.c\u0022 \u0022\u0022 \u0022\u0022 \u0022\u0022 \u0022\u0022 \u0022\u0022)\n\t\tendif()\n\n\tendif(NOT LWS_WITHOUT_CLIENT)\n\t\n\t\n\tif (LWS_WITH_PLUGINS AND LWS_WITH_SHARED)\n\t\tmacro(create_plugin PLUGIN_NAME PLUGIN_INCLUDE MAIN_SRC S2 S3)\n\n\t\tset(PLUGIN_SRCS ${MAIN_SRC})\n\n\t\tif (\u0022${S2}\u0022 STREQUAL \u0022\u0022)\n\t\telse()\n\t\t\tlist(APPEND PLUGIN_SRCS ${S2})\n\t\tendif()\n\t\tif (\u0022${S3}\u0022 STREQUAL \u0022\u0022)\n\t\telse()\n\t\t\tlist(APPEND PLUGIN_SRCS ${S3})\n\t\tendif()\n\n\t\tif (WIN32)\n\t\t\tlist(APPEND PLUGIN_SRCS\n\t\t\t\t${WIN32_HELPERS_PATH}/getopt.c\n\t\t\t\t${WIN32_HELPERS_PATH}/getopt_long.c\n\t\t\t\t${WIN32_HELPERS_PATH}/gettimeofday.c\n\t\t\t)\n\n\t\t\tlist(APPEND PLUGIN_HDR\n\t\t\t\t${WIN32_HELPERS_PATH}/getopt.h\n\t\t\t\t${WIN32_HELPERS_PATH}/gettimeofday.h\n\t\t\t)\n\t\tendif(WIN32)\n\n\t\tsource_group(\u0022Headers Private\u0022 FILES ${PLUGIN_HDR})\n\t\tsource_group(\u0022Sources\u0022 FILES ${PLUGIN_SRCS})\n\t\tadd_library(${PLUGIN_NAME} SHARED ${PLUGIN_SRCS} ${PLUGIN_HDR})\n\t\t\n\t\ttarget_link_libraries(${PLUGIN_NAME} websockets_shared)\n\t\tadd_dependencies(${PLUGIN_NAME} websockets_shared)\n\t\tinclude_directories(${PLUGIN_INCLUDE})\n\n\t\t# Set test app specific defines.\n\t\tset_property(TARGET ${PLUGIN_NAME}\n\t\t\t PROPERTY COMPILE_DEFINITIONS\n\t\t\t INSTALL_DATADIR\u003d\u0022${CMAKE_INSTALL_PREFIX}/plugins\u0022\n\t\t)\n\n\t\tSET_TARGET_PROPERTIES(${PLUGIN_NAME}\n PROPERTIES COMPILE_FLAGS ${CMAKE_C_FLAGS})\n\n#\t\tset_target_properties(${PLUGIN_NAME}\n#\t\t\tPROPERTIES\n#\t\t\tOUTPUT_NAME ${PLUGIN_NAME})\n\n\t\tlist(APPEND PLUGINS_LIST ${PLUGIN_NAME})\n\n\t\tendmacro()\n\t\t\nif (LWS_ROLE_WS)\n\t\tcreate_plugin(protocol_dumb_increment \u0022\u0022\n\t\t\t \u0022plugins/protocol_dumb_increment.c\u0022 \u0022\u0022 \u0022\u0022)\n\t\tcreate_plugin(protocol_lws_mirror \u0022\u0022\n\t\t\t \u0022plugins/protocol_lws_mirror.c\u0022 \u0022\u0022 \u0022\u0022)\n\t\tcreate_plugin(protocol_lws_status \u0022\u0022\n\t\t\t \u0022plugins/protocol_lws_status.c\u0022 \u0022\u0022 \u0022\u0022)\n\t\tcreate_plugin(protocol_lws_table_dirlisting \u0022\u0022\n\t\t\t \u0022plugins/generic-table/protocol_table_dirlisting.c\u0022 \u0022\u0022 \u0022\u0022)\n\t\tif (NOT WIN32)\n\t\t\tcreate_plugin(protocol_lws_raw_test \u0022\u0022\n\t\t\t \u0022plugins/protocol_lws_raw_test.c\u0022 \u0022\u0022 \u0022\u0022)\n\n\t\t\tcreate_plugin(protocol_deaddrop \u0022\u0022\n\t\t\t \u0022plugins/deaddrop/protocol_lws_deaddrop.c\u0022 \u0022\u0022 \u0022\u0022)\n\n\t\tendif()\n\nif (LWS_WITH_SERVER_STATUS)\n\t\tcreate_plugin(protocol_lws_server_status \u0022\u0022\n\t\t\t \u0022plugins/protocol_lws_server_status.c\u0022 \u0022\u0022 \u0022\u0022)\nendif()\n\nif (NOT LWS_WITHOUT_CLIENT)\n\t\tcreate_plugin(protocol_client_loopback_test \u0022\u0022\n \u0022plugins/protocol_client_loopback_test.c\u0022 \u0022\u0022 \u0022\u0022)\nendif()\n\nendif()\n\n\t\tcreate_plugin(protocol_post_demo \u0022\u0022\n\t\t\t \u0022plugins/protocol_post_demo.c\u0022 \u0022\u0022 \u0022\u0022)\n\nif (LWS_ROLE_RAW_PROXY)\n\t\tcreate_plugin(protocol_lws_raw_proxy \u0022\u0022\n\t\t\t \u0022plugins/raw-proxy/protocol_lws_raw_proxy.c\u0022 \u0022\u0022 \u0022\u0022)\nendif()\n\nif (LWS_WITH_FTS)\n\t\tcreate_plugin(protocol_fulltext_demo \u0022\u0022\n\t\t\t \u0022plugins/protocol_fulltext_demo.c\u0022 \u0022\u0022 \u0022\u0022)\nendif()\n\n\nif (LWS_WITH_SSL)\n\t\tcreate_plugin(protocol_lws_ssh_base \u0022plugins/ssh-base/include\u0022\n\t\t\t \u0022plugins/ssh-base/sshd.c;plugins/ssh-base/telnet.c;plugins/ssh-base/kex-25519.c\u0022 \u0022plugins/ssh-base/crypto/chacha.c;plugins/ssh-base/crypto/ed25519.c;plugins/ssh-base/crypto/fe25519.c;plugins/ssh-base/crypto/ge25519.c;plugins/ssh-base/crypto/poly1305.c;plugins/ssh-base/crypto/sc25519.c;plugins/ssh-base/crypto/smult_curve25519_ref.c\u0022 \u0022\u0022)\n\t\tcreate_plugin(protocol_lws_sshd_demo \u0022plugins/ssh-base/include\u0022 \u0022plugins/protocol_lws_sshd_demo.c\u0022 \u0022\u0022 \u0022\u0022)\n\n\t\tinclude_directories(\u0022${PROJECT_SOURCE_DIR}/plugins/ssh-base/include\u0022)\nendif()\n\n\n\nif (LWS_WITH_ACME)\n\t\tcreate_plugin(protocol_lws_acme_client \u0022\u0022\n\t\t\t \u0022plugins/acme-client/protocol_lws_acme_client.c\u0022 \u0022\u0022 \u0022\u0022)\nendif()\n\nif (LWS_WITH_GENERIC_SESSIONS AND LWS_ROLE_WS)\n\tcreate_plugin(protocol_generic_sessions \u0022\u0022\n \u0022plugins/generic-sessions/protocol_generic_sessions.c\u0022\n\t\t \u0022plugins/generic-sessions/utils.c\u0022\n\t\t \u0022plugins/generic-sessions/handlers.c\u0022)\n\n\tif (WIN32)\n\t\ttarget_link_libraries(protocol_generic_sessions ${LWS_SQLITE3_LIBRARIES})\n\telse()\n\t\ttarget_link_libraries(protocol_generic_sessions sqlite3 )\n\tendif(WIN32)\n\n\t\tcreate_plugin(protocol_lws_messageboard \u0022\u0022\n\t\t\t \u0022plugins/generic-sessions/protocol_lws_messageboard.c\u0022 \u0022\u0022 \u0022\u0022)\n\tif (WIN32)\n\t\ttarget_link_libraries(protocol_lws_messageboard ${LWS_SQLITE3_LIBRARIES})\n\telse()\n\t\ttarget_link_libraries(protocol_lws_messageboard sqlite3 )\n\tendif(WIN32)\n\nendif(LWS_WITH_GENERIC_SESSIONS AND LWS_ROLE_WS)\n\n\n\tendif(LWS_WITH_PLUGINS AND LWS_WITH_SHARED)\n\n\t#\n\t# Copy OpenSSL dlls to the output directory on Windows.\n\t# (Otherwise we'll get an error when trying to run)\n\t#\n\tif (WIN32 AND LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL)\n\t\tif(OPENSSL_BIN_FOUND)\n\t\t\tmessage(\u0022OpenSSL dlls found:\u0022)\n\t\t\tmessage(\u0022 Libeay: ${LIBEAY_BIN}\u0022)\n\t\t\tmessage(\u0022 SSLeay: ${SSLEAY_BIN}\u0022)\n\n\t\t\tforeach(TARGET_BIN ${TEST_APP_LIST})\n\t\t\t\tadd_custom_command(TARGET ${TARGET_BIN}\n\t\t\t\t\tPOST_BUILD\n\t\t\t\t\tCOMMAND \u0022${CMAKE_COMMAND}\u0022 -E copy \u0022${LIBEAY_BIN}\u0022 \u0022$\u003cTARGET_FILE_DIR:${TARGET_BIN}\u003e\u0022 VERBATIM)\n\t\t\t\tadd_custom_command(TARGET ${TARGET_BIN}\n\t\t\t\t\tPOST_BUILD\n\t\t\t\t\tCOMMAND \u0022${CMAKE_COMMAND}\u0022 -E copy \u0022${SSLEAY_BIN}\u0022 \u0022$\u003cTARGET_FILE_DIR:${TARGET_BIN}\u003e\u0022 VERBATIM)\n\n\t\t\t\t#\n\t\t\t\t# Win32: if we are using libuv, also need to copy it in the output dir\n\t\t\t\t#\n\t\t\t\tif (WIN32 AND LWS_WITH_LIBUV)\n\t\t\t\t\tSTRING(REPLACE \u0022.lib\u0022 \u0022.dll\u0022 LIBUV_BIN ${LIBUV_LIBRARIES})\n\t\t\t\t\tadd_custom_command(TARGET ${TARGET_BIN}\n\t\t\t\t\t\tPOST_BUILD\n\t\t\t\t\t\tCOMMAND \u0022${CMAKE_COMMAND}\u0022 -E copy \u0022${LIBUV_BIN}\u0022 \u0022$\u003cTARGET_FILE_DIR:${TARGET_BIN}\u003e\u0022 VERBATIM)\n\t\t\t\tendif()\n\t\t\tendforeach()\n\t\tendif()\n\tendif()\nendif((LWS_ROLE_H1 OR LWS_ROLE_H2) AND NOT LWS_WITHOUT_TESTAPPS)\n\nif (LWS_WITH_LWSWS)\n\t\tlist(APPEND LWSWS_SRCS\n\t\t\t\u0022lwsws/main.c\u0022\n\t\t)\n\n\t\tif (WIN32)\n\t\t\tlist(APPEND LWSWS_SRCS\n\t\t\t\t${WIN32_HELPERS_PATH}/getopt.c\n\t\t\t\t${WIN32_HELPERS_PATH}/getopt_long.c\n\t\t\t\t${WIN32_HELPERS_PATH}/gettimeofday.c\n\t\t\t)\n\n\t\t\tlist(APPEND LWSWS_HDR\n\t\t\t\t${WIN32_HELPERS_PATH}/getopt.h\n\t\t\t\t${WIN32_HELPERS_PATH}/gettimeofday.h\n\t\t\t)\n\t\tendif(WIN32)\n\n\t\tsource_group(\u0022Headers Private\u0022 FILES ${LWSWS_HDR})\n\t\tsource_group(\u0022Sources\u0022 FILES ${LWSWS_SRCS})\n\t\tadd_executable(\u0022lwsws\u0022 ${LWSWS_SRCS} ${LWSWS_HDR})\n\n\t\ttarget_link_libraries(\u0022lwsws\u0022 websockets_shared)\n\t\tadd_dependencies(\u0022lwsws\u0022 websockets_shared)\n\n\t\t# Set test app specific defines.\n\t\tset_property(TARGET \u0022lwsws\u0022\n\t\t\t PROPERTY COMPILE_DEFINITIONS\n\t\t\t INSTALL_DATADIR\u003d\u0022${CMAKE_INSTALL_PREFIX}/share\u0022\n\t\t)\nendif (LWS_WITH_LWSWS)\n\nif (UNIX)\n\n# Generate and install pkgconfig.\n# (This is not indented, because the tabs will be part of the output)\nfile(WRITE \u0022${PROJECT_BINARY_DIR}/libwebsockets.pc\u0022\n\u0022prefix\u003d\u005c\u0022${CMAKE_INSTALL_PREFIX}\u005c\u0022\nexec_prefix\u003d\u005c${prefix}\nlibdir\u003d\u005c${exec_prefix}/lib${LIB_SUFFIX}\nincludedir\u003d\u005c${prefix}/include\n\nName: libwebsockets\nDescription: Websockets server and client library\nVersion: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\n\nLibs: -L\u005c${libdir} -lwebsockets\nCflags: -I\u005c${includedir}\u0022\n)\n\n\tinstall(FILES \u0022${PROJECT_BINARY_DIR}/libwebsockets.pc\u0022\n\t\tDESTINATION lib${LIB_SUFFIX}/pkgconfig)\n\nfile(WRITE \u0022${PROJECT_BINARY_DIR}/libwebsockets_static.pc\u0022\n\u0022prefix\u003d\u005c\u0022${CMAKE_INSTALL_PREFIX}\u005c\u0022\nexec_prefix\u003d\u005c${prefix}\nlibdir\u003d\u005c${exec_prefix}/lib${LIB_SUFFIX}\nincludedir\u003d\u005c${prefix}/include\n\nName: libwebsockets_static\nDescription: Websockets server and client static library\nVersion: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\n\nLibs: -L\u005c${libdir} -lwebsockets_static\nLibs.private:\nCflags: -I\u005c${includedir}\u0022\n)\n\n\tinstall(FILES \u0022${PROJECT_BINARY_DIR}/libwebsockets_static.pc\u0022\n\t\tDESTINATION lib${LIB_SUFFIX}/pkgconfig)\n\n\nendif(UNIX)\n\n#\n# Installation preparations.\n#\n\nif(WIN32 AND NOT CYGWIN)\n set(DEF_INSTALL_CMAKE_DIR cmake)\nelse()\n set(DEF_INSTALL_CMAKE_DIR lib${LIB_SUFFIX}/cmake/libwebsockets)\nendif()\n\nset(LWS_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH \u0022Installation directory for CMake files\u0022)\n\n# Export targets (This is used for other CMake projects to easily find the libraries and include files).\nif (LWS_WITH_EXPORT_LWSTARGETS)\n export(TARGETS ${LWS_LIBRARIES}\n FILE \u0022${PROJECT_BINARY_DIR}/LibwebsocketsTargets.cmake\u0022)\nendif()\n\nexport(PACKAGE libwebsockets)\n\n# Generate the config file for the build-tree.\nset(LWS__INCLUDE_DIRS \n \u0022${PROJECT_SOURCE_DIR}/lib\u0022\n \u0022${PROJECT_BINARY_DIR}\u0022)\nset(LIBWEBSOCKETS_INCLUDE_DIRS ${LWS__INCLUDE_DIRS} CACHE PATH \u0022Libwebsockets include directories\u0022)\nconfigure_file(${PROJECT_SOURCE_DIR}/cmake/LibwebsocketsConfig.cmake.in\n ${PROJECT_BINARY_DIR}/LibwebsocketsConfig.cmake \n @ONLY)\n\n# Generate the config file for the installation tree.\nget_filename_component(LWS_ABSOLUTE_INSTALL_CMAKE_DIR ${LWS_INSTALL_CMAKE_DIR} ABSOLUTE)\nget_filename_component(LWS_ABSOLUTE_INSTALL_INCLUDE_DIR ${LWS_INSTALL_INCLUDE_DIR} ABSOLUTE)\nfile(RELATIVE_PATH \n REL_INCLUDE_DIR \n \u0022${LWS_ABSOLUTE_INSTALL_CMAKE_DIR}\u0022\n \u0022${LWS_ABSOLUTE_INSTALL_INCLUDE_DIR}\u0022) # Calculate the relative directory from the cmake dir.\n\n# Note the EVENT_CMAKE_DIR is defined in JanssonConfig.cmake.in, \n# we escape it here so it's evaluated when it is included instead\n# so that the include dirs are given relative to where the \n# config file is located.\nset(LWS__INCLUDE_DIRS \n \u0022\u005c${LWS_CMAKE_DIR}/${REL_INCLUDE_DIR}\u0022) \nconfigure_file(${PROJECT_SOURCE_DIR}/cmake/LibwebsocketsConfig.cmake.in\n ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/LibwebsocketsConfig.cmake \n @ONLY)\n\n# Generate version info for both build-tree and install-tree.\nconfigure_file(${PROJECT_SOURCE_DIR}/cmake/LibwebsocketsConfigVersion.cmake.in\n ${PROJECT_BINARY_DIR}/LibwebsocketsConfigVersion.cmake \n @ONLY)\n\n\t\t\tset_target_properties(${LWS_LIBRARIES}\n\t\t\t\t\tPROPERTIES PUBLIC_HEADER \u0022${HDR_PUBLIC}\u0022)\n\n#\n# Installation.\n#\n\ninstall(DIRECTORY include/libwebsockets\n\tDESTINATION \u0022${LWS_INSTALL_INCLUDE_DIR}\u0022 COMPONENT dev_headers)\n\n# Install libs and headers.\ninstall(TARGETS ${LWS_LIBRARIES}\n\t\tEXPORT LibwebsocketsTargets\n\t\tLIBRARY DESTINATION \u0022${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}\u0022 COMPONENT libraries\n\t\tARCHIVE DESTINATION \u0022${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}\u0022 COMPONENT libraries\n\t\tRUNTIME DESTINATION \u0022${LWS_INSTALL_BIN_DIR}\u0022 COMPONENT libraries # Windows DLLs\n\t\tPUBLIC_HEADER DESTINATION \u0022${LWS_INSTALL_INCLUDE_DIR}\u0022 COMPONENT dev)\n\t\t\nset(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME \u0022Libraries\u0022)\nset(CPACK_COMPONENT_DEV_DISPLAY_NAME \u0022Development files\u0022)\n\n# Install test apps.\nif (NOT LWS_WITHOUT_TESTAPPS)\n\tinstall(TARGETS ${TEST_APP_LIST}\n\t\t\tRUNTIME DESTINATION ${LWS_INSTALL_EXAMPLES_DIR}\n\t\t\tCOMPONENT examples)\n\tset(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME \u0022Example files\u0022)\nendif()\n\n# lwsws\nif (LWS_WITH_LWSWS)\n\tinstall(TARGETS lwsws\n\t\tRUNTIME DESTINATION \u0022${LWS_INSTALL_BIN_DIR}\u0022 COMPONENT lwsws )\nendif()\n\n# Programs shared files used by the test-server.\nif (NOT LWS_WITHOUT_TESTAPPS AND NOT LWS_WITHOUT_SERVER)\n\tinstall(FILES ${TEST_SERVER_DATA}\n\t\t\tDESTINATION share/libwebsockets-test-server\n\t\tCOMPONENT examples)\n\n\t\tinstall(FILES \u0022${PROJECT_SOURCE_DIR}/test-apps/private/index.html\u0022\n\t\t\tDESTINATION share/libwebsockets-test-server/private\n\t\t\tCOMPONENT examples)\nif (LWS_WITH_CGI)\n\tset(CGI_TEST_SCRIPT \u0022${PROJECT_SOURCE_DIR}/test-apps/lws-cgi-test.sh\u0022)\n\tinstall(FILES ${CGI_TEST_SCRIPT}\n\t\t\tPERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ\n\t\t\tDESTINATION share/libwebsockets-test-server\n\t\t\tCOMPONENT examples)\n\tendif()\nendif()\n\n\nif (NOT LWS_WITHOUT_TEST_SERVER AND NOT LWS_WITHOUT_SERVER AND NOT LWS_WITHOUT_TESTAPPS)\n\tinstall(FILES test-apps/lws-ssh-test-keys;test-apps/lws-ssh-test-keys.pub\n\t\tDESTINATION share/libwebsockets-test-server\n\t\tCOMPONENT examples)\nendif()\n\n# plugins\n\nif (LWS_WITH_PLUGINS)\n\tinstall(TARGETS ${PLUGINS_LIST}\n\t\tPERMISSIONS OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ\n\t\tDESTINATION share/libwebsockets-test-server/plugins\n\t\tCOMPONENT plugins)\n\n\tif (NOT WIN32)\n\t\tinstall(FILES plugins/deaddrop/assets/index.html;plugins/deaddrop/assets/deaddrop.js;plugins/deaddrop/assets/deaddrop.css;plugins/deaddrop/assets/drop.svg\n\t\t\tDESTINATION share/libwebsockets-test-server/deaddrop\n\t\t\tCOMPONENT plugins)\n\tendif()\n\n\nif (LWS_WITH_SERVER_STATUS)\n\tinstall(FILES plugins/server-status.html;plugins/server-status.js;plugins/server-status.css;plugins/lwsws-logo.png\n\t\tDESTINATION share/libwebsockets-test-server/server-status\n\t\t\tCOMPONENT examples)\nendif()\nif (LWS_WITH_GENERIC_SESSIONS)\n\tinstall(FILES\n\t\t plugins/generic-sessions/assets/lwsgs-logo.png\n\t\t plugins/generic-sessions/assets/seats.jpg\n\t\t plugins/generic-sessions/assets/failed-login.html\n\t\t plugins/generic-sessions/assets/lwsgs.js\n\t\t plugins/generic-sessions/assets/lwsgs.css\n\t\t plugins/generic-sessions/assets/post-register-fail.html\n\t\t plugins/generic-sessions/assets/post-register-ok.html\n\t\t plugins/generic-sessions/assets/post-verify-ok.html\n\t\t plugins/generic-sessions/assets/post-verify-fail.html\n\t\t plugins/generic-sessions/assets/sent-forgot-ok.html\n\t\t plugins/generic-sessions/assets/sent-forgot-fail.html\n\t\t plugins/generic-sessions/assets/post-forgot-ok.html\n\t\t plugins/generic-sessions/assets/post-forgot-fail.html\n\t\t plugins/generic-sessions/assets/index.html\n\t\tDESTINATION share/libwebsockets-test-server/generic-sessions\n\t\t\tCOMPONENT examples)\n\tinstall(FILES plugins/generic-sessions/assets/successful-login.html \n\t\tDESTINATION share/libwebsockets-test-server/generic-sessions/needauth\n\t\t\tCOMPONENT examples)\n\tinstall(FILES plugins/generic-sessions/assets/admin-login.html\n\t\tDESTINATION share/libwebsockets-test-server/generic-sessions/needadmin\n\t\t\tCOMPONENT examples)\nendif()\n\n\tinstall(FILES\n\t\t plugins/generic-table/assets/lwsgt.js\n\t\t plugins/generic-table/assets/index.html\n\t\tDESTINATION share/libwebsockets-test-server/generic-table\n\t\t\tCOMPONENT examples)\n\nendif()\n\n# Install the LibwebsocketsConfig.cmake and LibwebsocketsConfigVersion.cmake\ninstall(FILES\n \u0022${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/LibwebsocketsConfig.cmake\u0022\n \u0022${PROJECT_BINARY_DIR}/LibwebsocketsConfigVersion.cmake\u0022\n DESTINATION \u0022${LWS_INSTALL_CMAKE_DIR}\u0022 COMPONENT dev)\n\n# Install exports for the install-tree.\nif (LWS_WITH_EXPORT_LWSTARGETS)\n install(EXPORT LibwebsocketsTargets\n DESTINATION \u0022${LWS_INSTALL_CMAKE_DIR}\u0022 COMPONENT dev)\nendif()\n\n# build subdir is not part of sources\nset(CPACK_SOURCE_IGNORE_FILES $(CPACK_SOURCE_IGNORE_FILES) \u0022/.git/\u0022 \u0022/build/\u0022 \u0022\u005c\u005c\u005c\u005c.tgz$\u0022 \u0022\u005c\u005c\u005c\u005c.tar\u005c\u005c\u005c\u005c.gz$\u0022)\n\n# Most people are more used to \u0022make dist\u0022 compared to \u0022make package_source\u0022\nadd_custom_target(dist COMMAND \u0022${CMAKE_MAKE_PROGRAM}\u0022 package_source)\n\ninclude(UseRPMTools)\nif (RPMTools_FOUND)\n\tRPMTools_ADD_RPM_TARGETS(libwebsockets scripts/libwebsockets.spec)\nendif()\n\nmessage(\u0022---------------------------------------------------------------------\u0022)\nmessage(\u0022 Settings: (For more help do cmake -LH \u003csrcpath\u003e)\u0022)\nmessage(\u0022---------------------------------------------------------------------\u0022)\nmessage(\u0022 LWS_WITH_STATIC \u003d ${LWS_WITH_STATIC}\u0022)\nmessage(\u0022 LWS_WITH_SHARED \u003d ${LWS_WITH_SHARED}\u0022)\nmessage(\u0022 LWS_WITH_SSL \u003d ${LWS_WITH_SSL} (SSL Support)\u0022)\nmessage(\u0022 LWS_SSL_CLIENT_USE_OS_CA_CERTS \u003d ${LWS_SSL_CLIENT_USE_OS_CA_CERTS}\u0022)\nmessage(\u0022 LWS_WITH_WOLFSSL \u003d ${LWS_WITH_WOLFSSL} (wolfSSL/CyaSSL replacement for OpenSSL)\u0022)\nif (LWS_WITH_WOLFSSL)\n\tmessage(\u0022 LWS_WOLFSSL_LIBRARIES \u003d ${LWS_WOLFSSL_LIBRARIES}\u0022)\n\tmessage(\u0022 LWS_WOLFSSL_INCLUDE_DIRS \u003d ${LWS_WOLFSSL_INCLUDE_DIRS}\u0022)\nendif()\nmessage(\u0022 LWS_WITH_MBEDTLS \u003d ${LWS_WITH_MBEDTLS} (mbedTLS replacement for OpenSSL)\u0022)\nmessage(\u0022 LWS_WITHOUT_BUILTIN_SHA1 \u003d ${LWS_WITHOUT_BUILTIN_SHA1}\u0022)\nmessage(\u0022 LWS_WITHOUT_BUILTIN_GETIFADDRS \u003d ${LWS_WITHOUT_BUILTIN_GETIFADDRS}\u0022)\nmessage(\u0022 LWS_WITHOUT_CLIENT \u003d ${LWS_WITHOUT_CLIENT}\u0022)\nmessage(\u0022 LWS_WITHOUT_SERVER \u003d ${LWS_WITHOUT_SERVER}\u0022)\nmessage(\u0022 LWS_LINK_TESTAPPS_DYNAMIC \u003d ${LWS_LINK_TESTAPPS_DYNAMIC}\u0022)\nmessage(\u0022 LWS_WITHOUT_TESTAPPS \u003d ${LWS_WITHOUT_TESTAPPS}\u0022)\nmessage(\u0022 LWS_WITHOUT_TEST_SERVER \u003d ${LWS_WITHOUT_TEST_SERVER}\u0022)\nmessage(\u0022 LWS_WITHOUT_TEST_SERVER_EXTPOLL \u003d ${LWS_WITHOUT_TEST_SERVER_EXTPOLL}\u0022)\nmessage(\u0022 LWS_WITHOUT_TEST_PING \u003d ${LWS_WITHOUT_TEST_PING}\u0022)\nmessage(\u0022 LWS_WITHOUT_TEST_CLIENT \u003d ${LWS_WITHOUT_TEST_CLIENT}\u0022)\nmessage(\u0022 LWS_WITHOUT_EXTENSIONS \u003d ${LWS_WITHOUT_EXTENSIONS}\u0022)\nmessage(\u0022 LWS_WITHOUT_DAEMONIZE \u003d ${LWS_WITHOUT_DAEMONIZE}\u0022)\nmessage(\u0022 LWS_WITH_LIBEV \u003d ${LWS_WITH_LIBEV}\u0022)\nmessage(\u0022 LWS_WITH_LIBUV \u003d ${LWS_WITH_LIBUV}\u0022)\nmessage(\u0022 LWS_WITH_LIBEVENT \u003d ${LWS_WITH_LIBEVENT}\u0022)\nmessage(\u0022 LWS_IPV6 \u003d ${LWS_IPV6}\u0022)\nmessage(\u0022 LWS_UNIX_SOCK \u003d ${LWS_UNIX_SOCK}\u0022)\nmessage(\u0022 LWS_WITH_HTTP2 \u003d ${LWS_WITH_HTTP2}\u0022)\nmessage(\u0022 LWS_SSL_SERVER_WITH_ECDH_CERT \u003d ${LWS_SSL_SERVER_WITH_ECDH_CERT}\u0022)\nmessage(\u0022 LWS_MAX_SMP \u003d ${LWS_MAX_SMP}\u0022)\nmessage(\u0022 LWS_HAVE_PTHREAD_H \u003d ${LWS_HAVE_PTHREAD_H}\u0022)\nmessage(\u0022 LWS_WITH_CGI \u003d ${LWS_WITH_CGI}\u0022)\nmessage(\u0022 LWS_HAVE_OPENSSL_ECDH_H \u003d ${LWS_HAVE_OPENSSL_ECDH_H}\u0022)\nmessage(\u0022 LWS_HAVE_SSL_CTX_set1_param \u003d ${LWS_HAVE_SSL_CTX_set1_param}\u0022)\nmessage(\u0022 LWS_HAVE_RSA_SET0_KEY \u003d ${LWS_HAVE_RSA_SET0_KEY}\u0022)\nmessage(\u0022 LWS_WITH_HTTP_PROXY \u003d ${LWS_WITH_HTTP_PROXY}\u0022)\nmessage(\u0022 LIBHUBBUB_LIBRARIES \u003d ${LIBHUBBUB_LIBRARIES}\u0022)\nmessage(\u0022 PLUGINS \u003d ${PLUGINS_LIST}\u0022)\nmessage(\u0022 LWS_WITH_ACCESS_LOG \u003d ${LWS_WITH_ACCESS_LOG}\u0022)\nmessage(\u0022 LWS_WITH_SERVER_STATUS \u003d ${LWS_WITH_SERVER_STATUS}\u0022)\nmessage(\u0022 LWS_WITH_LEJP \u003d ${LWS_WITH_LEJP}\u0022)\nmessage(\u0022 LWS_WITH_LEJP_CONF \u003d ${LWS_WITH_LEJP_CONF}\u0022)\nmessage(\u0022 LWS_WITH_SMTP \u003d ${LWS_WITH_SMTP}\u0022)\nmessage(\u0022 LWS_WITH_GENERIC_SESSIONS \u003d ${LWS_WITH_GENERIC_SESSIONS}\u0022)\nmessage(\u0022 LWS_STATIC_PIC \u003d ${LWS_STATIC_PIC}\u0022)\nmessage(\u0022 LWS_WITH_RANGES \u003d ${LWS_WITH_RANGES}\u0022)\nmessage(\u0022 LWS_PLAT_OPTEE \u003d ${LWS_PLAT_OPTEE}\u0022)\nmessage(\u0022 LWS_PLAT_FREERTOS \u003d ${LWS_PLAT_FREERTOS}\u0022)\nmessage(\u0022 LWS_WITH_ZIP_FOPS \u003d ${LWS_WITH_ZIP_FOPS}\u0022)\nmessage(\u0022 LWS_AVOID_SIGPIPE_IGN \u003d ${LWS_AVOID_SIGPIPE_IGN}\u0022)\nmessage(\u0022 LWS_WITH_STATS \u003d ${LWS_WITH_STATS}\u0022)\nmessage(\u0022 LWS_WITH_SOCKS5 \u003d ${LWS_WITH_SOCKS5}\u0022)\nmessage(\u0022 LWS_HAVE_SYS_CAPABILITY_H \u003d ${LWS_HAVE_SYS_CAPABILITY_H}\u0022)\nmessage(\u0022 LWS_HAVE_LIBCAP \u003d ${LWS_HAVE_LIBCAP}\u0022)\nmessage(\u0022 LWS_WITH_PEER_LIMITS \u003d ${LWS_WITH_PEER_LIMITS}\u0022)\nmessage(\u0022 LWS_HAVE_ATOLL \u003d ${LWS_HAVE_ATOLL}\u0022)\nmessage(\u0022 LWS_HAVE__ATOI64 \u003d ${LWS_HAVE__ATOI64}\u0022)\nmessage(\u0022 LWS_HAVE_STAT32I64 \u003d ${LWS_HAVE_STAT32I64}\u0022)\nmessage(\u0022 LWS_HAS_INTPTR_T \u003d ${LWS_HAS_INTPTR_T}\u0022)\nmessage(\u0022 LWS_WITH_EXPORT_LWSTARGETS \u003d ${LWS_WITH_EXPORT_LWSTARGETS}\u0022)\nmessage(\u0022 LWS_WITH_ABSTRACT \u003d ${LWS_WITH_ABSTRACT}\u0022)\n\nmessage(\u0022---------------------------------------------------------------------\u0022)\n\n# These will be available to parent projects including libwebsockets using add_subdirectory()\nset(LIBWEBSOCKETS_LIBRARIES ${LWS_LIBRARIES} CACHE STRING \u0022Libwebsocket libraries\u0022)\nif (LWS_WITH_STATIC)\n\tset(LIBWEBSOCKETS_LIBRARIES_STATIC websockets CACHE STRING \u0022Libwebsocket static library\u0022)\nendif()\nif (LWS_WITH_SHARED)\n\tset(LIBWEBSOCKETS_LIBRARIES_SHARED websockets_shared CACHE STRING \u0022Libwebsocket shared library\u0022)\nendif()\n\nif (LWS_WITH_MINIMAL_EXAMPLES)\n\tMACRO(SUBDIRLIST result curdir)\n\t FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)\n\t SET(dirlist \u0022\u0022)\n\n\t FOREACH(child ${children})\n\t IF(IS_DIRECTORY ${curdir}/${child})\n\t\tLIST(APPEND dirlist ${child})\n\t ENDIF()\n\t ENDFOREACH()\n\n\t SET(${result} ${dirlist})\n\tENDMACRO()\n\n\tSUBDIRLIST(SUBDIRS \u0022${PROJECT_SOURCE_DIR}/minimal-examples\u0022)\n\tFOREACH(subdir ${SUBDIRS})\n\n\t\tSUBDIRLIST(SUBDIRS2 \u0022${PROJECT_SOURCE_DIR}/minimal-examples/${subdir}\u0022)\n\t\tFOREACH(subdir2 ${SUBDIRS2})\n\t\t\tif (EXISTS \u0022${PROJECT_SOURCE_DIR}/minimal-examples/${subdir}/${subdir2}/CMakeLists.txt\u0022)\n\t\t\t\tmessage(\u0022Processing ${PROJECT_SOURCE_DIR}/minimal-examples/${subdir}/${subdir2}\u0022)\n\t\t\t\tadd_subdirectory(\u0022${PROJECT_SOURCE_DIR}/minimal-examples/${subdir}/${subdir2}\u0022)\n\t\t\tendif()\n\t\tENDFOREACH()\n\tENDFOREACH()\nENDIF()\n\n# This must always be last!\ninclude(CPack)\n","s":{"c":1571311425,"u": 2887}} ],"g": 84321,"chitpc": 0,"ehitpc": 0, "indexed":0 }