KDEAmbi/CMakeLists.txt
Tobias J. Endres 710918a622 feat: Refactor wayland_poc to use QDBus for xdg-desktop-portal interaction
This commit refactors the wayland_poc executable to use Qt's QDBus
module for interacting with xdg-desktop-portal. This approach bypasses
the problematic direct inclusion of PipeWire session manager headers
(e.g., session-manager.h) that were causing persistent compilation errors.

The wayland_poc now focuses solely on requesting screen capture permission
via D-Bus and retrieving the PipeWire node ID, without attempting to
create or manage PipeWire streams directly.

This change aims to provide a working foundation for the xdg-desktop-portal
interaction, which can then be integrated with the core PipeWire stream
capture logic (demonstrated by tutorial5.c).
2025-08-14 04:26:53 +02:00

48 lines
1.6 KiB
CMake

cmake_minimum_required(VERSION 3.10.0)
project(Hyperion_Grabber_X11_QT VERSION 0.1 LANGUAGES C CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(X11 REQUIRED)
find_package(Qt5DBus REQUIRED) # Add Qt5DBus
# Find PipeWire
find_package(PkgConfig REQUIRED)
pkg_check_modules(PIPEWIRE REQUIRED libpipewire-0.3)
# Find GIO/GLib for GDBus using pkg-config
pkg_check_modules(GIO REQUIRED gio-2.0) # Use gio-2.0 for pkg-config
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lXrender -lXdamage -lXss")
include_directories(${X11_INCLUDE_DIR} ${PIPEWIRE_INCLUDE_DIRS})
# add_executable(${PROJECT_NAME} "main.cpp" "hgx11.h" "hgx11.cpp" "hgx11net.h" "hgx11net.cpp" "hgx11damage.h" "hgx11damage.cpp" "hgx11grab.h" "hgx11grab.cpp" "hgx11screensaver.h" "hgx11screensaver.cpp")
# target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Network Qt5::Widgets ${X11_LIBRARIES})
# Add the Wayland POC executable
add_executable(wayland_poc "wayland_poc.cpp")
target_link_libraries(wayland_poc
Qt5::Core
Qt5::Gui
Qt5::DBus # Add Qt5DBus
${PIPEWIRE_LIBRARIES}
${GIO_LIBRARIES}
)
# target_include_directories(wayland_poc PRIVATE ${PIPEWIRE_INCLUDE_DIRS})
# Add the Tutorial 5 executable
add_executable(tutorial5 tutorial/tutorial5.c)
set_property(SOURCE tutorial/tutorial5.c PROPERTY LANGUAGE C)
target_link_libraries(tutorial5
${PIPEWIRE_LIBRARIES}
)