Commit c0129da0 authored by Jan Grulich's avatar Jan Grulich
Browse files

Make screencast support optional

Summary: This might be necessary as Pipewire seems not to be available on some Linux distributions

Reviewers: Kanedias, romangg, davidedmundson

Reviewed By: Kanedias

Subscribers: #plasma

Differential Revision: https://phabricator.kde.org/D11943
parent 76811d65
......@@ -21,25 +21,33 @@ include(FeatureSummary)
include(FindPkgConfig)
# remove?
pkg_check_modules(PIPEWIRE REQUIRED libpipewire-0.1)
pkg_check_modules(SPA REQUIRED libspa-0.1)
pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(PIPEWIRE libpipewire-0.1)
pkg_check_modules(SPA libspa-0.1)
pkg_check_modules(GLIB glib-2.0)
find_package(gbm REQUIRED)
find_package(gbm)
set_package_properties(gbm PROPERTIES DESCRIPTION "GBM - Generic Buffer Management"
TYPE REQUIRED
TYPE OPTIONAL
PURPOSE "Required for egl ouput of drm backend."
)
find_package(epoxy REQUIRED)
find_package(epoxy)
include_directories(${epoxy_INCLUDE_DIRS})
set_package_properties(epoxy PROPERTIES DESCRIPTION "libepoxy"
URL "http://github.com/anholt/libepoxy"
TYPE REQUIRED
TYPE OPTIONAL
PURPOSE "OpenGL dispatch library for GBM backend"
)
if (${PIPEWIRE_FOUND} AND ${SPA_FOUND} AND ${GLIB_FOUND} AND ${GBM_FOUND} AND ${EPOXY_FOUND})
set (SCREENCAST_ENABLED true)
else()
set (SCREENCAST_ENABLED false)
endif()
add_definitions(-DSCREENCAST_ENABLED=${SCREENCAST_ENABLED})
add_feature_info ("Screencast portal" ${SCREENCAST_ENABLED} "Support for screen sharing")
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core
DBus
......
......@@ -19,16 +19,23 @@ set(xdg_desktop_portal_kde_SRCS
notification.cpp
print.cpp
request.cpp
screencast.cpp
screencaststream.cpp
screenchooserdialog.cpp
session.cpp
)
if (SCREENCAST_ENABLED)
set (xdg_desktop_portal_kde_SRCS
${xdg_desktop_portal_kde_SRCS}
screencast.cpp
screencaststream.cpp
screenchooserdialog.cpp)
ki18n_wrap_ui(xdg_desktop_portal_kde_SRCS
screenchooserdialog.ui)
endif()
ki18n_wrap_ui(xdg_desktop_portal_kde_SRCS
accessdialog.ui
appchooserdialog.ui
screenchooserdialog.ui
)
add_executable(xdg-desktop-portal-kde ${xdg_desktop_portal_kde_SRCS})
......@@ -42,11 +49,15 @@ target_link_libraries(xdg-desktop-portal-kde
KF5::I18n
KF5::Notifications
KF5::WaylandClient
${PIPEWIRE_LIBRARIES}
${SPA_LIBRARIES}
${GLIB_LIBRARIES}
${epoxy_LIBRARY}
gbm::gbm
)
if (SCREENCAST_ENABLED)
target_link_libraries(xdg-desktop-portal-kde
${PIPEWIRE_LIBRARIES}
${SPA_LIBRARIES}
${GLIB_LIBRARIES}
${epoxy_LIBRARY}
gbm::gbm)
endif()
install(TARGETS xdg-desktop-portal-kde DESTINATION ${KDE_INSTALL_LIBEXECDIR})
......@@ -37,7 +37,9 @@ DesktopPortal::DesktopPortal(QObject *parent)
, m_inhibit(new InhibitPortal(this))
, m_notification(new NotificationPortal(this))
, m_print(new PrintPortal(this))
#if SCREENCAST_ENABLED
, m_screenCast(new ScreenCastPortal(this))
#endif
{
}
......
......@@ -31,7 +31,9 @@
#include "inhibit.h"
#include "notification.h"
#include "print.h"
#if SCREENCAST_ENABLED
#include "screencast.h"
#endif
class DesktopPortal : public QObject
{
......@@ -48,7 +50,9 @@ private:
InhibitPortal *m_inhibit;
NotificationPortal *m_notification;
PrintPortal *m_print;
#if SCREENCAST_ENABLED
ScreenCastPortal *m_screenCast;
#endif
};
#endif // XDG_DESKTOP_PORTAL_KDE_DESKTOP_PORTAL_H
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment