Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move non-deps and shared UI code in shared folder #9350

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
!/docs
!/libobs*
!/plugins
!/shared
PatTheMav marked this conversation as resolved.
Show resolved Hide resolved
!/test
!/UI
!.cirrus.xml
Expand Down
2 changes: 1 addition & 1 deletion UI/absolute-slider.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <QMouseEvent>
#include "slider-ignorewheel.hpp"
#include <slider-ignorewheel.hpp>

class AbsoluteSlider : public SliderIgnoreScroll {
Q_OBJECT
Expand Down
2 changes: 1 addition & 1 deletion UI/adv-audio-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <QComboBox>
#include <QCheckBox>
#include <cmath>
#include "qt-wrappers.hpp"
#include <qt-wrappers.hpp>
#include "obs-app.hpp"
#include "adv-audio-control.hpp"
#include "window-basic-main.hpp"
Expand Down
2 changes: 1 addition & 1 deletion UI/api-interface.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <obs-frontend-internal.hpp>
#include <qt-wrappers.hpp>
#include "obs-app.hpp"
#include "qt-wrappers.hpp"
#include "window-basic-main.hpp"
#include "window-basic-main-outputs.hpp"

Expand Down
2 changes: 1 addition & 1 deletion UI/auth-listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include <QRegularExpressionMatch>
#include <QString>
#include <QtNetwork/QTcpSocket>
#include <qt-wrappers.hpp>

#include "obs-app.hpp"
#include "qt-wrappers.hpp"

#define LOGO_URL "https://obsproject.com/assets/images/new_icon_small-r.png"

Expand Down
2 changes: 1 addition & 1 deletion UI/auth-youtube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <QHBoxLayout>
#include <QUrl>
#include <QRandomGenerator>
#include <qt-wrappers.hpp>

#ifdef WIN32
#include <windows.h>
Expand All @@ -18,7 +19,6 @@

#include "auth-listener.hpp"
#include "obs-app.hpp"
#include "qt-wrappers.hpp"
#include "ui-config.h"
#include "youtube-api-wrappers.hpp"
#include "window-basic-main.hpp"
Expand Down
52 changes: 35 additions & 17 deletions UI/cmake/legacy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,28 @@ find_package(CURL REQUIRED)
add_subdirectory(frontend-plugins)
add_executable(obs)

if(NOT TARGET OBS::properties-view)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/properties-view" "${CMAKE_BINARY_DIR}/shared/properties-view")
endif()

if(NOT TARGET OBS::qt-plain-text-edit)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
endif()

if(NOT TARGET OBS::qt-slider-ignorewheel)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/slider-ignorewheel"
"${CMAKE_BINARY_DIR}/shared/qt/slider-ignorewheel")
endif()

if(NOT TARGET OBS::qt-vertical-scroll-area)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/vertical-scroll-area"
"${CMAKE_BINARY_DIR}/shared/qt/vertical-scroll-area")
endif()

if(NOT TARGET OBS::qt-wrappers)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers")
endif()

find_qt(COMPONENTS Widgets Network Svg Xml COMPONENTS_LINUX Gui DBus)

