CMakeLists.txt 5.45 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)
Laurent Montel's avatar
Laurent Montel committed
10
    add_subdirectory(progresswidget/autotests/)
Laurent Montel's avatar
Laurent Montel committed
11
    add_subdirectory(progresswidget/tests/)
12
endif()
13 14 15 16


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

set(kdepim_widgets_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
25 26 27 28
    widgets/kcheckcombobox.cpp
    widgets/kwidgetlister.cpp
    widgets/progressindicatorlabel.cpp
    )
29 30

set(kdepim_misc_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
31
    misc/uistatesaver.cpp
32
    misc/lineeditcatchreturnkey.cpp
Laurent Montel's avatar
Laurent Montel committed
33
    )
34 35

set(kdepim_multiplyingline_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
36 37 38 39
    multiplyingline/multiplyingline.cpp
    multiplyingline/multiplyinglineeditor.cpp
    multiplyingline/multiplyinglineview_p.cpp
    )
40 41

set(kdepim_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
42 43 44 45 46 47
    ${kdepim_progresswidget_LIB_SRCS}
    ${kdepim_widgets_LIB_SRCS}
    ${kdepim_misc_LIB_SRCS}
    ${kdepim_multiplyingline_LIB_SRCS}
    prefs/kprefsdialog.cpp
    )
48
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
49 50 51 52 53
        DESCRIPTION "libkdepim (libkdepim)"
        OLD_CATEGORY_NAMES log_libkdepim
        EXPORT LIBKDEPIM
    )

54 55 56 57 58 59 60 61 62


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
63 64 65 66 67 68 69 70 71
    PRIVATE
    KF5::Codecs
    KF5::Completion
    KF5::I18n
    KF5::KCMUtils
    KF5::Wallet
    KF5::KIOCore
    KF5::KIOWidgets
    )
72 73 74


if(MINGW)
Laurent Montel's avatar
Laurent Montel committed
75
    target_link_libraries(KF5Libkdepim oleaut32)
76 77 78 79 80 81 82
endif()


set_target_properties(KF5Libkdepim PROPERTIES
    VERSION ${LIBKDEPIM_VERSION_STRING}
    SOVERSION ${LIBKDEPIM_SOVERSION}
    EXPORT_NAME Libkdepim
Laurent Montel's avatar
Laurent Montel committed
83
    )
84 85 86 87

install(TARGETS
    KF5Libkdepim
    EXPORT KF5LibkdepimTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} ${LIBRARY_NAMELINK}
Laurent Montel's avatar
Laurent Montel committed
88
    )
89 90

ecm_generate_headers(libkdepim_Camelcasewidgets_HEADERS
Laurent Montel's avatar
Laurent Montel committed
91 92 93 94 95 96 97 98
    HEADER_NAMES
    KCheckComboBox
    KWidgetLister
    ProgressIndicatorLabel
    REQUIRED_HEADERS libkdepim_widgets_HEADERS
    PREFIX Libkdepim
    RELATIVE widgets
    )
99 100

ecm_generate_headers(libkdepim_Camelcasemisc_HEADERS
Laurent Montel's avatar
Laurent Montel committed
101 102 103
    HEADER_NAMES
    UiStateSaver
    KCursorSaver
104
    LineEditCatchReturnKey
Laurent Montel's avatar
Laurent Montel committed
105 106 107 108
    REQUIRED_HEADERS libkdepim_misc_HEADERS
    PREFIX Libkdepim
    RELATIVE misc
    )
109 110

ecm_generate_headers(libkdepim_Camelcaseprogresswidget_HEADERS
Laurent Montel's avatar
Laurent Montel committed
111 112 113 114 115 116 117 118 119
    HEADER_NAMES
    ProgressStatusBarWidget
    StatusbarProgressWidget
    ProgressDialog
    ProgressManager
    REQUIRED_HEADERS libkdepim_progresswidget_HEADERS
    PREFIX Libkdepim
    RELATIVE progresswidget
    )
120 121

ecm_generate_headers(libkdepim_Camelcasepref_HEADERS
Laurent Montel's avatar
Laurent Montel committed
122 123 124 125 126 127
    HEADER_NAMES
    KPrefsDialog
    REQUIRED_HEADERS libkdepim_pref_HEADERS
    PREFIX Libkdepim
    RELATIVE prefs
    )
128 129

ecm_generate_headers(libkdepim_Camelcasemultiline_HEADERS
Laurent Montel's avatar
Laurent Montel committed
130 131 132 133 134
    HEADER_NAMES
    MultiplyingLine
    MultiplyingLineEditor
    REQUIRED_HEADERS libkdepim_multiline_HEADERS
    PREFIX Libkdepim
Laurent Montel's avatar
Laurent Montel committed
135
    RELATIVE multiplyingline
Laurent Montel's avatar
Laurent Montel committed
136
    )
137 138 139

ecm_generate_pri_file(BASE_NAME Libkdepim
    LIB_NAME KF5Libkdepim
Laurent Montel's avatar
Laurent Montel committed
140
    DEPS "" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkdepim
Laurent Montel's avatar
Laurent Montel committed
141
    )
142 143 144 145 146 147 148 149 150 151

install(FILES
    ${libkdepim_CamelcaseCamelCase_HEADERS}
    ${libkdepim_Camelcasewidgets_HEADERS}
    ${libkdepim_Camelcaseprogresswidget_HEADERS}
    ${libkdepim_Camelcasemisc_HEADERS}
    ${libkdepim_Camelcasepref_HEADERS}
    ${libkdepim_Camelcasemultiline_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkdepim
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
152
    )
153 154 155 156 157 158 159 160 161 162 163

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/kdepim_export.h
    ${libkdepim_CamelCase_HEADERS}
    ${libkdepim_progresswidget_HEADERS}
    ${libkdepim_misc_HEADERS}
    ${libkdepim_widgets_HEADERS}
    ${libkdepim_pref_HEADERS}
    ${libkdepim_multiline_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libkdepim
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
164
    )
165 166 167 168 169

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

170 171 172
if(BUILD_DESIGNERPLUGIN)
    add_subdirectory(designer)
endif()
173 174 175
########### 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
176 177 178 179

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

configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
180 181 182 183
    "${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
184 185

install(FILES
Laurent Montel's avatar
Laurent Montel committed
186 187 188 189 190
    "${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
191 192 193 194

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

install(FILES
Laurent Montel's avatar
Laurent Montel committed
195 196 197
    ${CMAKE_CURRENT_BINARY_DIR}/libkdepim_version.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
    )