libtaskmanager: Fix build when PipeWire is not installed.

The CMake code is careful not to include PipeWire when it is not
installed, however what it *does* include (taskmanagerplugin) still has
a dependency on Screencasting classes, which prior to this are gated
under the PipeWire check.

Since these classes only require Wayland, not PipeWire, I fix the build
error by reducing the CMake check for PipeWire to only add the
PipeWire-specific bits when PipeWire is present, and to build the
screencasting stuff unconditionally.

The ECM logging code is named after PipeWire but doesn't depend on it
either so that is also built unconditionally to avoid build failures
about a missing "logging.h".

BUG:456655
wilder-5.26
Michael Pyne 4 years ago committed by Aleix Pol Gonzalez
parent bb3a1cd5b0
commit 92c08071b6
  1. 71
      libtaskmanager/declarative/CMakeLists.txt

@ -7,44 +7,45 @@ target_link_libraries(taskmanagerplugin taskmanager)
install(TARGETS taskmanagerplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/taskmanager) install(TARGETS taskmanagerplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/taskmanager)
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/taskmanager) install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/taskmanager)
if(TARGET K::KPipeWire) ecm_qt_declare_logging_category(SRCS
ecm_qt_declare_logging_category(SRCS HEADER logging.h
HEADER logging.h IDENTIFIER PIPEWIRE_LOGGING
IDENTIFIER PIPEWIRE_LOGGING CATEGORY_NAME plasma_workspace_pipewire_logging
CATEGORY_NAME plasma_workspace_pipewire_logging DESCRIPTION "PipeWire components for window thumbnails"
DESCRIPTION "PipeWire components for window thumbnails" EXPORT PlasmaWorkspacePipeWire)
EXPORT PlasmaWorkspacePipeWire) ecm_qt_install_logging_categories(
ecm_qt_install_logging_categories( EXPORT PlasmaWorkspacePipeWire
EXPORT PlasmaWorkspacePipeWire FILE myproject.categories
FILE myproject.categories DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}"
DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}" )
if (QT_MAJOR_VERSION EQUAL "5")
ecm_add_qtwayland_client_protocol(SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/zkde-screencast-unstable-v1.xml
BASENAME zkde-screencast-unstable-v1
) )
else()
qt6_generate_wayland_protocol_client_sources(taskmanagerplugin FILES
${PLASMA_WAYLAND_PROTOCOLS_DIR}/zkde-screencast-unstable-v1.xml)
endif()
target_include_directories(taskmanagerplugin PRIVATE ${Libdrm_INCLUDE_DIR})
if (QT_MAJOR_VERSION EQUAL "5") target_sources(taskmanagerplugin PUBLIC screencasting.cpp screencastingrequest.cpp ${SRCS})
ecm_add_qtwayland_client_protocol(SRCS target_link_libraries(taskmanagerplugin Qt::Qml Qt::GuiPrivate
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/zkde-screencast-unstable-v1.xml KF5::I18n
BASENAME zkde-screencast-unstable-v1 KF5::WaylandClient
) Wayland::Client)
else() if (${Qt5Gui_OPENGL_IMPLEMENTATION} STREQUAL "GLESv2")
qt6_generate_wayland_protocol_client_sources(taskmanagerplugin FILES target_link_libraries(taskmanagerplugin Qt5::Gui_GLESv2)
${PLASMA_WAYLAND_PROTOCOLS_DIR}/zkde-screencast-unstable-v1.xml) elseif(TARGET Qt5::Gui_GL)
endif() target_link_libraries(taskmanagerplugin Qt5::Gui_GL)
target_include_directories(taskmanagerplugin PRIVATE ${Libdrm_INCLUDE_DIR}) endif()
if (TARGET Qt5::Gui_EGL)
target_link_libraries(taskmanagerplugin Qt5::Gui_EGL)
endif()
if(TARGET K::KPipeWire)
target_compile_definitions(taskmanagerplugin PRIVATE -DWITH_KPIPEWIRE) target_compile_definitions(taskmanagerplugin PRIVATE -DWITH_KPIPEWIRE)
target_sources(taskmanagerplugin PUBLIC screencasting.cpp screencastingrequest.cpp ${SRCS})
target_link_libraries(taskmanagerplugin PkgConfig::PipeWire target_link_libraries(taskmanagerplugin PkgConfig::PipeWire
Qt::Qml Qt::GuiPrivate K::KPipeWire)
KF5::I18n
KF5::WaylandClient
K::KPipeWire
Wayland::Client)
if (${Qt5Gui_OPENGL_IMPLEMENTATION} STREQUAL "GLESv2")
target_link_libraries(taskmanagerplugin Qt5::Gui_GLESv2)
elseif(TARGET Qt5::Gui_GL)
target_link_libraries(taskmanagerplugin Qt5::Gui_GL)
endif()
if (TARGET Qt5::Gui_EGL)
target_link_libraries(taskmanagerplugin Qt5::Gui_EGL)
endif()
endif() endif()

Loading…
Cancel
Save