From 78a1b54a47db9f17269ed5b5d07283a2b8018755 Mon Sep 17 00:00:00 2001 From: tytan652 Date: Thu, 2 Feb 2023 10:23:06 +0100 Subject: [PATCH] base,deps: Replace submodules by prefix/system install nlohmann JSON, WebSocket++ and Asio are moved from sudmodules to prefix (obs-deps) or system-wide install (Linux). --- .gitmodules | 9 --------- CMakeLists.txt | 26 ++++++++++++-------------- deps/asio | 1 - deps/json | 1 - deps/websocketpp | 1 - 5 files changed, 12 insertions(+), 26 deletions(-) delete mode 160000 deps/asio delete mode 160000 deps/json delete mode 160000 deps/websocketpp diff --git a/.gitmodules b/.gitmodules index ce13f339..13d395ad 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,3 @@ -[submodule "deps/websocketpp"] - path = deps/websocketpp - url = https://github.com/zaphoyd/websocketpp.git -[submodule "deps/asio"] - path = deps/asio - url = https://github.com/chriskohlhoff/asio.git -[submodule "deps/json"] - path = deps/json - url = https://github.com/nlohmann/json.git [submodule "deps/qr"] path = deps/qr url = https://github.com/nayuki/QR-Code-generator.git diff --git a/CMakeLists.txt b/CMakeLists.txt index c7314277..0b0690e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,11 +9,7 @@ if(NOT ENABLE_WEBSOCKET OR NOT ENABLE_UI) endif() # Submodule deps check -if(NOT - (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/deps/json/CMakeLists.txt - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/deps/websocketpp/CMakeLists.txt - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/deps/qr/cpp/QrCode.hpp - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/deps/asio/asio/include/asio.hpp)) +if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/deps/qr/cpp/QrCode.hpp) obs_status(FATAL_ERROR "obs-websocket submodule deps not available.") endif() @@ -23,11 +19,14 @@ option(PLUGIN_TESTS "Enable plugin runtime tests" OFF) # Find Qt find_qt(COMPONENTS Core Widgets Svg Network) -# Find nlohmann -set(JSON_BuildTests - OFF - CACHE INTERNAL "") -add_subdirectory(deps/json) +# Find nlohmann JSON +find_package(nlohmann_json 3 REQUIRED) + +# Find WebSocket++ +find_package(Websocketpp 0.8 REQUIRED) + +# Find Asio +find_package(Asio 1.12.1 REQUIRED) # Tell websocketpp not to use system boost add_definitions(-DASIO_STANDALONE) @@ -128,9 +127,6 @@ target_sources( deps/qr/cpp/QrCode.cpp deps/qr/cpp/QrCode.hpp) -target_include_directories(obs-websocket PRIVATE "deps/asio/asio/include" - "deps/websocketpp") - target_link_libraries( obs-websocket PRIVATE OBS::libobs @@ -139,7 +135,9 @@ target_link_libraries( Qt::Widgets Qt::Svg Qt::Network - nlohmann_json::nlohmann_json) + nlohmann_json::nlohmann_json + Websocketpp::Websocketpp + Asio::Asio) target_compile_features(obs-websocket PRIVATE cxx_std_17) diff --git a/deps/asio b/deps/asio deleted file mode 160000 index b73dc1d2..00000000 --- a/deps/asio +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b73dc1d2c0ecb9452a87c26544d7f71e24342df6 diff --git a/deps/json b/deps/json deleted file mode 160000 index a34e011e..00000000 --- a/deps/json +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a34e011e24beece3b69397a03fdc650546f052c3 diff --git a/deps/websocketpp b/deps/websocketpp deleted file mode 160000 index 56123c87..00000000 --- a/deps/websocketpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 56123c87598f8b1dd471be83ca841ceae07f95ba