2020-05-22 16:47:40 +01:00
|
|
|
#
|
|
|
|
# libwebsockets - small server side websockets and web server implementation
|
|
|
|
#
|
|
|
|
# Copyright (C) 2010 - 2020 Andy Green <andy@warmcat.com>
|
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to
|
|
|
|
# deal in the Software without restriction, including without limitation the
|
|
|
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
# sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
|
|
# IN THE SOFTWARE.
|
|
|
|
#
|
|
|
|
|
|
|
|
include_directories(.)
|
|
|
|
|
|
|
|
macro(add_subdir_include_dirs arg1)
|
|
|
|
add_subdirectory(${arg1})
|
|
|
|
list(APPEND LWS_LIB_BUILD_INC_PATHS ${_CMAKE_INC_LIST})
|
|
|
|
endmacro()
|
|
|
|
|
ss: static policy: dynamic vhost instantiation
Presently a vh is allocated per trust store at policy parsing-time, this
is no problem on a linux-class device or if you decide you need a dynamic
policy for functionality reasons.
However if you're in a constrained enough situation that the static policy
makes sense, in the case your trust stores do not have 100% duty cycle, ie,
are anyway always in use, the currently-unused vhosts and their x.509 stack
are sitting there taking up heap for no immediate benefit.
This patch modifies behaviour in ..._STATIC_POLICY_ONLY so that vhosts and
associated x.509 tls contexts are not instantiated until a secure stream using
them is created; they are refcounted, and when the last logical secure
stream using a vhost is destroyed, the vhost and its tls context is also
destroyed.
If another ss connection is created that wants to use the trust store, the
vhost and x.509 context is regenerated again as needed.
Currently the refcounting is by ss, it's also possible to move the refcounting
to be by connection. The choice is between the delay to generate the vh
being visisble at logical ss creation-time, or at connection-time. It's anyway
not preferable to have ss instantiated and taking up space with no associated
connection or connection attempt underway.
NB you will need to reprocess any static policies after this patch so they
conform to the trust_store changes.
2020-07-20 07:28:28 +01:00
|
|
|
set(LWS_LIB_INCLUDES "")
|
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
#
|
|
|
|
# Plat specific build items
|
|
|
|
#
|
|
|
|
|
|
|
|
if (LWS_PLAT_FREERTOS)
|
|
|
|
add_subdir_include_dirs(plat/freertos)
|
|
|
|
if (ESP_PLATFORM)
|
2022-02-01 07:59:41 +00:00
|
|
|
list(APPEND LWS_ESP_IDF_DIRS
|
|
|
|
$ENV{IDF_PATH}/components/freertos/include
|
2021-08-26 12:31:06 +01:00
|
|
|
$ENV{IDF_PATH}/components/esp_hw_support/include/soc/
|
|
|
|
$ENV{IDF_PATH}/components/esp_common/include
|
|
|
|
$ENV{IDF_PATH}/components/esp_timer/include
|
|
|
|
$ENV{IDF_PATH}/components/soc/include
|
|
|
|
$ENV{IDF_PATH}/components/soc/src/esp32/include
|
|
|
|
$ENV{IDF_PATH}/components/lwip/port/esp32/include
|
|
|
|
$ENV{IDF_PATH}/components/lwip/lwip/src/include
|
|
|
|
$ENV{IDF_PATH}/components/lwip/port/esp32/include
|
|
|
|
${CMAKE_BINARY_DIR}/config
|
|
|
|
$ENV{IDF_PATH}/components/esp_rom/include
|
|
|
|
$ENV{IDF_PATH}/components/esp_system/include
|
|
|
|
$ENV{IDF_PATH}/components/lwip/include/apps/sntp
|
|
|
|
$ENV{IDF_PATH}/components/soc/soc/esp32/include
|
|
|
|
$ENV{IDF_PATH}/components/heap/include
|
|
|
|
$ENV{IDF_PATH}/components/mbedtls/mbedtls/include
|
|
|
|
$ENV{IDF_PATH}/components/mbedtls/port/include
|
|
|
|
$ENV{IDF_PATH}/components/esp_wifi/include
|
|
|
|
$ENV{IDF_PATH}/components/esp_event/include
|
|
|
|
$ENV{IDF_PATH}/components/esp_netif/include
|
|
|
|
$ENV{IDF_PATH}/components/esp_eth/include
|
|
|
|
$ENV{IDF_PATH}/components/driver/include
|
|
|
|
$ENV{IDF_PATH}/components/soc/soc/include
|
|
|
|
$ENV{IDF_PATH}/components/tcpip_adapter/include
|
|
|
|
$ENV{IDF_PATH}/components/lwip/include/apps
|
|
|
|
$ENV{IDF_PATH}/components/nvs_flash/include
|
|
|
|
$ENV{IDF_PATH}/components/esp32/include
|
|
|
|
$ENV{IDF_PATH}/components/spi_flash/include
|
|
|
|
$ENV{IDF_PATH}/components/mdns/include
|
|
|
|
$ENV{IDF_PATH}/components/lwip/lwip/src/include/lwip
|
|
|
|
$ENV{IDF_PATH}/components/lwip/lwip/src/include
|
|
|
|
$ENV{IDF_PATH}/components/lwip/lwip/src/include/lwip
|
|
|
|
$ENV{IDF_PATH}/components/newlib/platform_include )
|
2022-02-01 07:59:41 +00:00
|
|
|
|
|
|
|
include_directories(${LWS_ESP_IDF_DIRS})
|
|
|
|
|
|
|
|
list(APPEND CMAKE_REQUIRED_INCLUDES ${LWS_ESP_IDF_DIRS})
|
2020-05-22 16:47:40 +01:00
|
|
|
endif()
|
2022-02-01 07:59:41 +00:00
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
|
|
|
|
else()
|
2021-08-30 10:20:07 +01:00
|
|
|
if (LWS_PLAT_BAREMETAL)
|
2021-08-25 09:35:07 +01:00
|
|
|
# add_subdir_include_dirs(plat/baremetal)
|
2020-05-22 16:47:40 +01:00
|
|
|
else()
|
2021-08-30 10:20:07 +01:00
|
|
|
if (LWS_PLAT_OPTEE)
|
|
|
|
add_subdir_include_dirs(plat/optee)
|
2020-05-22 16:47:40 +01:00
|
|
|
else()
|
2021-08-30 10:20:07 +01:00
|
|
|
if (WIN32)
|
|
|
|
add_subdir_include_dirs(plat/windows)
|
|
|
|
else()
|
|
|
|
add_subdir_include_dirs(plat/unix)
|
|
|
|
endif()
|
2020-05-22 16:47:40 +01:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-06-07 07:53:36 +01:00
|
|
|
if (LIB_LIST)
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${LIB_LIST} ${CMAKE_REQUIRED_LIBRARIES})
|
|
|
|
endif()
|
2020-05-22 16:47:40 +01:00
|
|
|
|
|
|
|
if (LWS_WITH_ZLIB)
|
|
|
|
if (LWS_WITH_BUNDLED_ZLIB)
|
|
|
|
if (WIN32)
|
|
|
|
# it's trying to delete internal zlib entry
|
|
|
|
LIST(REMOVE_AT CMAKE_REQUIRED_LIBRARIES 0 )
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# ideally we want to use pipe2()
|
|
|
|
|
2021-03-25 11:09:13 +03:00
|
|
|
CHECK_C_SOURCE_COMPILES("
|
|
|
|
#ifndef _GNU_SOURCE
|
|
|
|
#define _GNU_SOURCE
|
|
|
|
#endif
|
|
|
|
#include <unistd.h>
|
|
|
|
int main(void) {
|
|
|
|
int fd[2];
|
|
|
|
return pipe2(fd, 0);
|
|
|
|
}" LWS_HAVE_PIPE2)
|
2020-05-22 16:47:40 +01:00
|
|
|
|
|
|
|
# tcp keepalive needs this on linux to work practically... but it only exists
|
|
|
|
# after kernel 2.6.37
|
|
|
|
|
|
|
|
CHECK_C_SOURCE_COMPILES("#include <netinet/tcp.h>\nint main(void) { return TCP_USER_TIMEOUT; }\n" LWS_HAVE_TCP_USER_TIMEOUT)
|
2021-10-28 07:17:52 +01:00
|
|
|
set(LWS_PUBLIC_INCLUDES "")
|
2020-05-22 16:47:40 +01:00
|
|
|
if (LWS_WITH_TLS)
|
|
|
|
add_subdir_include_dirs(tls)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Generate the lws_config.h that includes all the private compilation settings.
|
|
|
|
configure_file(
|
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/lws_config_private.h.in"
|
|
|
|
"${PROJECT_BINARY_DIR}/lws_config_private.h")
|
|
|
|
|
|
|
|
add_subdir_include_dirs(core)
|
|
|
|
add_subdir_include_dirs(misc)
|
|
|
|
add_subdir_include_dirs(system)
|
|
|
|
|
2020-06-10 19:17:08 +01:00
|
|
|
if (LWS_WITH_DRIVERS)
|
|
|
|
add_subdir_include_dirs(drivers)
|
|
|
|
endif()
|
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
if (LWS_WITH_NETWORK)
|
|
|
|
add_subdir_include_dirs(core-net)
|
|
|
|
add_subdir_include_dirs(roles)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (LWS_WITH_JOSE)
|
|
|
|
add_subdir_include_dirs(jose)
|
|
|
|
endif()
|
2020-05-09 09:37:53 +01:00
|
|
|
|
2021-07-13 05:18:04 +01:00
|
|
|
if (LWS_WITH_COSE)
|
|
|
|
add_subdir_include_dirs(cose)
|
|
|
|
endif()
|
|
|
|
|
2021-08-25 09:35:07 +01:00
|
|
|
include_directories(secure-streams)
|
|
|
|
add_subdir_include_dirs(event-libs)
|
2020-05-22 16:47:40 +01:00
|
|
|
|
|
|
|
if (LWS_WITH_SECURE_STREAMS)
|
|
|
|
add_subdir_include_dirs(secure-streams)
|
|
|
|
endif()
|
2021-08-25 09:35:07 +01:00
|
|
|
add_subdir_include_dirs(secure-streams/serialized/client)
|
2020-08-27 15:37:14 +01:00
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
if (LWS_WITH_STATIC)
|
|
|
|
if (LWS_STATIC_PIC)
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(websockets STATIC ${SOURCES})# ${HDR_PUBLIC})
|
|
|
|
set_target_properties(websockets PROPERTIES LINKER_LANGUAGE C)
|
|
|
|
list(APPEND LWS_LIBRARIES websockets)
|
2021-04-11 07:16:09 +00:00
|
|
|
target_include_directories(websockets INTERFACE
|
|
|
|
$<INSTALL_INTERFACE:${LWS_INSTALL_INCLUDE_DIR}>
|
2021-04-14 13:48:04 +03:00
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include>
|
2021-04-11 07:16:09 +00:00
|
|
|
)
|
2020-05-22 16:47:40 +01:00
|
|
|
target_include_directories(websockets PRIVATE ${LWS_LIB_BUILD_INC_PATHS})
|
2020-09-06 11:46:25 +01:00
|
|
|
target_compile_definitions(websockets PRIVATE LWS_BUILDING_STATIC)
|
2021-10-28 07:17:52 +01:00
|
|
|
target_include_directories(websockets PUBLIC ${LWS_PUBLIC_INCLUDES})
|
|
|
|
set(LWS_PUBLIC_INCLUDES ${LWS_PUBLIC_INCLUDES} PARENT_SCOPE)
|
2020-05-22 16:47:40 +01:00
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
# Windows uses the same .lib ending for static libraries and shared
|
|
|
|
# library linker files, so rename the static library.
|
|
|
|
set_target_properties(websockets
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME websockets_static)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (LWS_WITH_SHARED)
|
|
|
|
if (NOT RESOURCES)
|
|
|
|
set(RESOURCES "")
|
|
|
|
endif()
|
|
|
|
|
2020-10-16 11:49:11 +02:00
|
|
|
add_library(websockets_shared SHARED ${SOURCES} ${RESOURCES})# ${HDR_PUBLIC})
|
2020-05-22 16:47:40 +01:00
|
|
|
set_target_properties(websockets_shared PROPERTIES LINKER_LANGUAGE C)
|
|
|
|
list(APPEND LWS_LIBRARIES websockets_shared)
|
2021-04-11 07:16:09 +00:00
|
|
|
target_include_directories(websockets_shared INTERFACE
|
|
|
|
$<INSTALL_INTERFACE:${LWS_INSTALL_INCLUDE_DIR}>
|
2021-04-14 13:48:04 +03:00
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include>
|
2021-04-11 07:16:09 +00:00
|
|
|
)
|
2020-05-22 16:47:40 +01:00
|
|
|
target_include_directories(websockets_shared PRIVATE ${LWS_LIB_BUILD_INC_PATHS})
|
2020-09-06 11:46:25 +01:00
|
|
|
target_compile_definitions(websockets_shared PRIVATE LWS_BUILDING_SHARED)
|
2021-10-28 07:17:52 +01:00
|
|
|
target_include_directories(websockets_shared PUBLIC ${LWS_PUBLIC_INCLUDES})
|
|
|
|
set(LWS_PUBLIC_INCLUDES ${LWS_PUBLIC_INCLUDES} PARENT_SCOPE)
|
2020-05-22 16:47:40 +01:00
|
|
|
|
|
|
|
# We want the shared lib to be named "libwebsockets"
|
|
|
|
# not "libwebsocket_shared".
|
|
|
|
set_target_properties(websockets_shared
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME websockets)
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
# Compile as DLL (export function declarations)
|
|
|
|
set_property(
|
|
|
|
TARGET websockets_shared
|
|
|
|
PROPERTY COMPILE_DEFINITIONS
|
|
|
|
LWS_DLL
|
|
|
|
LWS_INTERNAL)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (APPLE)
|
|
|
|
set_property(TARGET websockets_shared PROPERTY MACOSX_RPATH YES)
|
|
|
|
endif()
|
|
|
|
|
2020-08-31 09:19:40 +01:00
|
|
|
if (UNIX AND LWS_WITH_PLUGINS_API)
|
|
|
|
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
if (NOT((${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") OR
|
2021-03-16 20:51:31 +00:00
|
|
|
(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") OR
|
2020-08-31 09:19:40 +01:00
|
|
|
(${CMAKE_SYSTEM_NAME} MATCHES "QNX")))
|
|
|
|
if (LWS_WITH_SHARED)
|
|
|
|
target_link_libraries(websockets_shared dl)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
#
|
|
|
|
# expose the library private include dirs to plugins, test apps etc that are
|
|
|
|
# part of the lib build but different targets
|
|
|
|
#
|
|
|
|
|
|
|
|
if (LWS_WITH_SHARED)
|
|
|
|
get_target_property(LWS_LIB_INCLUDES websockets_shared INCLUDE_DIRECTORIES)
|
|
|
|
else()
|
|
|
|
get_target_property(LWS_LIB_INCLUDES websockets INCLUDE_DIRECTORIES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Set the so version of the lib.
|
|
|
|
# Equivalent to LDFLAGS=-version-info x:x:x
|
|
|
|
|
|
|
|
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
|
|
|
|
foreach(lib ${LWS_LIBRARIES})
|
|
|
|
set_target_properties(${lib}
|
|
|
|
PROPERTIES
|
|
|
|
SOVERSION ${SOVERSION})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Setup the linking for all libs.
|
|
|
|
foreach (lib ${LWS_LIBRARIES})
|
|
|
|
target_link_libraries(${lib} ${LIB_LIST})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
#
|
|
|
|
# These will be available to parent projects including libwebsockets
|
|
|
|
# using add_subdirectory()
|
|
|
|
#
|
|
|
|
set(LIBWEBSOCKETS_LIBRARIES ${LWS_LIBRARIES} CACHE STRING "Libwebsocket libraries")
|
|
|
|
if (LWS_WITH_STATIC)
|
|
|
|
set(LIBWEBSOCKETS_LIBRARIES_STATIC websockets CACHE STRING "Libwebsocket static library")
|
|
|
|
endif()
|
|
|
|
if (LWS_WITH_SHARED)
|
|
|
|
set(LIBWEBSOCKETS_LIBRARIES_SHARED websockets_shared CACHE STRING "Libwebsocket shared library")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Install libs and headers.
|
|
|
|
install(TARGETS ${LWS_LIBRARIES}
|
|
|
|
EXPORT LibwebsocketsTargets
|
2020-08-27 15:37:14 +01:00
|
|
|
LIBRARY DESTINATION "${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}" COMPONENT core
|
|
|
|
ARCHIVE DESTINATION "${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}" COMPONENT core
|
|
|
|
RUNTIME DESTINATION "${LWS_INSTALL_BIN_DIR}" COMPONENT core # Windows DLLs
|
2020-05-22 16:47:40 +01:00
|
|
|
PUBLIC_HEADER DESTINATION "${LWS_INSTALL_INCLUDE_DIR}" COMPONENT dev)
|
|
|
|
|
2020-08-27 15:37:14 +01:00
|
|
|
#set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries" PARENT_SCOPE)
|
2020-05-22 16:47:40 +01:00
|
|
|
set(CPACK_COMPONENT_DEV_DISPLAY_NAME "Development files" PARENT_SCOPE)
|
|
|
|
|
|
|
|
|
2021-09-08 19:39:53 +05:30
|
|
|
if (UNIX OR MINGW)
|
2020-05-22 16:47:40 +01:00
|
|
|
|
2020-07-18 07:00:57 +01:00
|
|
|
# figure out pkfcfg required libs here
|
|
|
|
|
|
|
|
set(lws_requires "")
|
|
|
|
if (LWS_HAVE_LIBCAP)
|
|
|
|
if (NOT lws_requires STREQUAL "")
|
2020-07-19 21:41:47 +07:00
|
|
|
set(lws_requires "${lws_requires},libcap")
|
2020-07-18 07:00:57 +01:00
|
|
|
else()
|
2020-07-19 21:41:47 +07:00
|
|
|
set(lws_requires "libcap")
|
2020-07-18 07:00:57 +01:00
|
|
|
endif()
|
|
|
|
endif()
|
2025-02-07 11:56:06 +01:00
|
|
|
if (LWS_HAVE_SYSTEMD_H)
|
|
|
|
if (NOT lws_requires STREQUAL "")
|
|
|
|
set(lws_requires "${lws_requires},libsystemd")
|
|
|
|
else()
|
|
|
|
set(lws_requires "libsystemd")
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-07-18 07:00:57 +01:00
|
|
|
|
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
# Generate and install pkgconfig.
|
|
|
|
# (This is not indented, because the tabs will be part of the output)
|
|
|
|
file(WRITE "${PROJECT_BINARY_DIR}/libwebsockets.pc"
|
|
|
|
"prefix=\"${CMAKE_INSTALL_PREFIX}\"
|
|
|
|
exec_prefix=\${prefix}
|
|
|
|
libdir=\${exec_prefix}/lib${LIB_SUFFIX}
|
|
|
|
includedir=\${prefix}/include
|
|
|
|
|
|
|
|
Name: libwebsockets
|
|
|
|
Description: Websockets server and client library
|
|
|
|
Version: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
|
|
|
|
|
|
|
Libs: -L\${libdir} -lwebsockets
|
2020-07-18 07:00:57 +01:00
|
|
|
Cflags: -I\${includedir}
|
|
|
|
"
|
2020-05-22 16:47:40 +01:00
|
|
|
)
|
2020-07-18 07:00:57 +01:00
|
|
|
if (NOT ${lws_requires} STREQUAL "")
|
|
|
|
file(APPEND "${PROJECT_BINARY_DIR}/libwebsockets.pc" "Requires: ${lws_requires}")
|
|
|
|
endif()
|
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
|
|
|
|
install(FILES "${PROJECT_BINARY_DIR}/libwebsockets.pc"
|
|
|
|
DESTINATION lib${LIB_SUFFIX}/pkgconfig)
|
|
|
|
|
|
|
|
file(WRITE "${PROJECT_BINARY_DIR}/libwebsockets_static.pc"
|
|
|
|
"prefix=\"${CMAKE_INSTALL_PREFIX}\"
|
|
|
|
exec_prefix=\${prefix}
|
|
|
|
libdir=\${exec_prefix}/lib${LIB_SUFFIX}
|
|
|
|
includedir=\${prefix}/include
|
|
|
|
|
|
|
|
Name: libwebsockets_static
|
|
|
|
Description: Websockets server and client static library
|
|
|
|
Version: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
|
|
|
|
2022-02-17 11:46:07 +00:00
|
|
|
Libs: -L\${libdir} -l:libwebsockets${CMAKE_STATIC_LIBRARY_SUFFIX}
|
2020-05-22 16:47:40 +01:00
|
|
|
Libs.private:
|
2020-07-18 07:00:57 +01:00
|
|
|
Cflags: -I\${includedir}
|
|
|
|
"
|
2020-05-22 16:47:40 +01:00
|
|
|
)
|
|
|
|
|
2020-07-18 07:00:57 +01:00
|
|
|
if (NOT ${lws_requires} STREQUAL "")
|
|
|
|
file(APPEND "${PROJECT_BINARY_DIR}/libwebsockets_static.pc" "Requires: ${lws_requires}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
install(FILES "${PROJECT_BINARY_DIR}/libwebsockets_static.pc"
|
|
|
|
DESTINATION lib${LIB_SUFFIX}/pkgconfig)
|
|
|
|
|
2021-09-08 19:39:53 +05:30
|
|
|
endif(UNIX OR MINGW)
|
2020-05-22 16:47:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Keep explicit parent scope exports at end
|
|
|
|
#
|
|
|
|
|
|
|
|
export_to_parent_intermediate()
|
2020-06-07 07:53:36 +01:00
|
|
|
if (DEFINED LWS_PLAT_UNIX)
|
|
|
|
set(LWS_PLAT_UNIX ${LWS_PLAT_UNIX} PARENT_SCOPE)
|
2020-08-08 20:09:40 -05:00
|
|
|
if (ILLUMOS)
|
|
|
|
add_definitions("-D__illumos__")
|
|
|
|
endif()
|
2020-06-07 07:53:36 +01:00
|
|
|
endif()
|
2020-05-22 16:47:40 +01:00
|
|
|
set(LWS_HAVE_MBEDTLS_NET_SOCKETS ${LWS_HAVE_MBEDTLS_NET_SOCKETS} PARENT_SCOPE)
|
2023-10-31 10:50:40 +00:00
|
|
|
set(LWS_HAVE_MBEDTLS_SSL_NEW_SESSION_TICKET ${LWS_HAVE_MBEDTLS_SSL_NEW_SESSION_TICKET} PARENT_SCOPE)
|
2023-11-02 09:54:49 +00:00
|
|
|
set(LWS_HAVE_mbedtls_ssl_conf_alpn_protocols ${LWS_HAVE_mbedtls_ssl_conf_alpn_protocols} PARENT_SCOPE)
|
2020-05-22 16:47:40 +01:00
|
|
|
set(TEST_SERVER_SSL_KEY "${TEST_SERVER_SSL_KEY}" PARENT_SCOPE)
|
|
|
|
set(TEST_SERVER_SSL_CERT "${TEST_SERVER_SSL_CERT}" PARENT_SCOPE)
|
|
|
|
set(TEST_SERVER_DATA ${TEST_SERVER_DATA} PARENT_SCOPE)
|
|
|
|
set(LWS_HAVE_PIPE2 ${LWS_HAVE_PIPE2} PARENT_SCOPE)
|
|
|
|
set(LWS_LIBRARIES ${LWS_LIBRARIES} PARENT_SCOPE)
|
2020-06-07 07:53:36 +01:00
|
|
|
if (DEFINED WIN32_HELPERS_PATH)
|
|
|
|
set(WIN32_HELPERS_PATH ${WIN32_HELPERS_PATH} PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
if (DEFINED HDR_PRIVATE)
|
2020-05-22 16:47:40 +01:00
|
|
|
set(HDR_PRIVATE ${HDR_PRIVATE} PARENT_SCOPE)
|
2020-06-07 07:53:36 +01:00
|
|
|
endif()
|
|
|
|
if (DEFINED ZLIB_FOUND)
|
|
|
|
set(ZLIB_FOUND ${ZLIB_FOUND} PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
if (DEFINED LIB_LIST_AT_END)
|
2020-05-22 16:47:40 +01:00
|
|
|
set(LIB_LIST_AT_END ${LIB_LIST_AT_END} PARENT_SCOPE)
|
2020-06-07 07:53:36 +01:00
|
|
|
endif()
|
2020-08-07 08:42:32 +01:00
|
|
|
set(USE_WOLFSSL ${USE_WOLFSSL} PARENT_SCOPE)
|
2020-08-09 10:15:45 +01:00
|
|
|
set(LWS_DEPS_LIB_PATHS ${LWS_DEPS_LIB_PATHS} PARENT_SCOPE)
|
2020-08-07 08:42:32 +01:00
|
|
|
|