aboutsummaryrefslogtreecommitdiff
path: root/tests/service-mocks/media-player-mpris-mock/CMakeLists.txt
blob: 27302f0355e616e7f5e4883133201886e4d2492a (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
54
55
56
57
58
59
60
61
62
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

add_definitions("-fPIC")

find_package(Qt5DBus REQUIRED)
include_directories(${Qt5DBus_INCLUDE_DIRS}
                    "${CMAKE_SOURCE_DIR}/tests/service-mocks")

add_definitions(-DQT_NO_KEYWORDS=1)

set(dbusinterface_mediaplayermpris_xml "org.mpris.MediaPlayer2.Player.xml")
set_source_files_properties(${dbusinterface_mediaplayermpris_xml} PROPERTIES
  CLASSNAME MediaPlayerMprisMockInterface)

qt5_add_dbus_interface(interface_files ${dbusinterface_mediaplayermpris_xml} MediaPlayerMprisMockInterface)

qt5_add_dbus_adaptor(adaptor_files
    org.mpris.MediaPlayer2.Player.xml
    MediaPlayerMprisMock.h
    ayatana::indicators::testing::MediaPlayerMprisMock
    MediaPlayerMprisMockAdaptor)

qt5_add_dbus_adaptor(adaptor_files
    org.mpris.MediaPlayer2.xml
    MediaPlayerMprisMock.h
    ayatana::indicators::testing::MediaPlayerMprisMock
    MediaPlayer2MockAdaptor)

add_executable(
  media-player-mpris-mock
  ${adaptor_files}
  MediaPlayerMprisMock.cpp
  ${CMAKE_SOURCE_DIR}/tests/service-mocks/DBusPropertiesNotifier.cpp
  main.cpp
  testplayers
)

add_executable(
  media-player-mpris-mock-update
  ${interface_files}
  player-update.cpp
  testplayers
)

target_link_libraries(
    media-player-mpris-mock
    Qt5::Core
    Qt5::DBus
)

target_link_libraries(
    media-player-mpris-mock-update
    Qt5::Core
    Qt5::DBus
)

# test players desktop files
add_custom_command (OUTPUT testplayers
                    DEPENDS ${CMAKE_SOURCE_DIR}/tests/service-mocks/media-player-mpris-mock/applications
                    COMMAND mkdir -p ${XDG_DATA_DIRS}
                    COMMAND cp -r ${CMAKE_SOURCE_DIR}/tests/service-mocks/media-player-mpris-mock/applications ${XDG_DATA_DIRS})