CMakeLists.txt 8.06 KB
Newer Older
1

Laurent Montel's avatar
Laurent Montel committed
2
ecm_setup_version(PROJECT VARIABLE_PREFIX LIBKDEPIM
Laurent Montel's avatar
Laurent Montel committed
3 4 5 6
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/libkdepim_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkdepimConfigVersion.cmake"
    SOVERSION 5
    )
Laurent Montel's avatar
Laurent Montel committed
7

8
if (BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
9
    add_subdirectory(tests)
10
    add_subdirectory(misc/autotests)
11
    add_subdirectory(addressline/autotests/)
Laurent Montel's avatar
Laurent Montel committed
12
    add_subdirectory(progresswidget/autotests/)
Laurent Montel's avatar
Laurent Montel committed
13
    add_subdirectory(progresswidget/tests/)
14
endif()
15 16 17 18


########### next target ###############
set(kdepim_progresswidget_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
19 20 21 22 23 24
    progresswidget/progressmanager.cpp
    progresswidget/progressdialog.cpp
    progresswidget/statusbarprogresswidget.cpp
    progresswidget/ssllabel.cpp
    progresswidget/progressstatusbarwidget.cpp
    )
25 26

set(kdepim_widgets_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
27 28 29 30 31 32 33 34 35
    widgets/customlogwidget.cpp
    widgets/kdatepickerpopup.cpp
    widgets/kcheckcombobox.cpp
    widgets/kweekdaycheckcombo.cpp
    widgets/kwidgetlister.cpp
    widgets/pimmessagebox.cpp
    widgets/overlaywidget.cpp
    widgets/progressindicatorlabel.cpp
    )
36 37

set(kdepim_ldap_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
38 39 40 41 42
    ldap/ldapclient.cpp
    ldap/ldapsearchdialog.cpp
    ldap/ldapclientsearch.cpp
    ldap/ldapclientsearchconfig.cpp
    ldap/addhostdialog.cpp
Laurent Montel's avatar
Laurent Montel committed
43
    ldap/ldapconfigurewidget.cpp
Laurent Montel's avatar
Laurent Montel committed
44
    )
Laurent Montel's avatar
Laurent Montel committed
45

46
ecm_qt_declare_logging_category(kdepim_ldap_LIB_SRCS HEADER ldapclient_debug.h IDENTIFIER LDAPCLIENT_LOG CATEGORY_NAME org.kde.pim.ldapclient
Laurent Montel's avatar
Laurent Montel committed
47 48 49 50
        DESCRIPTION "ldapclient (libkdepim)"
        OLD_CATEGORY_NAMES log_ldapclient
        EXPORT LIBKDEPIM
    )
51 52

set(kdepim_misc_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
53 54 55 56
    misc/broadcaststatus.cpp
    misc/emailvalidator.cpp
    misc/maillistdrag.cpp
    misc/uistatesaver.cpp
57
    misc/lineeditcatchreturnkey.cpp
Laurent Montel's avatar
Laurent Montel committed
58
    )
59 60

set(kdepim_multiplyingline_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
61 62 63 64
    multiplyingline/multiplyingline.cpp
    multiplyingline/multiplyinglineeditor.cpp
    multiplyingline/multiplyinglineview_p.cpp
    )
65

66 67 68
set(kdepim_addressline_LIB_SRCS
    addressline/recentaddress/recentaddresswidget.cpp
    addressline/recentaddress/recentaddresses.cpp
69
    addressline/addresslineedit/addresseelineeditutil.cpp
70 71 72
    )


73
set(kdepim_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
74 75 76 77 78
    ${kdepim_progresswidget_LIB_SRCS}
    ${kdepim_widgets_LIB_SRCS}
    ${kdepim_ldap_LIB_SRCS}
    ${kdepim_misc_LIB_SRCS}
    ${kdepim_multiplyingline_LIB_SRCS}
79
    ${kdepim_addressline_LIB_SRCS}
Laurent Montel's avatar
Laurent Montel committed
80 81
    prefs/kprefsdialog.cpp
    )
82
ecm_qt_declare_logging_category(kdepim_LIB_SRCS HEADER libkdepim_debug.h IDENTIFIER LIBKDEPIM_LOG CATEGORY_NAME org.kde.pim.libkdepim
Laurent Montel's avatar
Laurent Montel committed
83 84 85 86 87
        DESCRIPTION "libkdepim (libkdepim)"
        OLD_CATEGORY_NAMES log_libkdepim
        EXPORT LIBKDEPIM
    )

88 89 90 91 92 93 94 95 96


add_library(KF5Libkdepim ${kdepim_LIB_SRCS})
generate_export_header(KF5Libkdepim BASE_NAME kdepim)
add_library(KF5::Libkdepim ALIAS KF5Libkdepim)
target_include_directories(KF5Libkdepim INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/Libkdepim/;${KDE_INSTALL_INCLUDEDIR_KF5}/libkdepim>")
target_include_directories(KF5Libkdepim PUBLIC "$<BUILD_INTERFACE:${libkdepim_SOURCE_DIR}/src;${libkdepim_BINARY_DIR}/src;>")

target_link_libraries(KF5Libkdepim
Laurent Montel's avatar
Laurent Montel committed
97 98 99 100 101 102 103 104 105 106 107
    PRIVATE
    KF5::Ldap
    KF5::Contacts
    KF5::Codecs
    KF5::Completion
    KF5::I18n
    KF5::KCMUtils
    KF5::Wallet
    KF5::KIOCore
    KF5::KIOWidgets
    )
108 109 110


if(MINGW)
Laurent Montel's avatar
Laurent Montel committed
111
    target_link_libraries(KF5Libkdepim oleaut32)
112 113 114 115 116 117 118
endif()


set_target_properties(KF5Libkdepim PROPERTIES
    VERSION ${LIBKDEPIM_VERSION_STRING}
    SOVERSION ${LIBKDEPIM_SOVERSION}
    EXPORT_NAME Libkdepim
Laurent Montel's avatar
Laurent Montel committed
119
    )
120 121 122 123

install(TARGETS
    KF5Libkdepim
    EXPORT KF5LibkdepimTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} ${LIBRARY_NAMELINK}
Laurent Montel's avatar
Laurent Montel committed
124
    )
125 126

ecm_generate_headers(libkdepim_Camelcaseldap_HEADERS
Laurent Montel's avatar
Laurent Montel committed
127 128 129 130 131 132
    HEADER_NAMES
    LdapClientSearchConfig
    LdapClientSearch
    AddHostDialog
    LdapSearchDialog
    LdapClient
Laurent Montel's avatar
Laurent Montel committed
133
    LdapConfigureWidget
Laurent Montel's avatar
Laurent Montel committed
134 135 136 137
    REQUIRED_HEADERS libkdepim_ldap_HEADERS
    PREFIX Libkdepim
    RELATIVE ldap
    )
138 139

ecm_generate_headers(libkdepim_Camelcasewidgets_HEADERS
Laurent Montel's avatar
Laurent Montel committed
140 141 142 143 144 145
    HEADER_NAMES
    CustomLogWidget
    KCheckComboBox
    KDatePickerPopup
    KWeekdayCheckCombo
    KWidgetLister
146
    OverlayWidget
Laurent Montel's avatar
Laurent Montel committed
147 148 149 150 151 152
    PIMMessageBox
    ProgressIndicatorLabel
    REQUIRED_HEADERS libkdepim_widgets_HEADERS
    PREFIX Libkdepim
    RELATIVE widgets
    )
153 154

ecm_generate_headers(libkdepim_Camelcasemisc_HEADERS
Laurent Montel's avatar
Laurent Montel committed
155 156 157 158 159 160
    HEADER_NAMES
    EmailValidator
    BroadcastStatus
    MaillistDrag
    UiStateSaver
    KCursorSaver
161
    LineEditCatchReturnKey
Laurent Montel's avatar
Laurent Montel committed
162 163 164 165
    REQUIRED_HEADERS libkdepim_misc_HEADERS
    PREFIX Libkdepim
    RELATIVE misc
    )
166 167

ecm_generate_headers(libkdepim_Camelcaseprogresswidget_HEADERS
Laurent Montel's avatar
Laurent Montel committed
168 169 170 171 172 173 174 175 176
    HEADER_NAMES
    ProgressStatusBarWidget
    StatusbarProgressWidget
    ProgressDialog
    ProgressManager
    REQUIRED_HEADERS libkdepim_progresswidget_HEADERS
    PREFIX Libkdepim
    RELATIVE progresswidget
    )
177 178

ecm_generate_headers(libkdepim_Camelcasepref_HEADERS
Laurent Montel's avatar
Laurent Montel committed
179 180 181 182 183 184
    HEADER_NAMES
    KPrefsDialog
    REQUIRED_HEADERS libkdepim_pref_HEADERS
    PREFIX Libkdepim
    RELATIVE prefs
    )
185 186

ecm_generate_headers(libkdepim_Camelcasemultiline_HEADERS
Laurent Montel's avatar
Laurent Montel committed
187 188 189 190 191
    HEADER_NAMES
    MultiplyingLine
    MultiplyingLineEditor
    REQUIRED_HEADERS libkdepim_multiline_HEADERS
    PREFIX Libkdepim
Laurent Montel's avatar
Laurent Montel committed
192
    RELATIVE multiplyingline
Laurent Montel's avatar
Laurent Montel committed
193
    )
194

195 196 197 198
ecm_generate_headers(libkdepim_Camelcaserecentaddress_HEADERS
    HEADER_NAMES
    RecentAddresses
    REQUIRED_HEADERS libkdepim_recentaddress_HEADERS
Laurent Montel's avatar
Laurent Montel committed
199
    PREFIX Libkdepim
200 201 202
    RELATIVE addressline/recentaddress/
    )

203 204 205 206 207 208 209 210 211
ecm_generate_headers(libkdepim_Camelcaseaddressline_HEADERS
    HEADER_NAMES
    AddresseeLineEditUtil
    REQUIRED_HEADERS libkdepim_addressline_HEADERS
    PREFIX Libkdepim
    RELATIVE addressline/addresslineedit/
    )


212

213 214 215

ecm_generate_pri_file(BASE_NAME Libkdepim
    LIB_NAME KF5Libkdepim
Laurent Montel's avatar
Laurent Montel committed
216
    DEPS "" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkdepim
Laurent Montel's avatar
Laurent Montel committed
217
    )
218 219 220 221 222 223 224 225 226

install(FILES
    ${libkdepim_CamelcaseCamelCase_HEADERS}
    ${libkdepim_Camelcaseldap_HEADERS}
    ${libkdepim_Camelcasewidgets_HEADERS}
    ${libkdepim_Camelcaseprogresswidget_HEADERS}
    ${libkdepim_Camelcasemisc_HEADERS}
    ${libkdepim_Camelcasepref_HEADERS}
    ${libkdepim_Camelcasemultiline_HEADERS}
227
    ${libkdepim_Camelcaserecentaddress_HEADERS}
228
    ${libkdepim_Camelcaseaddressline_HEADERS}
229 230
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkdepim
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
231
    )
232 233 234 235 236 237 238 239 240 241

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/kdepim_export.h
    ${libkdepim_CamelCase_HEADERS}
    ${libkdepim_ldap_HEADERS}
    ${libkdepim_progresswidget_HEADERS}
    ${libkdepim_misc_HEADERS}
    ${libkdepim_widgets_HEADERS}
    ${libkdepim_pref_HEADERS}
    ${libkdepim_multiline_HEADERS}
242
    ${libkdepim_recentaddress_HEADERS}
243
    ${libkdepim_addressline_HEADERS}
244 245
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libkdepim
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
246
    )