target_link_libraries(obs PRIVATE Qt::Widgets Qt::Svg Qt::Xml Qt::Network)
Expand Down Expand Up @@ -147,8 +169,6 @@ target_sources(
platform.hpp
qt-display.cpp
qt-display.hpp
qt-wrappers.cpp
qt-wrappers.hpp
ui-validation.cpp
ui-validation.hpp
multiview.cpp
Expand All @@ -171,8 +191,6 @@ target_sources(
basic-controls.cpp
basic-controls.hpp
clickable-label.hpp
double-slider.cpp
double-slider.hpp
horizontal-scroll-area.cpp
horizontal-scroll-area.hpp
item-widget-helpers.cpp
Expand All @@ -193,22 +211,13 @@ target_sources(
menu-button.hpp
mute-checkbox.hpp
noncheckable-button.hpp
plain-text-edit.cpp
plain-text-edit.hpp
properties-view.cpp
properties-view.hpp
properties-view.moc.hpp
remote-text.cpp
remote-text.hpp
scene-tree.cpp
scene-tree.hpp
screenshot-obj.hpp
slider-ignorewheel.cpp
slider-ignorewheel.hpp
source-label.cpp
source-label.hpp
spinbox-ignorewheel.cpp
spinbox-ignorewheel.hpp
source-tree.cpp
source-tree.hpp
url-push-button.cpp
Expand All @@ -217,8 +226,6 @@ target_sources(
undo-stack-obs.hpp
volume-control.cpp
volume-control.hpp
vertical-scroll-area.cpp
vertical-scroll-area.hpp
visibility-item-widget.cpp
visibility-item-widget.hpp)

Expand Down Expand Up @@ -304,8 +311,19 @@ target_compile_features(obs PRIVATE cxx_std_17)

target_include_directories(obs PRIVATE ${CMAKE_SOURCE_DIR}/deps/json11)

target_link_libraries(obs PRIVATE CURL::libcurl FFmpeg::avcodec FFmpeg::avutil FFmpeg::avformat OBS::libobs
OBS::frontend-api)
target_link_libraries(
obs
PRIVATE CURL::libcurl
FFmpeg::avcodec
FFmpeg::avutil
FFmpeg::avformat
OBS::libobs
OBS::frontend-api
OBS::qt-wrappers
OBS::qt-plain-text-edit
OBS::qt-vertical-scroll-area
OBS::qt-slider-ignorewheel
OBS::properties-view)

set_target_properties(obs PROPERTIES FOLDER "frontend")

Expand Down
46 changes: 20 additions & 26 deletions UI/cmake/ui-elements.cmake
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
add_library(obs-ui-support INTERFACE)
add_library(OBS::ui-support ALIAS obs-ui-support)
if(NOT TARGET OBS::properties-view)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/properties-view" "${CMAKE_BINARY_DIR}/shared/properties-view")
endif()

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)
if(NOT TARGET OBS::qt-plain-text-edit)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
endif()

if(NOT TARGET OBS::qt-slider-ignorewheel)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/slider-ignorewheel"
"${CMAKE_BINARY_DIR}/shared/qt/slider-ignorewheel")
endif()

target_include_directories(obs-ui-support INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
target_compile_options(obs-ui-support INTERFACE $<$<PLATFORM_ID:Linux>:-Wno-error=enum-conversion>)
if(NOT TARGET OBS::qt-vertical-scroll-area)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/vertical-scroll-area"
"${CMAKE_BINARY_DIR}/shared/qt/vertical-scroll-area")
endif()

target_link_libraries(obs-studio PRIVATE OBS::ui-support)
target_link_libraries(obs-studio PRIVATE OBS::properties-view OBS::qt-plain-text-edit OBS::qt-slider-ignorewheel
OBS::qt-vertical-scroll-area)

target_sources(
obs-studio
Expand All @@ -40,10 +31,13 @@ target_sources(
balance-slider.hpp
basic-controls.cpp
basic-controls.hpp
clickable-label.hpp
context-bar-controls.cpp
context-bar-controls.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 Down
6 changes: 5 additions & 1 deletion UI/cmake/ui-qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ if(OS_LINUX
find_package(Qt6 REQUIRED Gui DBus)
endif()

target_link_libraries(obs-studio PRIVATE Qt::Widgets Qt::Svg Qt::Xml Qt::Network)
if(NOT TARGET OBS::qt-wrappers)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers")
endif()

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

set_target_properties(
obs-studio
Expand Down
2 changes: 1 addition & 1 deletion UI/context-bar-controls.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "window-basic-main.hpp"
#include "context-bar-controls.hpp"
#include "qt-wrappers.hpp"
#include "obs-app.hpp"

#include <qt-wrappers.hpp>
#include <QStandardItemModel>
#include <QColorDialog>
#include <QFontDialog>
Expand Down
2 changes: 1 addition & 1 deletion UI/frontend-plugins/aja-output-ui/AJAOutputUI.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include <QDialog>
#include <properties-view.hpp>

#include "ui_output.h"
#include "../../UI/properties-view.hpp"

namespace aja {
class CardManager;
Expand Down
6 changes: 5 additions & 1 deletion UI/frontend-plugins/aja-output-ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ if(NOT TARGET OBS::aja-support)
add_subdirectory("${CMAKE_SOURCE_DIR}/plugins/aja" "${CMAKE_BINARY_DIR}/plugins/aja")
endif()

if(NOT TARGET OBS::properties-view)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/properties-view" "${CMAKE_BINARY_DIR}/shared/properties-view")
endif()

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

Expand All @@ -40,7 +44,7 @@ target_link_libraries(
PRIVATE OBS::libobs
OBS::aja-support
OBS::frontend-api
OBS::ui-support
OBS::properties-view
Qt::Widgets
AJA::LibAJANTV2
$<$<PLATFORM_ID:Linux,FreeBSD,OpenBSD>:X11::X11>
Expand Down
26 changes: 8 additions & 18 deletions UI/frontend-plugins/aja-output-ui/cmake/legacy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ find_package(LibAJANTV2 REQUIRED)
add_library(aja-output-ui MODULE)
add_library(OBS::aja-output-ui ALIAS aja-output-ui)

if(NOT TARGET OBS::properties-view)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/properties-view" "${CMAKE_BINARY_DIR}/shared/properties-view")
endif()

find_qt(COMPONENTS Widgets COMPONENTS_LINUX Gui)

set_target_properties(
Expand Down Expand Up @@ -45,24 +49,10 @@ target_sources(
${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_link_libraries(aja-output-ui PRIVATE OBS::libobs OBS::frontend-api Qt::Widgets AJA::LibAJANTV2)
${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.hpp)

target_link_libraries(aja-output-ui PRIVATE OBS::libobs OBS::frontend-api OBS::properties-view Qt::Widgets
AJA::LibAJANTV2)

if(OS_MACOS)
find_library(IOKIT_FRAMEWORK Iokit)
Expand Down
6 changes: 5 additions & 1 deletion UI/frontend-plugins/decklink-output-ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ endif()
add_library(decklink-output-ui MODULE)
add_library(OBS::decklink-output-ui ALIAS decklink-output-ui)

if(NOT TARGET OBS::properties-view)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/properties-view" "${CMAKE_BINARY_DIR}/shared/properties-view")
endif()

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

target_sources(decklink-output-ui PRIVATE DecklinkOutputUI.cpp DecklinkOutputUI.h decklink-ui-main.cpp
Expand All @@ -31,7 +35,7 @@ target_link_libraries(
decklink-output-ui
PRIVATE OBS::libobs
OBS::frontend-api
OBS::ui-support
OBS::properties-view
Qt::Widgets
"$<$<PLATFORM_ID:Darwin>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>"
$<$<PLATFORM_ID:Linux,FreeBSD,OpenBSD>:X11::X11>
Expand Down
2 changes: 1 addition & 1 deletion UI/frontend-plugins/decklink-output-ui/DecklinkOutputUI.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include <QDialog>
#include <properties-view.hpp>

#include "ui_output.h"
#include "../../UI/properties-view.hpp"

class DecklinkOutputUI : public QDialog {
Q_OBJECT
Expand Down
31 changes: 8 additions & 23 deletions UI/frontend-plugins/decklink-output-ui/cmake/legacy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ endif()
add_library(decklink-output-ui MODULE)
add_library(OBS::decklink-output-ui ALIAS decklink-output-ui)

if(NOT TARGET OBS::properties-view)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/properties-view" "${CMAKE_BINARY_DIR}/shared/properties-view")
endif()

find_qt(COMPONENTS Widgets COMPONENTS_LINUX Gui)

set_target_properties(
Expand All @@ -22,29 +26,10 @@ endif()

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

target_sources(
decklink-output-ui
PRIVATE DecklinkOutputUI.cpp
DecklinkOutputUI.h
decklink-ui-main.cpp
decklink-ui-main.h
${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.hpp
${CMAKE_SOURCE_DIR}/UI/qt-wrappers.cpp
${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.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp)

target_link_libraries(decklink-output-ui PRIVATE OBS::libobs OBS::frontend-api Qt::Widgets)
target_sources(decklink-output-ui PRIVATE DecklinkOutputUI.cpp DecklinkOutputUI.h decklink-ui-main.cpp
decklink-ui-main.h)

target_link_libraries(decklink-output-ui PRIVATE OBS::libobs OBS::frontend-api OBS::properties-view Qt::Widgets)

target_compile_features(decklink-output-ui PRIVATE cxx_std_17)

Expand Down
Loading
Loading