2018-10-08 15:23:01 -07:00
|
|
|
#
|
|
|
|
# Author: Benjamin Sergeant
|
|
|
|
# Copyright (c) 2018 Machine Zone, Inc. All rights reserved.
|
|
|
|
#
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 3.4.1)
|
|
|
|
project(ixwebsocket C CXX)
|
|
|
|
|
|
|
|
set (CMAKE_CXX_STANDARD 11)
|
|
|
|
set (CXX_STANDARD_REQUIRED ON)
|
|
|
|
set (CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
|
2018-12-29 23:15:27 -08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wshorten-64-to-32")
|
|
|
|
|
2018-10-08 15:23:01 -07:00
|
|
|
set( IXWEBSOCKET_SOURCES
|
2018-11-01 17:02:49 -07:00
|
|
|
ixwebsocket/IXEventFd.cpp
|
2018-10-08 15:23:01 -07:00
|
|
|
ixwebsocket/IXSocket.cpp
|
2018-12-09 14:07:40 -08:00
|
|
|
ixwebsocket/IXSocketConnect.cpp
|
2018-12-14 16:28:11 -08:00
|
|
|
ixwebsocket/IXDNSLookup.cpp
|
2018-10-08 15:23:01 -07:00
|
|
|
ixwebsocket/IXWebSocket.cpp
|
2018-12-29 23:15:27 -08:00
|
|
|
ixwebsocket/IXWebSocketServer.cpp
|
2018-10-08 15:23:01 -07:00
|
|
|
ixwebsocket/IXWebSocketTransport.cpp
|
2018-11-07 12:26:32 -08:00
|
|
|
ixwebsocket/IXWebSocketPerMessageDeflate.cpp
|
2018-11-09 18:23:49 -08:00
|
|
|
ixwebsocket/IXWebSocketPerMessageDeflateOptions.cpp
|
2018-10-08 15:23:01 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
set( IXWEBSOCKET_HEADERS
|
2018-11-01 17:02:49 -07:00
|
|
|
ixwebsocket/IXEventFd.h
|
2018-10-08 15:23:01 -07:00
|
|
|
ixwebsocket/IXSocket.h
|
2018-12-09 14:07:40 -08:00
|
|
|
ixwebsocket/IXSocketConnect.h
|
2018-12-23 14:14:38 -08:00
|
|
|
ixwebsocket/IXSetThreadName.h
|
2018-12-14 16:28:11 -08:00
|
|
|
ixwebsocket/IXDNSLookup.h
|
2018-12-29 18:33:15 -08:00
|
|
|
ixwebsocket/IXCancellationRequest.h
|
2018-10-08 15:23:01 -07:00
|
|
|
ixwebsocket/IXWebSocket.h
|
2018-12-29 23:15:27 -08:00
|
|
|
ixwebsocket/IXWebSocketServer.h
|
2018-10-08 15:23:01 -07:00
|
|
|
ixwebsocket/IXWebSocketTransport.h
|
2018-11-12 17:56:59 -08:00
|
|
|
ixwebsocket/IXWebSocketSendInfo.h
|
2018-12-29 18:33:15 -08:00
|
|
|
ixwebsocket/IXWebSocketErrorInfo.h
|
2018-11-07 12:26:32 -08:00
|
|
|
ixwebsocket/IXWebSocketPerMessageDeflate.h
|
2018-11-09 18:23:49 -08:00
|
|
|
ixwebsocket/IXWebSocketPerMessageDeflateOptions.h
|
|
|
|
ixwebsocket/IXWebSocketHttpHeaders.h
|
2018-10-08 15:23:01 -07:00
|
|
|
)
|
|
|
|
|
2018-12-29 18:33:15 -08:00
|
|
|
# Platform specific code
|
|
|
|
if (APPLE)
|
|
|
|
list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/apple/IXSetThreadName_apple.cpp)
|
|
|
|
else()
|
|
|
|
list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/linux/IXSetThreadName_linux.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2018-10-08 15:23:01 -07:00
|
|
|
if (USE_TLS)
|
|
|
|
add_definitions(-DIXWEBSOCKET_USE_TLS)
|
|
|
|
|
|
|
|
if (APPLE)
|
|
|
|
list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketAppleSSL.h)
|
|
|
|
list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketAppleSSL.cpp)
|
2018-12-29 18:33:15 -08:00
|
|
|
elseif (WIN32)
|
|
|
|
list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketSChannel.h)
|
|
|
|
list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketSChannel.cpp)
|
2018-10-08 15:23:01 -07:00
|
|
|
else()
|
|
|
|
list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketOpenSSL.h)
|
|
|
|
list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketOpenSSL.cpp)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library( ixwebsocket STATIC
|
|
|
|
${IXWEBSOCKET_SOURCES}
|
|
|
|
${IXWEBSOCKET_HEADERS}
|
|
|
|
)
|
|
|
|
|
2018-11-07 12:26:32 -08:00
|
|
|
target_link_libraries(ixwebsocket "z")
|
|
|
|
|
2018-10-08 15:23:01 -07:00
|
|
|
set( IXWEBSOCKET_INCLUDE_DIRS
|
|
|
|
.
|
|
|
|
../../shared/OpenSSL/include)
|
|
|
|
target_include_directories( ixwebsocket PUBLIC ${IXWEBSOCKET_INCLUDE_DIRS} )
|