Skip to content

Commit

Permalink
base,deps,src: Replace qr submodule by prefix/system install
Browse files Browse the repository at this point in the history
  • Loading branch information
tytan652 authored and tt2468 committed Jul 15, 2023
1 parent 93713c4 commit 4177258
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
@@ -1,3 +0,0 @@
[submodule "deps/qr"]
path = deps/qr
url = https://github.com/nayuki/QR-Code-generator.git
13 changes: 5 additions & 8 deletions CMakeLists.txt
Expand Up @@ -11,17 +11,15 @@ if(NOT ENABLE_WEBSOCKET)
return()
endif()

# Submodule deps check
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/deps/qr/cpp/QrCode.hpp")
message(FATAL_ERROR "obs-websocket submodule deps not available.")
endif()

# Find Qt
find_qt(COMPONENTS Core Widgets Svg Network)

# Find nlohmann JSON
find_package(nlohmann_json 3 REQUIRED)

# Find qrcodegencpp
find_package(Libqrcodegencpp REQUIRED)

# Find WebSocket++
find_package(Websocketpp 0.8 REQUIRED)

Expand Down Expand Up @@ -124,8 +122,6 @@ target_sources(
src/utils/Platform.h
src/utils/Utils.h)

target_sources(obs-websocket PRIVATE deps/qr/cpp/QrCode.cpp deps/qr/cpp/QrCode.hpp)

configure_file(src/plugin-macros.h.in plugin-macros.generated.h)
target_sources(obs-websocket PRIVATE plugin-macros.generated.h)

Expand Down Expand Up @@ -154,7 +150,8 @@ target_link_libraries(
Qt::Network
nlohmann_json::nlohmann_json
Websocketpp::Websocketpp
Asio::Asio)
Asio::Asio
Libqrcodegencpp::Libqrcodegencpp)

set_target_properties_obs(
obs-websocket
Expand Down
15 changes: 6 additions & 9 deletions cmake/legacy.cmake
Expand Up @@ -8,11 +8,6 @@ if(NOT ENABLE_WEBSOCKET OR NOT ENABLE_UI)
return()
endif()

# Submodule deps check
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/deps/qr/cpp/QrCode.hpp)
obs_status(FATAL_ERROR "obs-websocket submodule deps not available.")
endif()

# Plugin tests flag
option(PLUGIN_TESTS "Enable plugin runtime tests" OFF)

Expand All @@ -22,6 +17,9 @@ find_qt(COMPONENTS Core Widgets Svg Network)
# Find nlohmann JSON
find_package(nlohmann_json 3 REQUIRED)

# Find qrcodegencpp
find_package(Libqrcodegencpp REQUIRED)

# Find WebSocket++
find_package(Websocketpp 0.8 REQUIRED)

Expand Down Expand Up @@ -127,9 +125,7 @@ target_sources(
src/utils/Platform.h
src/utils/Compat.cpp
src/utils/Compat.h
src/utils/Utils.h
deps/qr/cpp/QrCode.cpp
deps/qr/cpp/QrCode.hpp)
src/utils/Utils.h)

target_link_libraries(
obs-websocket
Expand All @@ -141,7 +137,8 @@ target_link_libraries(
Qt::Network
nlohmann_json::nlohmann_json
Websocketpp::Websocketpp
Asio::Asio)
Asio::Asio
Libqrcodegencpp::Libqrcodegencpp)

target_compile_features(obs-websocket PRIVATE cxx_std_17)

Expand Down
1 change: 0 additions & 1 deletion deps/qr
Submodule qr deleted from 851868
2 changes: 1 addition & 1 deletion src/forms/ConnectInfo.cpp
Expand Up @@ -21,9 +21,9 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include <QPainter>
#include <QUrl>
#include <obs-module.h>
#include <qrcodegen.hpp>

#include "ConnectInfo.h"
#include "../../deps/qr/cpp/QrCode.hpp"
#include "../obs-websocket.h"
#include "../Config.h"
#include "../utils/Platform.h"
Expand Down

0 comments on commit 4177258

Please sign in to comment.