summaryrefslogtreecommitdiffstats
path: root/interfaces/CMakeLists.txt
blob: 39872d6ccb05cb03d4c30e920ca50ced0cf06118 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
################################################################################
# XDG Desktop Portal implementation for TDE                                    #
# Copyright (C) 2024 Mavridis Philippe <mavridisf@gmail.com>                   #
#                                                                              #
# Improvements and feedback are welcome!                                       #
# This software is licensed under the terms of the GNU GPL v3 license.         #
################################################################################

include_directories(
    ${CMAKE_CURRENT_BINARY_DIR}
    ${DBUS_TQT_INCLUDE_DIRS}
)

link_directories(
    ${DBUS_TQT_LIBRARY_DIRS}
)

set(interfaces account email filechooser)
set(interface_HDRS introspectableInterface.h desktopNode.h dbusbaseNode.h)
set(interface_SRCS introspectableInterface.cpp desktopNode.cpp dbusbaseNode.cpp)

foreach(interface IN LISTS interfaces)
    list(APPEND interface_HDRS ${interface}Interface.h ${interface}Proxy.h)
    list(APPEND interface_SRCS ${interface}Interface.cpp ${interface}Proxy.cpp)
endforeach()

add_custom_command(
    OUTPUT ${interface_HDRS} ${interface_SRCS}
    COMMAND ${DBUSXML2QT3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/interfaces.xml
    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces.xml
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

tde_add_library(portalinterfaces STATIC_PIC AUTOMOC
    SOURCES ${interface_SRCS}
    LINK ${DBUS_TQT_LIBRARIES}
)

configure_file(org.freedesktop.impl.portal.desktop.tde.service.cmake
               org.freedesktop.impl.portal.desktop.tde.service @ONLY)

configure_file(xdg-desktop-portal-tde.desktop.cmake
               xdg-desktop-portal-tde.desktop @ONLY)

install(FILES tde.portal DESTINATION ${XDG_PREFIX}/share/xdg-desktop-portal/portals)

install(FILES tde-portals.conf DESTINATION ${XDG_PREFIX}/share/xdg-desktop-portal)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.impl.portal.desktop.tde.service
        DESTINATION ${DBUS_SESSION_DIRECTORY})

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/xdg-desktop-portal-tde.desktop
        DESTINATION ${XDG_APPS_INSTALL_DIR})