2019-02-21 03:59:07 +01:00
|
|
|
#
|
|
|
|
# Author: Benjamin Sergeant
|
|
|
|
# Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
|
|
|
|
#
|
|
|
|
|
|
|
|
cmake_minimum_required (VERSION 3.4.1)
|
2019-02-22 06:24:53 +01:00
|
|
|
project (ws)
|
2019-02-21 03:59:07 +01:00
|
|
|
|
|
|
|
# There's -Weverything too for clang
|
2019-04-16 17:51:57 +02:00
|
|
|
if (NOT WIN32)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
|
|
|
|
endif()
|
2019-02-21 03:59:07 +01:00
|
|
|
|
2019-04-23 02:24:01 +02:00
|
|
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
|
|
|
|
# set(CMAKE_LD_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
|
2019-04-12 01:03:05 +02:00
|
|
|
|
2019-02-21 03:59:07 +01:00
|
|
|
set (CMAKE_CXX_STANDARD 14)
|
|
|
|
|
|
|
|
option(USE_TLS "Add TLS support" ON)
|
|
|
|
|
2019-02-22 06:24:53 +01:00
|
|
|
include_directories(ws .)
|
2019-02-23 05:49:26 +01:00
|
|
|
include_directories(ws ..)
|
2019-02-22 06:24:53 +01:00
|
|
|
include_directories(ws ../third_party)
|
2019-05-10 00:30:44 +02:00
|
|
|
include_directories(ws ../third_party/spdlog/include)
|
2019-07-25 20:54:50 +02:00
|
|
|
include_directories(ws ../third_party/cpp-linenoise)
|
2019-02-21 03:59:07 +01:00
|
|
|
|
2019-12-25 18:03:57 +01:00
|
|
|
add_definitions(-DSPDLOG_COMPILED_LIB=1)
|
|
|
|
|
2019-12-04 01:01:46 +01:00
|
|
|
find_package(JsonCpp)
|
|
|
|
if (NOT JSONCPP_FOUND)
|
|
|
|
include_directories(../third_party/jsoncpp)
|
|
|
|
set(JSONCPP_SOURCES ../third_party/jsoncpp/jsoncpp.cpp)
|
|
|
|
endif()
|
|
|
|
|
2020-06-25 08:21:19 +02:00
|
|
|
find_package(Python COMPONENTS Development)
|
|
|
|
if (NOT Python_FOUND)
|
|
|
|
message(FATAL_ERROR "Python3 not found")
|
|
|
|
endif()
|
|
|
|
message("Python_FOUND:${Python_FOUND}")
|
|
|
|
message("Python_VERSION:${Python_VERSION}")
|
|
|
|
message("Python_Development_FOUND:${Python_Development_FOUND}")
|
|
|
|
message("Python_LIBRARIES:${Python_LIBRARIES}")
|
|
|
|
|
2020-03-22 03:31:38 +01:00
|
|
|
add_executable(ws
|
2019-02-22 06:24:53 +01:00
|
|
|
../third_party/msgpack11/msgpack11.cpp
|
2020-06-12 03:01:45 +02:00
|
|
|
../third_party/cpp-linenoise/linenoise.cpp
|
2019-12-04 01:01:46 +01:00
|
|
|
${JSONCPP_SOURCES}
|
2019-04-21 20:20:17 +02:00
|
|
|
|
2019-03-01 06:54:03 +01:00
|
|
|
ws_http_client.cpp
|
2019-02-23 06:47:57 +01:00
|
|
|
ws_ping_pong.cpp
|
2019-02-23 06:13:56 +01:00
|
|
|
ws_broadcast_server.cpp
|
|
|
|
ws_echo_server.cpp
|
2019-02-23 05:49:26 +01:00
|
|
|
ws_chat.cpp
|
|
|
|
ws_connect.cpp
|
2019-02-22 06:24:53 +01:00
|
|
|
ws_transfer.cpp
|
|
|
|
ws_send.cpp
|
|
|
|
ws_receive.cpp
|
2020-06-12 02:30:42 +02:00
|
|
|
ws_redis_cli.cpp
|
2019-03-20 22:29:02 +01:00
|
|
|
ws_redis_publish.cpp
|
|
|
|
ws_redis_subscribe.cpp
|
2019-09-24 06:04:01 +02:00
|
|
|
ws_redis_server.cpp
|
2019-09-23 20:46:16 +02:00
|
|
|
ws_snake.cpp
|
2019-09-19 21:51:11 +02:00
|
|
|
ws_cobra_metrics_publish.cpp
|
2019-04-21 20:16:33 +02:00
|
|
|
ws_cobra_publish.cpp
|
2019-06-23 23:54:21 +02:00
|
|
|
ws_httpd.cpp
|
2019-09-01 01:46:44 +02:00
|
|
|
ws_autobahn.cpp
|
2019-11-15 23:30:20 +01:00
|
|
|
ws_proxy_server.cpp
|
2019-11-26 06:08:43 +01:00
|
|
|
ws_sentry_minidump_upload.cpp
|
2020-01-23 06:11:48 +01:00
|
|
|
ws_dns_lookup.cpp
|
2019-02-22 06:24:53 +01:00
|
|
|
ws.cpp)
|
2019-02-21 03:59:07 +01:00
|
|
|
|
2020-03-23 05:57:58 +01:00
|
|
|
# library with the most dependencies come first
|
|
|
|
target_link_libraries(ws ixbots)
|
2019-09-23 21:30:46 +02:00
|
|
|
target_link_libraries(ws ixsnake)
|
2019-09-10 21:19:22 +02:00
|
|
|
target_link_libraries(ws ixcobra)
|
2020-03-23 05:57:58 +01:00
|
|
|
target_link_libraries(ws ixsentry)
|
2020-06-11 07:30:55 +02:00
|
|
|
target_link_libraries(ws ixredis)
|
2019-02-22 06:24:53 +01:00
|
|
|
target_link_libraries(ws ixwebsocket)
|
2019-09-23 21:30:46 +02:00
|
|
|
target_link_libraries(ws ixcrypto)
|
|
|
|
target_link_libraries(ws ixcore)
|
2019-04-16 17:51:57 +02:00
|
|
|
|
2019-12-25 18:03:57 +01:00
|
|
|
target_link_libraries(ws spdlog)
|
2020-06-25 08:21:19 +02:00
|
|
|
if (NOT WIN32)
|
|
|
|
target_link_libraries(ws ${Python_LIBRARIES})
|
|
|
|
endif()
|
2019-12-25 18:03:57 +01:00
|
|
|
|
2019-12-04 01:01:46 +01:00
|
|
|
if (JSONCPP_FOUND)
|
|
|
|
target_include_directories(ws PUBLIC ${JSONCPP_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(ws ${JSONCPP_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2019-02-22 07:05:30 +01:00
|
|
|
install(TARGETS ws RUNTIME DESTINATION bin)
|