Skip to content

Commit

Permalink
Add procedure handler based API
Browse files Browse the repository at this point in the history
  • Loading branch information
tytan652 committed Jan 10, 2024
1 parent e873fb0 commit 5973c08
Show file tree
Hide file tree
Showing 9 changed files with 963 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ target_sources(
deps/signal-restore.hpp
deps/wide-string.cpp
deps/wide-string.hpp
obs-browser-api-impl.cpp
obs-browser-api-impl.hpp
obs-browser-plugin.cpp
obs-browser-source-audio.cpp
obs-browser-source.cpp
Expand All @@ -60,4 +62,6 @@ if(ENABLE_BROWSER_PANELS)
include(cmake/feature-panels.cmake)
endif()

include(cmake/feature-api.cmake)

set_target_properties_obs(obs-browser PROPERTIES FOLDER plugins/obs-browser PREFIX "")
10 changes: 10 additions & 0 deletions cmake/feature-api.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
find_package(Qt6 REQUIRED Widgets)

add_library(browser-api INTERFACE)
add_library(OBS::browser-api ALIAS browser-api)

target_sources(browser-api INTERFACE lib/obs-browser-api.hpp)

target_include_directories(browser-api INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/lib")

target_link_libraries(browser-api INTERFACE Qt::Widgets)
4 changes: 2 additions & 2 deletions cmake/feature-panels.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ target_compile_definitions(browser-panels INTERFACE BROWSER_AVAILABLE)
target_sources(
obs-browser
PRIVATE # cmake-format: sortable
panel/browser-panel-client.cpp panel/browser-panel-client.hpp panel/browser-panel-internal.hpp
panel/browser-panel.cpp)
obs-browser-api-impl-panel.cpp panel/browser-panel-client.cpp panel/browser-panel-client.hpp
panel/browser-panel-internal.hpp panel/browser-panel.cpp)

target_link_libraries(obs-browser PRIVATE OBS::browser-panels Qt::Widgets)

Expand Down
14 changes: 12 additions & 2 deletions cmake/legacy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/browser-config.h.in ${CMAKE_BINARY_DI
target_sources(
obs-browser
PRIVATE obs-browser-plugin.cpp
obs-browser-api-impl.cpp
obs-browser-api-impl.hpp
obs-browser-source.cpp
obs-browser-source.hpp
obs-browser-source-audio.cpp
Expand All @@ -80,9 +82,9 @@ target_link_libraries(obs-browser PRIVATE OBS::libobs OBS::frontend-api nlohmann

target_compile_features(obs-browser PRIVATE cxx_std_17)

if(ENABLE_BROWSER_PANELS OR ENABLE_BROWSER_QT_LOOP)
find_qt(COMPONENTS Widgets)
find_qt(COMPONENTS Widgets)

if(ENABLE_BROWSER_PANELS OR ENABLE_BROWSER_QT_LOOP)
set_target_properties(
obs-browser
PROPERTIES AUTOMOC ON
Expand Down Expand Up @@ -251,11 +253,19 @@ if(ENABLE_BROWSER_PANELS)

target_compile_definitions(obs-browser-panels INTERFACE BROWSER_AVAILABLE)

target_sources(obs-browser PRIVATE obs-browser-api-impl-panel.cpp obs-browser-api-impl.cpp)

if(ENABLE_BROWSER_QT_LOOP)
target_compile_definitions(obs-browser-panels INTERFACE ENABLE_BROWSER_QT_LOOP)
endif()
endif()

add_library(browser-api INTERFACE)
add_library(OBS::browser-api ALIAS browser-api)
target_sources(browser-api INTERFACE lib/obs-browser-api.hpp)
target_include_directories(browser-api INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/lib")
target_link_libraries(browser-api INTERFACE Qt::Widgets)

set_target_properties(obs-browser PROPERTIES FOLDER "plugins/obs-browser" PREFIX "")

setup_plugin_target(obs-browser)
Loading

0 comments on commit 5973c08

Please sign in to comment.