Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
!/docs
!/libobs*
!/plugins
!/tests
!/test
!/UI
!.cirrus.xml
!.clang-format
Expand Down
4 changes: 1 addition & 3 deletions UI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ target_sources(
platform.hpp
qt-display.cpp
qt-display.hpp
qt-wrappers.cpp
qt-wrappers.hpp
ui-config.h
ui-validation.cpp
ui-validation.hpp)
Expand All @@ -91,7 +89,7 @@ elseif(OS_MACOS)
include(cmake/os-macos.cmake)
elseif(OS_LINUX)
include(cmake/os-linux.cmake)
elseif(OS_FREEBSD)
elseif(OS_FREEBSD OR OS_OPENBSD)
include(cmake/os-freebsd.cmake)
endif()

Expand Down
6 changes: 4 additions & 2 deletions UI/cmake/feature-browserpanels.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ if(TARGET OBS::browser-panels)

target_link_libraries(obs-studio PRIVATE OBS::browser-panels)

target_sources(obs-studio PRIVATE window-dock-browser.cpp window-dock-browser.hpp window-extra-browsers.cpp
window-extra-browsers.hpp)
target_sources(
obs-studio
PRIVATE # cmake-format: sortable
window-dock-browser.cpp window-dock-browser.hpp window-extra-browsers.cpp window-extra-browsers.hpp)
endif()
7 changes: 5 additions & 2 deletions UI/cmake/feature-importers.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
target_sources(obs-studio PRIVATE importers/classic.cpp importers/importers.cpp importers/importers.hpp
importers/sl.cpp importers/studio.cpp importers/xsplit.cpp)
target_sources(
obs-studio
PRIVATE # cmake-format: sortable
importers/classic.cpp importers/importers.cpp importers/importers.hpp importers/sl.cpp importers/studio.cpp
importers/xsplit.cpp)
2 changes: 2 additions & 0 deletions UI/cmake/feature-whatsnew.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include_guard(DIRECTORY)

option(ENABLE_WHATSNEW "Enable WhatsNew dialog" ON)

