aboutsummaryrefslogtreecommitdiff
path: root/tests/service-mocks/accounts-mock/CMakeLists.txt
blob: 9ef32fa5aeec88a816353dcee35a17b94b61ce3a (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
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

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

add_definitions(-DQT_NO_KEYWORDS=1)

if(EXISTS "/usr/share/accountsservice/interfaces/com.ubuntu.AccountsService.Sound.xml")
    add_definitions(-DHAS_UT_ACCTSERVICE_SOUND_SETTINGS)
    set(dbusinterface_sound_xml "com.ubuntu.AccountsService.Sound.Mock.xml")
else()
    set(dbusinterface_sound_xml "org.ayatana.AccountsService.Sound.Mock.xml")
endif()

set_source_files_properties(${dbusinterface_sound_xml} PROPERTIES
  CLASSNAME AccountsServiceSoundMockInterface)

qt5_add_dbus_interface(interface_files ${dbusinterface_sound_xml} accountsservice_sound_interface)

if(EXISTS "/usr/share/accountsservice/interfaces/com.ubuntu.AccountsService.Sound.xml")
    qt5_add_dbus_adaptor(adaptor_files
        com.ubuntu.AccountsService.Sound.Mock.xml
        AccountsServiceSoundMock.h
        ubuntu::indicators::testing::AccountsServiceSoundMock
        AccountsServiceSoundMockAdaptor)
else()
    qt5_add_dbus_adaptor(adaptor_files
        org.ayatana.AccountsService.Sound.Mock.xml
        AccountsServiceSoundMock.h
        ubuntu::indicators::testing::AccountsServiceSoundMock
        AccountsServiceSoundMockAdaptor)
endif()

qt5_add_dbus_adaptor(adaptor_files
    ${CMAKE_SOURCE_DIR}/tests/dbus-types/org.freedesktop.Accounts.xml
    AccountsMock.h
    ubuntu::indicators::testing::AccountsMock
    AccountsMockAdaptor)

add_executable(
  accounts-service-sound
  ${interface_files}
  ${adaptor_files}
  AccountsServiceSoundMock.cpp
  AccountsMock.cpp
  ${CMAKE_SOURCE_DIR}/tests/service-mocks/DBusPropertiesNotifier.cpp
  main.cpp
)

qt5_use_modules(
    accounts-service-sound
    Core
    DBus
)