CMakeLists.txt 7.78 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5ContactEditor")

Laurent Montel's avatar
Laurent Montel committed
3
ecm_setup_version(PROJECT VARIABLE_PREFIX AKONADICONTACT
Laurent Montel's avatar
Laurent Montel committed
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
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/contact-editor_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfigVersion.cmake"
    SOVERSION 5
    )
configure_package_config_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5ContactEditorConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
    )
install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
    )

install(EXPORT KF5ContactEditorTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5ContactEditorTargets.cmake NAMESPACE KF5::)

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
    )

configure_file(config-contact-editor.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-contact-editor.h)


Laurent Montel's avatar
Laurent Montel committed
32

Laurent Montel's avatar
Laurent Montel committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
set(contacteditor_customfieldseditor_SRCS
    editor/customfieldeditor/customfieldswidget.cpp
    editor/customfieldeditor/customfieldeditorwidget.cpp
    editor/customfieldeditor/customfieldslistwidget.cpp
    editor/customfieldeditor/customfieldslistdelegate.cpp
    editor/customfieldeditor/customfieldsmodel.cpp
    )

set(contacteditor_editor_utils_SRCS
    editor/utils/utils.cpp
    )

set(contacteditor_editor_widgets_SRCS
    editor/widgets/kwidgetlister.cpp
Laurent Montel's avatar
Laurent Montel committed
47
    editor/widgets/contacteditorcombobox.cpp
Laurent Montel's avatar
Laurent Montel committed
48
49
50
51
52
53
54
55
56
57
58
59
60
61
    )

set(contacteditor_editor_generalinfo_phone_SRCS
    editor/generalinfoeditor/phone/phonewidgetlister.cpp
    editor/generalinfoeditor/phone/phonewidget.cpp
    editor/generalinfoeditor/phone/phonelistwidget.cpp
    editor/generalinfoeditor/phone/phonecomboboxtype.cpp
    editor/generalinfoeditor/phone/phonetypedialog.cpp
    )

set(contacteditor_editor_generalinfo_web_SRCS
    editor/generalinfoeditor/web/webwidgetlister.cpp
    editor/generalinfoeditor/web/weblistwidget.cpp
    editor/generalinfoeditor/web/webwidget.cpp
62
    editor/generalinfoeditor/web/webselecttypecombobox.cpp
Laurent Montel's avatar
Laurent Montel committed
63
64
65
66
67
    )
set(contacteditor_editor_generalinfo_mail_SRCS
    editor/generalinfoeditor/mail/maillistwidget.cpp
    editor/generalinfoeditor/mail/mailwidget.cpp
    editor/generalinfoeditor/mail/mailwidgetlister.cpp
68
    editor/generalinfoeditor/mail/mailtypecombobox.cpp
Laurent Montel's avatar
Laurent Montel committed
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
    )

set(contacteditor_editor_generalinfo_messaging_SRCS
    editor/generalinfoeditor/messaging/messaginglistwidget.cpp
    editor/generalinfoeditor/messaging/messagingwidget.cpp
    editor/generalinfoeditor/messaging/messagingwidgetlister.cpp
    )


set(contacteditor_editor_generalinfo_SRCS
    editor/generalinfoeditor/generalinfowidget.cpp
    editor/generalinfoeditor/namewidget.cpp
    editor/generalinfoeditor/nicknamewidget.cpp
    editor/generalinfoeditor/categorieseditwidget.cpp
    editor/generalinfoeditor/nameeditdialog.cpp
    editor/generalinfoeditor/displaynameeditwidget.cpp
    editor/generalinfoeditor/messageformattingwidget.cpp
Laurent Montel's avatar
Laurent Montel committed
86
    editor/generalinfoeditor/blogfeedwidget.cpp
Laurent Montel's avatar
Laurent Montel committed
87
88
89
90
91
92
93
    ${contacteditor_editor_generalinfo_messaging_SRCS}
    ${contacteditor_editor_generalinfo_phone_SRCS}
    ${contacteditor_editor_generalinfo_web_SRCS}
    ${contacteditor_editor_generalinfo_mail_SRCS}
    )

set(contacteditor_addresslocation_editor_SRCS
94
95
    editor/addresseditor/addressdelegate.cpp
    editor/addresseditor/addressmodel.cpp
Laurent Montel's avatar
Laurent Montel committed
96
    editor/addresseditor/addresseslocationwidget.cpp
97
98
99
    editor/addresseditor/addresslocationwidget.cpp
    editor/addresseditor/addresstypedialog.cpp
    editor/addresseditor/selectaddresstypecombobox.cpp
Laurent Montel's avatar
Laurent Montel committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
    )

set(contacteditor_personal_editor_SRCS
    editor/personaleditor/personaleditorwidget.cpp
    editor/personaleditor/dateeditwidget.cpp
    editor/personaleditor/kdatepickerpopup.cpp
    )

set(contacteditor_business_editor_SRCS
    editor/businesseditor/businesseditorwidget.cpp
    editor/businesseditor/freebusyeditwidget.cpp
    )