if(ENABLE_WHATSNEW AND TARGET OBS::browser-panels)
Expand Down
3 changes: 2 additions & 1 deletion UI/cmake/feature-youtube.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
if(YOUTUBE_CLIENTID
AND YOUTUBE_SECRET
AND YOUTUBE_CLIENTID_HASH MATCHES "^(0|[a-fA-F0-9]+)$"
AND YOUTUBE_SECRET_HASH MATCHES "^(0|[a-fA-F0-9]+)$")
AND YOUTUBE_SECRET_HASH MATCHES "^(0|[a-fA-F0-9]+)$"
AND TARGET OBS::browser-panels)
target_sources(
obs-studio
PRIVATE # cmake-format: sortable
Expand Down
8 changes: 1 addition & 7 deletions UI/cmake/os-macos.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
if(NOT XCODE)
target_add_resource(obs-studio "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/Assets.xcassets")
endif()

target_sources(obs-studio PRIVATE platform-osx.mm forms/OBSPermissions.ui window-permissions.cpp window-permissions.hpp)
target_compile_options(
obs-studio PRIVATE -Wno-error=float-conversion -Wno-error=implicit-int-conversion -Wno-error=shorten-64-to-32
-Wno-quoted-include-in-framework-header -Wno-comma)
target_compile_options(obs-studio PRIVATE -Wno-quoted-include-in-framework-header -Wno-comma)

set_source_files_properties(platform-osx.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)

Expand Down
17 changes: 11 additions & 6 deletions UI/cmake/os-windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ configure_file(cmake/windows/obs.rc.in obs.rc)

target_sources(
obs-studio
PRIVATE obs.rc
platform-windows.cpp
win-dll-blocklist.c
PRIVATE # cmake-format: sortable
cmake/windows/obs.manifest
obs.rc
platform-windows.cpp
update/crypto-helpers-mbedtls.cpp
update/crypto-helpers.hpp
update/models/branches.hpp
update/models/whatsnew.hpp
update/shared-update.cpp
update/shared-update.hpp
update/update-helpers.cpp
Expand All @@ -28,19 +30,21 @@ target_sources(
update/update-window.hpp
update/win-update.cpp
update/win-update.hpp
update/models/branches.hpp
update/models/whatsnew.hpp
win-dll-blocklist.c
win-update/updater/manifest.hpp)

target_link_libraries(obs-studio PRIVATE crypt32 OBS::blake2 OBS::w32-pthreads MbedTLS::MbedTLS
nlohmann_json::nlohmann_json Detours::Detours)

target_compile_definitions(obs-studio PRIVATE PSAPI_VERSION=2)
target_link_options(obs-studio PRIVATE /IGNORE:4098 /IGNORE:4099)

target_link_options(obs-studio PRIVATE /IGNORE:4099)

add_library(obs-update-helpers INTERFACE)
add_library(OBS::update-helpers ALIAS obs-update-helpers)

target_sources(obs-update-helpers INTERFACE win-update/win-update-helpers.cpp win-update/win-update-helpers.hpp)

target_include_directories(obs-update-helpers INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/win-update")

# Set commit for untagged version comparisons in the Windows updater
Expand All @@ -49,6 +53,7 @@ if(OBS_VERSION MATCHES ".+g[a-f0-9]+.*")
else()
set(OBS_COMMIT "")
endif()

set_source_files_properties(update/win-update.cpp PROPERTIES COMPILE_DEFINITIONS OBS_COMMIT="${OBS_COMMIT}")

add_subdirectory(win-update/updater)
Expand Down
45 changes: 29 additions & 16 deletions UI/cmake/ui-elements.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
add_library(obs-ui-support INTERFACE)
add_library(OBS::ui-support ALIAS obs-ui-support)

target_sources(
obs-ui-support
INTERFACE # cmake-format: sortable
clickable-label.hpp
double-slider.cpp
double-slider.hpp
horizontal-scroll-area.cpp
horizontal-scroll-area.hpp
plain-text-edit.cpp
plain-text-edit.hpp
properties-view.cpp
properties-view.hpp
properties-view.moc.hpp
qt-wrappers.cpp
qt-wrappers.hpp
slider-ignorewheel.cpp
slider-ignorewheel.hpp
spinbox-ignorewheel.cpp
spinbox-ignorewheel.hpp
vertical-scroll-area.cpp
vertical-scroll-area.hpp)

target_include_directories(obs-ui-support INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")

target_link_libraries(obs-studio PRIVATE OBS::ui-support)

target_sources(
obs-studio
PRIVATE # cmake-format: sortable
Expand All @@ -6,15 +35,10 @@ target_sources(
audio-encoders.cpp
audio-encoders.hpp
balance-slider.hpp
clickable-label.hpp
context-bar-controls.cpp
context-bar-controls.hpp
double-slider.cpp
double-slider.hpp
focus-list.cpp
focus-list.hpp
horizontal-scroll-area.cpp
horizontal-scroll-area.hpp
hotkey-edit.cpp
hotkey-edit.hpp
item-widget-helpers.cpp
Expand All @@ -30,11 +54,6 @@ target_sources(
menu-button.cpp
menu-button.hpp
mute-checkbox.hpp
plain-text-edit.cpp
plain-text-edit.hpp
properties-view.cpp
properties-view.hpp
properties-view.moc.hpp
record-button.cpp
record-button.hpp
remote-text.cpp
Expand All @@ -44,20 +63,14 @@ target_sources(
screenshot-obj.hpp
slider-absoluteset-style.cpp
slider-absoluteset-style.hpp
slider-ignorewheel.cpp
slider-ignorewheel.hpp
source-label.cpp
source-label.hpp
source-tree.cpp
source-tree.hpp
spinbox-ignorewheel.cpp
spinbox-ignorewheel.hpp
undo-stack-obs.cpp
undo-stack-obs.hpp
url-push-button.cpp
url-push-button.hpp
vertical-scroll-area.cpp
vertical-scroll-area.hpp
visibility-item-widget.cpp
visibility-item-widget.hpp
volume-control.cpp
Expand Down
10 changes: 9 additions & 1 deletion UI/cmake/ui-qt.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
find_qt(COMPONENTS Widgets Network Svg Xml COMPONENTS_LINUX Gui)
# cmake-format: off
find_package(Qt6 REQUIRED Widgets Network Svg Xml)
# cmake-format: on

if(OS_LINUX
OR OS_FREEBSD
OR OS_OPENBSD)
find_package(Qt6 REQUIRED Gui)
endif()

target_link_libraries(obs-studio PRIVATE Qt::Widgets Qt::Svg Qt::Xml Qt::Network)

Expand Down
100 changes: 43 additions & 57 deletions UI/frontend-plugins/aja-output-ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,79 +8,64 @@ if(NOT ENABLE_AJA)
endif()

find_package(LibAJANTV2 REQUIRED)
find_qt(COMPONENTS Widgets COMPONENTS_LINUX Gui)

find_package(Qt6 REQUIRED Widgets)

if(OS_LINUX
OR OS_FREEBSD
OR OS_OPENBSD)
find_package(Qt6 REQUIRED Gui)

find_package(X11 REQUIRED)
endif()

if(NOT TARGET OBS::aja-support)
add_subdirectory("${CMAKE_SOURCE_DIR}/plugins/aja" "${CMAKE_BINARY_DIR}/plugins/aja")
endif()

add_library(aja-output-ui MODULE)
add_library(OBS::aja-output-ui ALIAS aja-output-ui)

target_sources(
aja-output-ui
PRIVATE AJAOutputUI.h
AJAOutputUI.cpp
aja-ui-main.cpp
aja-ui-main.h
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-card-manager.cpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-card-manager.hpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-common.cpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-common.hpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-enums.hpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-presets.cpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-presets.hpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-props.cpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-props.hpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-routing.cpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-routing.hpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-ui-props.hpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-vpid-data.cpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-vpid-data.hpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.cpp"
"${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.hpp"
"${CMAKE_SOURCE_DIR}/UI/double-slider.cpp"
"${CMAKE_SOURCE_DIR}/UI/double-slider.hpp"
"${CMAKE_SOURCE_DIR}/UI/plain-text-edit.hpp"
"${CMAKE_SOURCE_DIR}/UI/plain-text-edit.cpp"
"${CMAKE_SOURCE_DIR}/UI/properties-view.hpp"
"${CMAKE_SOURCE_DIR}/UI/properties-view.cpp"
"${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp"
"${CMAKE_SOURCE_DIR}/UI/qt-wrappers.cpp"
"${CMAKE_SOURCE_DIR}/UI/qt-wrappers.hpp"
"${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.cpp"
"${CMAKE_SOURCE_DIR}/UI/spinbox-ignorewheel.hpp"
"${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.cpp"
"${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.hpp"
"${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp"
"${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp")
target_sources(aja-output-ui PRIVATE # cmake-format: sortable
aja-ui-main.cpp aja-ui-main.h AJAOutputUI.cpp AJAOutputUI.h)

target_sources(aja-output-ui PRIVATE forms/output.ui)

target_link_libraries(aja-output-ui PRIVATE OBS::libobs OBS::frontend-api Qt::Widgets AJA::LibAJANTV2)
target_compile_options(
aja-output-ui PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang>:-Wno-deprecated-declarations>
$<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang>:-Wno-quoted-include-in-framework-header>)

target_link_libraries(
aja-output-ui
PRIVATE OBS::libobs
OBS::aja-support
OBS::frontend-api
OBS::ui-support
Qt::Widgets
AJA::LibAJANTV2
$<$<PLATFORM_ID:Windows>:ws2_32.lib>
$<$<PLATFORM_ID:Windows>:setupapi.lib>
$<$<PLATFORM_ID:Windows>:Winmm.lib>
$<$<PLATFORM_ID:Windows>:netapi32.lib>
$<$<PLATFORM_ID:Windows>:Shlwapi.lib>
"$<$<PLATFORM_ID:Darwin>:$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>>"
"$<$<PLATFORM_ID:Darwin>:$<LINK_LIBRARY:FRAMEWORK,CoreFoundation.framework>>"
"$<$<PLATFORM_ID:Darwin>:$<LINK_LIBRARY:FRAMEWORK,IOKit.framework>>"
$<$<PLATFORM_ID:Linux,FreeBSD,OpenBSD>:X11::X11>
$<$<PLATFORM_ID:Linux,FreeBSD,OpenBSD>:Qt::GuiPrivate>)

target_link_options(aja-output-ui PRIVATE $<$<PLATFORM_ID:Windows>:/IGNORE:4099>)

if(OS_WINDOWS)
configure_file(cmake/windows/obs-module.rc.in aja-output-ui.rc)
target_sources(aja-output-ui PRIVATE aja-output-ui.rc)
target_compile_options(aja-output-ui PRIVATE /wd4996)

target_link_libraries(aja-output-ui PRIVATE ws2_32.lib setupapi.lib Winmm.lib netapi32.lib Shlwapi.lib)
target_link_options(aja-output-ui PRIVATE /IGNORE:4099)

set_property(
TARGET aja-output-ui
APPEND
PROPERTY AUTORCC_OPTIONS --format-version 1)
elseif(OS_MACOS)
# cmake-format: off
target_link_libraries(
aja-output-ui
PRIVATE "$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>"
"$<LINK_LIBRARY:FRAMEWORK,CoreFoundation.framework>"
"$<LINK_LIBRARY:FRAMEWORK,IOKit.framework>")
set_property(TARGET aja-output-ui APPEND PROPERTY AUTORCC_OPTIONS --format-version 1)
# cmake-format: on
target_compile_options(aja-output-ui PRIVATE -Wno-deprecated-declarations -Wno-quoted-include-in-framework-header)
elseif(OS_LINUX OR OS_FREEBSD)
find_package(X11 REQUIRED)
target_link_libraries(aja-output-ui PRIVATE X11::X11 Qt::GuiPrivate)
endif()

# cmake-format: off
set_target_properties_obs(
aja-output-ui
PROPERTIES FOLDER frontend
Expand All @@ -89,3 +74,4 @@ set_target_properties_obs(
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS forms)
# cmake-format: on
Loading