CMakeLists.txt 5.07 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
project(kalarm)
2

3
add_definitions(-DQT_STRICT_ITERATORS)
4

5
6
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
Laurent Montel's avatar
Laurent Montel committed
7

Stephen Kelly's avatar
Stephen Kelly committed
8
set(CMAKE_AUTOMOC_RELAXED_MODE ON)
Laurent Montel's avatar
Laurent Montel committed
9

10

11

David Jarvie's avatar
David Jarvie committed
12

13
14
include_directories(
    ${CMAKE_CURRENT_BINARY_DIR}
Stephen Kelly's avatar
Stephen Kelly committed
15
16
    ${CMAKE_CURRENT_SOURCE_DIR}/
    ${CMAKE_CURRENT_SOURCE_DIR}/lib
17
)
Laurent Montel's avatar
Laurent Montel committed
18

Stephen Kelly's avatar
Stephen Kelly committed
19
20
21
add_subdirectory(appicons)
add_subdirectory(pixmaps)
add_subdirectory(autostart)
22
add_subdirectory(kconf_update)
23

24
25
26
set(libkalarm_common_SRCS)
ecm_qt_declare_logging_category(libkalarm_common_SRCS HEADER kalarm_debug.h IDENTIFIER KALARM_LOG CATEGORY_NAME log_kalarm)

27
########### next target ###############
28
set(libkalarm_SRCS
Stephen Kelly's avatar
Stephen Kelly committed
29
30
31
32
    lib/buttongroup.cpp
    lib/checkbox.cpp
    lib/colourbutton.cpp
    lib/combobox.cpp
33
34
    lib/desktop.cpp
    lib/filedialog.cpp
35
    lib/groupbox.cpp
36
37
    lib/itembox.cpp
    lib/kalocale.cpp
Stephen Kelly's avatar
Stephen Kelly committed
38
    lib/label.cpp
Laurent Montel's avatar
Laurent Montel committed
39
    lib/messagebox.cpp
Stephen Kelly's avatar
Stephen Kelly committed
40
41
42
43
44
45
    lib/packedlayout.cpp
    lib/pushbutton.cpp
    lib/radiobutton.cpp
    lib/timeedit.cpp
    lib/timespinbox.cpp
    lib/timeperiod.cpp
46
    lib/timezonecombo.cpp
Stephen Kelly's avatar
Stephen Kelly committed
47
48
49
50
    lib/shellprocess.cpp
    lib/slider.cpp
    lib/spinbox.cpp
    lib/spinbox2.cpp
51
    lib/stackedwidgets.cpp
Stephen Kelly's avatar
Stephen Kelly committed
52
    lib/lineedit.cpp
53
    lib/synchtimer.cpp
54
)
55

David Jarvie's avatar
David Jarvie committed
56
set(kalarm_bin_SRCS ${libkalarm_SRCS}
57
    ${libkalarm_common_SRCS}
Stephen Kelly's avatar
Stephen Kelly committed
58
    birthdaydlg.cpp
59
    birthdaymodel.cpp
Stephen Kelly's avatar
Stephen Kelly committed
60
61
    main.cpp
    editdlg.cpp
62
    editdlgtypes.cpp
Stephen Kelly's avatar
Stephen Kelly committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
    soundpicker.cpp
    sounddlg.cpp
    alarmcalendar.cpp
    undo.cpp
    kalarmapp.cpp
    mainwindowbase.cpp
    mainwindow.cpp
    messagewin.cpp
    preferences.cpp
    prefdlg.cpp
    traywindow.cpp
    dbushandler.cpp
    recurrenceedit.cpp
    deferdlg.cpp
    functions.cpp
    fontcolour.cpp
    fontcolourbutton.cpp
80
    alarmtime.cpp
Stephen Kelly's avatar
Stephen Kelly committed
81
82
83
84
85
    alarmtimewidget.cpp
    specialactions.cpp
    reminder.cpp
    startdaytimer.cpp
    eventlistview.cpp
86
    alarmlistdelegate.cpp
Stephen Kelly's avatar
Stephen Kelly committed
87
88
89
90
91
92
93
94
95
    alarmlistview.cpp
    templatelistview.cpp
    kamail.cpp
    timeselector.cpp
    latecancel.cpp
    repetitionbutton.cpp
    emailidcombo.cpp
    find.cpp
    pickfileradio.cpp
96
97
98
    newalarmaction.cpp
    commandoptions.cpp
    resourceselector.cpp
Stephen Kelly's avatar
Stephen Kelly committed
99
100
101
    templatepickdlg.cpp
    templatedlg.cpp
    templatemenuaction.cpp
102
    wakedlg.cpp
David Jarvie's avatar
David Jarvie committed
103
)
104
set(kalarm_bin_SRCS ${kalarm_bin_SRCS}
Laurent Montel's avatar
Laurent Montel committed
105
    kalarmmigrateapplication.cpp
106
    akonadimodel.cpp
107
    akonadiresourcecreator.cpp
108
    collectionmodel.cpp
109
    collectionsearch.cpp
110
    itemlistmodel.cpp
111
    calendarmigrator.cpp
112
    eventid.cpp
113
   )