set(contacteditor_editor_SRCS
    ${contacteditor_personal_editor_SRCS}
    ${contacteditor_editor_utils_SRCS}
    ${contacteditor_business_editor_SRCS}
    editor/contacteditorwidget.cpp
    editor/widgets/imagewidget.cpp
    editor/widgets/preferredlineeditwidget.cpp
120
    editor/widgets/categorieseditabstractwidget.cpp
Laurent Montel's avatar
Laurent Montel committed
121
122
123
124
125
126
127
128
129
130
131
132
133
134
    customfields.cpp
    customfieldmanager.cpp
    contactmetadatabase.cpp
)

set(contacteditor_LIB_SRC
    ${contacteditor_addresslocation_editor_SRCS}
    ${contacteditor_editor_widgets_SRCS}
    ${contacteditor_editor_generalinfo_SRCS}
    ${contacteditor_customfieldseditor_SRCS}
    ${contacteditor_attributes_SRCS}
    ${contacteditor_job_SRCS}
    )

135
ecm_qt_declare_logging_category(contacteditor_LIB_SRC HEADER contacteditor_debug.h IDENTIFIER CONTACTEDITOR_LOG CATEGORY_NAME org.kde.pim.contacteditor
Laurent Montel's avatar
Laurent Montel committed
136
137
138
139
140
        DESCRIPTION "akonadicontact (contact editor)"
        EXPORT AKONADICONTACTS
    )


Laurent Montel's avatar
Laurent Montel committed
141
142
143
144
145
146
147
148
149

set(contacteditor_LIB_SRC
    ${contacteditor_LIB_SRC}
    ${contacteditor_editor_SRCS}
    )



add_library(KF5ContactEditor ${contacteditor_LIB_SRC})
Kevin Funk's avatar
Kevin Funk committed
150

Laurent Montel's avatar
Laurent Montel committed
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
generate_export_header(KF5ContactEditor BASE_NAME contacteditor)

add_library(KF5::ContactEditor ALIAS KF5ContactEditor)

target_include_directories(KF5ContactEditor INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor;${KDE_INSTALL_INCLUDEDIR_KF5}>")
target_include_directories(KF5ContactEditor INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/contacteditor>")
target_include_directories(KF5ContactEditor PUBLIC "$<BUILD_INTERFACE:${Akonadi-Contact_SOURCE_DIR}/src/contact-editor;${Akonadi-Contact_BINARY_DIR}/src/contact-editor>")

target_link_libraries(KF5ContactEditor
    PUBLIC
    KF5::Contacts
    Qt5::Widgets
    PRIVATE
    KF5::Completion
    KF5::ConfigCore
    KF5::ConfigWidgets
    KF5::KIOWidgets
    KF5::I18n
    KF5::TextWidgets
    KF5::WidgetsAddons
    )

set_target_properties(KF5ContactEditor PROPERTIES
    VERSION ${AKONADICONTACT_VERSION_STRING}
    SOVERSION ${AKONADICONTACT_SOVERSION}
    EXPORT_NAME ContactEditor
    )

install(TARGETS
    KF5ContactEditor
    EXPORT KF5ContactEditorTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
    )

ecm_generate_pri_file(BASE_NAME ContactEditor
    LIB_NAME KF5ContactEditor
Laurent Montel's avatar
Laurent Montel committed
186
    DEPS "KContacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor
Laurent Montel's avatar
Laurent Montel committed
187
188
189
190
191
192
193
194
195
196
197
    )

install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})

ecm_generate_headers(ContactEditor_CamelCase_HEADERS
    HEADER_NAMES
    ContactEditorPagePlugin
    REQUIRED_HEADERS ContactEditor_HEADERS
    PREFIX ContactEditor
    )

198
199
200
201
202
203
204
205
ecm_generate_headers(ContactEditorWidget_CamelCase_HEADERS
    HEADER_NAMES
    CategoriesEditAbstractWidget
    REQUIRED_HEADERS ContactEditorWidget_HEADERS
    PREFIX ContactEditor
    RELATIVE editor/widgets/
    )

Laurent Montel's avatar
Laurent Montel committed
206
207
install( FILES
    ${ContactEditor_CamelCase_HEADERS}
208
    ${ContactEditorWidget_CamelCase_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
209
210
211
212
213
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor COMPONENT Devel
    )

install( FILES
    ${ContactEditor_HEADERS}
214
    ${ContactEditorWidget_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
215
216
217
218
219
220
221
    ${CMAKE_CURRENT_BINARY_DIR}/contacteditor_export.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/contacteditor COMPONENT Devel
    )



if (BUILD_TESTING)
222
    add_subdirectory(editor/addresseditor/autotests/)
Laurent Montel's avatar
Laurent Montel committed
223
224
    add_subdirectory(editor/generalinfoeditor/autotests/)
    add_subdirectory(editor/generalinfoeditor/tests)
Laurent Montel's avatar
Laurent Montel committed
225
226
    add_subdirectory(editor/customfieldeditor/autotests/)
    add_subdirectory(editor/customfieldeditor/tests)
Laurent Montel's avatar
Laurent Montel committed
227
228
229
    add_subdirectory(editor/widgets/autotests/)
endif()

Laurent Montel's avatar
Laurent Montel committed
230
231
232
install(FILES editor/pics/world.jpg DESTINATION ${KDE_INSTALL_DATADIR_KF5}/akonadi/contact/pics)
install(FILES editor/data/zone.tab DESTINATION ${KDE_INSTALL_DATADIR_KF5}/akonadi/contact/data)