247 248 249 250 251

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

252 253 254
if(BUILD_DESIGNERPLUGIN)
    add_subdirectory(designer)
endif()
255 256 257 258
########### next target ###############


set( kcm_ldap_SRCS
Laurent Montel's avatar
Laurent Montel committed
259 260
    ldap/kcmldap.cpp
    )
261 262 263 264

add_library(kcm_ldap MODULE ${kcm_ldap_SRCS})


265
target_link_libraries(kcm_ldap KF5::Libkdepim KF5::KCMUtils KF5::I18n KF5::Ldap Qt5::Core)
266 267 268 269 270 271 272 273 274 275

kcoreaddons_desktop_to_json(kcm_ldap ldap/kcmldap.desktop DEFAULT_SERVICE_TYPE)

install(TARGETS kcm_ldap DESTINATION ${KDE_INSTALL_PLUGINDIR})

install(FILES ldap/kcmldap.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})

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

install(FILES interfaces/org.kde.addressbook.service.xml interfaces/org.kde.mailtransport.service.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})
Laurent Montel's avatar
Laurent Montel committed
276 277 278 279

set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Libkdepim")

configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
280 281 282 283
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5LibkdepimConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkdepimConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
    )
Laurent Montel's avatar
Laurent Montel committed
284 285

install(FILES
Laurent Montel's avatar
Laurent Montel committed
286 287 288 289 290
    "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkdepimConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkdepimConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
    )
Laurent Montel's avatar
Laurent Montel committed
291 292 293 294

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

install(FILES
Laurent Montel's avatar
Laurent Montel committed
295 296 297
    ${CMAKE_CURRENT_BINARY_DIR}/libkdepim_version.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
    )