114

Laurent Montel's avatar
Laurent Montel committed
115
ki18n_wrap_ui(kalarm_bin_SRCS
116
117
118
    wakedlg.ui
)

Laurent Montel's avatar
Laurent Montel committed
119
qt5_add_dbus_adaptor(kalarm_bin_SRCS org.kde.kalarm.kalarm.xml dbushandler.h DBusHandler)
Laurent Montel's avatar
Laurent Montel committed
120
qt5_add_dbus_interfaces(kalarm_bin_SRCS ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml)
121

David Jarvie's avatar
David Jarvie committed
122
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/kalarmresource.kcfg org.kde.Akonadi.KAlarm.Settings)
Laurent Montel's avatar
Laurent Montel committed
123
qt5_add_dbus_interface(kalarm_bin_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.KAlarm.Settings.xml kalarmsettings KAlarmSettings)
124

David Jarvie's avatar
David Jarvie committed
125
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/kalarmdirresource.kcfg org.kde.Akonadi.KAlarmDir.Settings)
Laurent Montel's avatar
Laurent Montel committed
126
qt5_add_dbus_interface(kalarm_bin_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.KAlarmDir.Settings.xml kalarmdirsettings KAlarmDirSettings)
127

Laurent Montel's avatar
Laurent Montel committed
128
qt5_add_dbus_interfaces(kalarm_bin_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Control.xml)
David Jarvie's avatar
David Jarvie committed
129
#qt5_add_dbus_adaptor(kalarm_bin_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Control.xml agentbase.h Akonadi::AgentBase controladaptor Akonadi__ControlAdaptor)
130

Laurent Montel's avatar
Laurent Montel committed
131
kconfig_add_kcfg_files(kalarm_bin_SRCS GENERATE_MOC kalarmconfig.kcfgc)
David Jarvie's avatar
David Jarvie committed
132

133
#if (UNIX)
Laurent Montel's avatar
Laurent Montel committed
134
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/appicons/*-apps-kalarm.png")
Laurent Montel's avatar
Laurent Montel committed
135
ecm_add_app_icon(kalarm_bin_SRCS ICONS ${ICONS_SRCS})
Laurent Montel's avatar
Laurent Montel committed
136
add_executable(kalarm_bin ${kalarm_bin_SRCS})
Laurent Montel's avatar
Laurent Montel committed
137
add_dependencies(kalarm_bin kmail_xml)
138

Laurent Montel's avatar
Laurent Montel committed
139
set_target_properties(kalarm_bin PROPERTIES OUTPUT_NAME kalarm)
140

David Jarvie's avatar
David Jarvie committed
141
142
143
144
target_link_libraries(kalarm_bin
KF5::AlarmCalendar
KF5::CalendarCore
KF5::CalendarUtils
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
145
KF5::Contacts
David Jarvie's avatar
David Jarvie committed
146
KF5::Mime
Laurent Montel's avatar
Laurent Montel committed
147
KF5::IdentityManagement
David Jarvie's avatar
David Jarvie committed
148
149
150
151
152
KF5::MailTransport
KF5::AkonadiCore
KF5::AkonadiMime
KF5::AkonadiContact
KF5::Holidays
153
KF5::Codecs
154
KF5::ConfigCore
Laurent Montel's avatar
Laurent Montel committed
155
KF5::Libkdepim
Laurent Montel's avatar
Laurent Montel committed
156
Phonon::phonon4qt5
Laurent Montel's avatar
Laurent Montel committed
157
KF5::Auth
158
KF5::DBusAddons
Laurent Montel's avatar
Laurent Montel committed
159
pimcommon
David Jarvie's avatar
David Jarvie committed
160
)
161

Laurent Montel's avatar
Laurent Montel committed
162
163
164
165
if (Qt5X11Extras_FOUND)
  target_link_libraries(kalarm_bin Qt5::X11Extras)
endif()

166

167
install(TARGETS kalarm_bin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
168
#endif (UNIX)
169
170
171

########### install files ###############

172
173
174
175
176
177
install(PROGRAMS org.kde.kalarm.desktop  DESTINATION ${KDE_INSTALL_APPDIR})
install(PROGRAMS kalarm.autostart.desktop DESTINATION ${KDE_INSTALL_AUTOSTARTDIR})
install(FILES kalarm.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES kalarmconfig.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
install(FILES kalarmui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kalarm)
install(FILES org.kde.kalarm.kalarm.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})
178
179
180

########### KAuth helper ###############

181
add_executable(kalarm_helper rtcwakeaction.cpp ${libkalarm_common_SRCS})
Laurent Montel's avatar
Laurent Montel committed
182
target_link_libraries(kalarm_helper KF5::Auth KF5::KDELibs4Support)
183
install(TARGETS kalarm_helper DESTINATION ${KDE_INSTALL_LIBEXECDIR})
Laurent Montel's avatar
Laurent Montel committed
184
185
kauth_install_helper_files(kalarm_helper org.kde.kalarmrtcwake root)
kauth_install_actions(org.kde.kalarmrtcwake rtcwakeaction.actions)