CMakeLists.txt 5.21 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
    ${CMAKE_SOURCE_DIR}
Laurent Montel's avatar
Laurent Montel committed
18
    ${CMAKE_SOURCE_DIR}/libkdepim/
19
20
    ${Boost_INCLUDE_DIR}
)
Laurent Montel's avatar
Laurent Montel committed
21

Stephen Kelly's avatar
Stephen Kelly committed
22
23
24
add_subdirectory(appicons)
add_subdirectory(pixmaps)
add_subdirectory(autostart)
25
26
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}
Stephen Kelly's avatar
Stephen Kelly committed
57
    birthdaydlg.cpp
58
    birthdaymodel.cpp
Stephen Kelly's avatar
Stephen Kelly committed
59
60
    main.cpp
    editdlg.cpp
61
    editdlgtypes.cpp
Stephen Kelly's avatar
Stephen Kelly committed
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
    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
79
    alarmtime.cpp
Stephen Kelly's avatar
Stephen Kelly committed
80
81
82
83
84
    alarmtimewidget.cpp
    specialactions.cpp
    reminder.cpp
    startdaytimer.cpp
    eventlistview.cpp
85
    alarmlistdelegate.cpp
Stephen Kelly's avatar
Stephen Kelly committed
86
87
88
89
90
91
92
93
94
    alarmlistview.cpp
    templatelistview.cpp
    kamail.cpp
    timeselector.cpp
    latecancel.cpp
    repetitionbutton.cpp
    emailidcombo.cpp
    find.cpp
    pickfileradio.cpp
95
96
97
    newalarmaction.cpp
    commandoptions.cpp
    resourceselector.cpp
Stephen Kelly's avatar
Stephen Kelly committed
98
99
100
    templatepickdlg.cpp
    templatedlg.cpp
    templatemenuaction.cpp
101
    wakedlg.cpp
David Jarvie's avatar
David Jarvie committed
102
)
103
104
set(kalarm_bin_SRCS ${kalarm_bin_SRCS}
    akonadimodel.cpp
105
    akonadiresourcecreator.cpp
106
    collectionmodel.cpp
107
    collectionsearch.cpp
108
    itemlistmodel.cpp
109
    calendarmigrator.cpp
110
    eventid.cpp
111
   )
112

Laurent Montel's avatar
Laurent Montel committed
113
ki18n_wrap_ui(kalarm_bin_SRCS
114
115
116
    wakedlg.ui
)

Laurent Montel's avatar
Laurent Montel committed
117
qt5_add_dbus_adaptor(kalarm_bin_SRCS org.kde.kalarm.kalarm.xml dbushandler.h DBusHandler)
Laurent Montel's avatar
Laurent Montel committed
118
qt5_add_dbus_interfaces(kalarm_bin_SRCS ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml)
Laurent Montel's avatar
Laurent Montel committed
119
#REACTIVATE qt5_add_dbus_interfaces(kalarm_bin_SRCS ${KDE4_DBUS_INTERFACES_DIR}/org.kde.KSpeech.xml)
120

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

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

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

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

132
#if (UNIX)
133
kde4_add_app_icon(kalarm_bin_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/appicons/ox*-app-kalarm.png")
Laurent Montel's avatar
Laurent Montel committed
134
add_executable(kalarm_bin ${kalarm_bin_SRCS})
David Jarvie's avatar
David Jarvie committed
135
add_dependencies(kalarm_bin kalarm_resource_xml kalarmdir_resource_xml)
Laurent Montel's avatar
Laurent Montel committed
136
add_dependencies(kalarm_bin kmail_xml)
137

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

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

Laurent Montel's avatar
Laurent Montel committed
159
160
161
162
if (Qt5X11Extras_FOUND)
  target_link_libraries(kalarm_bin Qt5::X11Extras)
endif()

163

164
install(TARGETS kalarm_bin ${INSTALL_TARGETS_DEFAULT_ARGS})
165
#endif (UNIX)
166
167
168

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

Laurent Montel's avatar
Laurent Montel committed
169
install(PROGRAMS org.kde.kalarm.desktop  DESTINATION ${XDG_APPS_INSTALL_DIR})
170
install(PROGRAMS kalarm.autostart.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
171
install(FILES kalarm.appdata.xml DESTINATION ${CMAKE_INSTALL_METAINFODIR})
172
install(FILES kalarmconfig.kcfg DESTINATION ${KCFG_INSTALL_DIR})
173
install(FILES kalarmui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kalarm)
174
175
176
install(FILES org.kde.kalarm.kalarm.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR})
install(FILES kalarm.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR})
install(PROGRAMS kalarm-version.pl kalarm-1.2.1-general.pl kalarm-1.9.5-defaults.pl kalarm-2.0.2-general.pl kalarm-2.1.5-general.pl DESTINATION ${KCONF_UPDATE_INSTALL_DIR})
177
178
179

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

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