| | |
| | | set(CMAKE_POSITION_INDEPENDENT_CODE ON) |
| | | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
| | | |
| | | |
| | | option(ENABLE_WEBSOCKET "Whether to build websocket server" ON) |
| | | |
| | | if(ENABLE_WEBSOCKET) |
| | | # cmake_policy(SET CMP0135 NEW) |
| | | |
| | | include(FetchContent) |
| | | FetchContent_Declare(websocketpp |
| | | GIT_REPOSITORY https://github.com/zaphoyd/websocketpp.git |
| | |
| | | FetchContent_MakeAvailable(websocketpp) |
| | | include_directories(${PROJECT_SOURCE_DIR}/third_party/websocket) |
| | | |
| | | |
| | | FetchContent_Declare(asio |
| | | URL https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-1-24-0.tar.gz |
| | | SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/asio |
| | |
| | | |
| | | FetchContent_MakeAvailable(json) |
| | | include_directories(${PROJECT_SOURCE_DIR}/third_party/json/include) |
| | | |
| | | |
| | | |
| | | endif() |
| | | |
| | |
| | | # install openssl first apt-get install libssl-dev |
| | | find_package(OpenSSL REQUIRED) |
| | | |
| | | add_executable(websocketmain "websocketmain.cpp" "websocketsrv.cpp") |
| | | add_executable(websocketclient "websocketclient.cpp") |
| | | add_executable(funasr-ws-server "funasr-ws-server.cpp" "websocket-server.cpp") |
| | | add_executable(funasr-ws-client "funasr-ws-client.cpp") |
| | | |
| | | target_link_libraries(websocketclient PUBLIC funasr ssl crypto) |
| | | target_link_libraries(websocketmain PUBLIC funasr ssl crypto) |
| | | target_link_libraries(funasr-ws-client PUBLIC funasr ssl crypto) |
| | | target_link_libraries(funasr-ws-server PUBLIC funasr ssl crypto) |