File tree Expand file tree Collapse file tree 7 files changed +514
-231
lines changed Expand file tree Collapse file tree 7 files changed +514
-231
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE inja)
68
68
include (cmake/BuildLexbor.cmake )
69
69
target_link_libraries (${CMAKE_PROJECT_NAME} PRIVATE liblexbor_internal )
70
70
71
+ include (cmake/FetchWebsocketpp.cmake )
72
+
71
73
target_include_directories (${CMAKE_PROJECT_NAME} PRIVATE vendor/nlohmann-json )
72
74
73
75
target_sources (
@@ -76,6 +78,7 @@ target_sources(
76
78
src/obs-source-util.cpp
77
79
src/mapping-data.cpp
78
80
src/request-data.cpp
81
+ src/websocket-client.cpp
79
82
src/ui/CustomTextDocument.cpp
80
83
src/ui/RequestBuilder.cpp
81
84
src/ui/text-render-helper.cpp
Original file line number Diff line number Diff line change
1
+ if (WIN32 OR APPLE )
2
+ # Windows and macOS are supported by the prebuilt dependencies
3
+
4
+ if (NOT buildspec )
5
+ file (READ "${CMAKE_SOURCE_DIR} /buildspec.json" buildspec )
6
+ endif ()
7
+
8
+ string (
9
+ JSON
10
+ version
11
+ GET
12
+ ${buildspec}
13
+ dependencies
14
+ prebuilt
15
+ version )
16
+
17
+ if (MSVC )
18
+ set (arch ${CMAKE_GENERATOR_PLATFORM} )
19
+ elseif (APPLE )
20
+ set (arch universal )
21
+ endif ()
22
+
23
+ set (deps_root "${CMAKE_SOURCE_DIR} /.deps/obs-deps-${version} -${arch} " )
24
+ target_include_directories (${CMAKE_PROJECT_NAME} PRIVATE "${deps_root} /include" )
25
+ else ()
26
+ # Linux requires fetching the dependencies
27
+ include (FetchContent )
28
+
29
+ FetchContent_Declare (
30
+ websocketpp
31
+ URL https://github.com/zaphoyd/websocketpp/archive/refs/tags/0.8.2.tar.gz
32
+ URL_HASH SHA256=6ce889d85ecdc2d8fa07408d6787e7352510750daa66b5ad44aacb47bea76755 )
33
+
34
+ # Only download the content, don't configure or build it
35
+ FetchContent_GetProperties (websocketpp )
36
+
37
+ if (NOT websocketpp_POPULATED )
38
+ FetchContent_Populate (websocketpp )
39
+ endif ()
40
+
41
+ # Add WebSocket++ as an interface library
42
+ add_library (websocketpp INTERFACE )
43
+ target_include_directories (websocketpp INTERFACE ${websocketpp_SOURCE_DIR} )
44
+
45
+ # Fetch ASIO
46
+ FetchContent_Declare (
47
+ asio
48
+ URL https://github.com/chriskohlhoff/asio/archive/asio-1-28-0.tar.gz
49
+ URL_HASH SHA256=226438b0798099ad2a202563a83571ce06dd13b570d8fded4840dbc1f97fa328 )
50
+
51
+ FetchContent_MakeAvailable (websocketpp asio )
52
+
53
+ target_link_libraries (${CMAKE_PROJECT_NAME} PRIVATE websocketpp )
54
+ target_include_directories (${CMAKE_PROJECT_NAME} PRIVATE ${asio_SOURCE_DIR} /asio/include/ )
55
+ endif ()
56
+
57
+ message (STATUS "WebSocket++ and ASIO have been added to the project" )
You can’t perform that action at this time.
0 commit comments