diff --git a/.gitmodules b/.gitmodules index 5e50c006..6aef5b6a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,3 +43,9 @@ [submodule "external/imguifiledialog"] path = external/imguifiledialog url = https://github.com/aiekick/ImGuiFileDialog +[submodule "external/asio"] + path = external/asio + url = https://github.com/chriskohlhoff/asio.git +[submodule "external/websocketpp"] + path = external/websocketpp + url = https://github.com/zaphoyd/websocketpp.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 33066b80..8b80522c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,6 @@ if (BUILD_CODE) # Optional dependencies find_package (Python3 COMPONENTS Interpreter Development) find_package(OpenCV) - find_package(websocketpp) pkg_search_module(GPHOTO libgphoto2) pkg_search_module(JACK jack) @@ -170,7 +169,6 @@ set(HAVE_PORTAUDIO ${PORTAUDIO_FOUND}) set(HAVE_SH4LT ${SH4LT_FOUND}) set(HAVE_SHMDATA ${SHMDATA_FOUND}) set(HAVE_PYTHON ${Python3_FOUND}) -set(HAVE_WEBSOCKETPP ${websocketpp_FOUND}) set(HAVE_PORTABLE ${WITH_PORTABLE}) if (FFMPEG_libavformat_VERSION LESS 57) @@ -336,7 +334,6 @@ info_cfg_option(Python3_VERSION) info_cfg_option(JSONCPP_VERSION) info_cfg_option(SH4LT_VERSION) info_cfg_option(SHMDATA_VERSION) -info_cfg_option(websocketpp_VERSION) info_cfg_option(ZMQ_VERSION) info_cfg_option(DOXYGEN_FOUND) info_cfg_option(ZIP) diff --git a/external/asio b/external/asio new file mode 160000 index 00000000..7609450f --- /dev/null +++ b/external/asio @@ -0,0 +1 @@ +Subproject commit 7609450f71434bdc9fbd9491a9505b423c2a8496 diff --git a/external/build_asio.sh b/external/build_asio.sh new file mode 100755 index 00000000..69fb3151 --- /dev/null +++ b/external/build_asio.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +SOURCE_DIR="$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)" + +cd ${SOURCE_DIR}/asio/asio +./autogen.sh +./configure --prefix=${SOURCE_DIR}/third_parties +make -j$(nproc) && make install diff --git a/external/websocketpp b/external/websocketpp new file mode 160000 index 00000000..26672095 --- /dev/null +++ b/external/websocketpp @@ -0,0 +1 @@ +Subproject commit 266720951c529c3c58b13734b0a08a2473da261b diff --git a/make_deps.sh b/make_deps.sh index 0fa26a39..1024497a 100755 --- a/make_deps.sh +++ b/make_deps.sh @@ -22,3 +22,7 @@ echo "Building ZMQ..." # Sh4lt echo "Building Sh4lt..." ./build_sh4lt.sh + +# Asio +echo "Building Asio..." +./build_asio.sh diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d6d3527..aa0ac866 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -110,6 +110,7 @@ include_directories(../external/stb) include_directories(../external/tracy/public) include_directories(../external/stduuid/include) include_directories(../external/stduuid) +include_directories(../external/websocketpp) include_directories(${GLFW_INCLUDE_DIRS}) include_directories(${LO_INCLUDE_DIRS}) @@ -179,6 +180,7 @@ target_sources(splash-${API_VERSION} PRIVATE controller/controller_blender.cpp controller/controller_gui.cpp controller/controller_texcoord.cpp + controller/controller_websocket.cpp controller/widget/widget.cpp controller/widget/widget_attributes.cpp controller/widget/widget_control.cpp @@ -360,12 +362,6 @@ if (HAVE_PYTHON) ) endif() -if (HAVE_WEBSOCKETPP) - target_sources(splash-${API_VERSION} PRIVATE - controller/controller_websocket.cpp - ) -endif() - # Stdlib if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0.0") diff --git a/src/config.h.in b/src/config.h.in index 5a70fc67..09b7f3d0 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -37,9 +37,6 @@ /* Defined to 1 if python3.x is detected */ #cmakedefine01 HAVE_PYTHON -/* Defined to 1 if websocketpp is detected */ -#cmakedefine01 HAVE_WEBSOCKETPP - /* Support mmx instructions */ #cmakedefine01 HAVE_MMX diff --git a/src/core/scene.cpp b/src/core/scene.cpp index 57c48004..da6a9b80 100644 --- a/src/core/scene.cpp +++ b/src/core/scene.cpp @@ -12,9 +12,7 @@ #include "./controller/controller_osc.h" #endif #include "./controller/controller_texcoord.h" -#if HAVE_WEBSOCKETPP #include "./controller/controller_websocket.h" -#endif #include "./core/constants.h" #include "./graphics/profiler_gl.h" #include "./graphics/texture.h" @@ -529,14 +527,12 @@ void Scene::setAsMaster(const std::string& configFilePath) } #endif -#if HAVE_WEBSOCKETPP _websocket = std::make_shared(this); if (_websocket) { _websocket->setName("websocket"); _objects["websocket"] = _websocket; } -#endif _keyboard = std::make_shared(this); _mouse = std::make_shared(this);