CMakeLists.txt 5.18 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
    ${kdepim_progresswidget_LIB_SRCS}
    ${kdepim_widgets_LIB_SRCS}
    ${kdepim_misc_LIB_SRCS}
    ${kdepim_multiplyingline_LIB_SRCS}
    )
47
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
48 49 50 51 52
        DESCRIPTION "libkdepim (libkdepim)"
        OLD_CATEGORY_NAMES log_libkdepim
        EXPORT LIBKDEPIM
    )

53 54 55 56 57 58 59 60 61


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
62 63 64 65 66 67
    PRIVATE
    KF5::Codecs
    KF5::Completion
    KF5::I18n
    KF5::KIOCore
    KF5::KIOWidgets
Laurent Montel's avatar
Laurent Montel committed
68 69
    KF5::ConfigGui
    KF5::KCMUtils
Laurent Montel's avatar
Laurent Montel committed
70
    )
71 72 73


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


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

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

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

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

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

ecm_generate_headers(libkdepim_Camelcasemultiline_HEADERS
Laurent Montel's avatar
Laurent Montel committed
121 122 123 124 125
    HEADER_NAMES
    MultiplyingLine
    MultiplyingLineEditor
    REQUIRED_HEADERS libkdepim_multiline_HEADERS
    PREFIX Libkdepim
Laurent Montel's avatar
Laurent Montel committed
126
    RELATIVE multiplyingline
Laurent Montel's avatar
Laurent Montel committed
127
    )
128 129 130

ecm_generate_pri_file(BASE_NAME Libkdepim
    LIB_NAME KF5Libkdepim
Laurent Montel's avatar
Laurent Montel committed
131
    DEPS "" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkdepim
Laurent Montel's avatar
Laurent Montel committed
132
    )
133 134 135 136 137 138 139 140 141

install(FILES
    ${libkdepim_CamelcaseCamelCase_HEADERS}
    ${libkdepim_Camelcasewidgets_HEADERS}
    ${libkdepim_Camelcaseprogresswidget_HEADERS}
    ${libkdepim_Camelcasemisc_HEADERS}
    ${libkdepim_Camelcasemultiline_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkdepim
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
142
    )
143 144 145 146 147 148 149 150 151 152

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/kdepim_export.h
    ${libkdepim_CamelCase_HEADERS}
    ${libkdepim_progresswidget_HEADERS}
    ${libkdepim_misc_HEADERS}
    ${libkdepim_widgets_HEADERS}
    ${libkdepim_multiline_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libkdepim
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
153
    )
154 155 156 157 158

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

159 160 161
if(BUILD_DESIGNERPLUGIN)
    add_subdirectory(designer)
endif()
162 163 164
########### 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
165 166 167 168

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

configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
169 170 171 172
    "${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
173 174

install(FILES
Laurent Montel's avatar
Laurent Montel committed
175 176 177 178 179
    "${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
180 181 182 183

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

install(FILES
Laurent Montel's avatar
Laurent Montel committed
184 185 186
    ${CMAKE_CURRENT_BINARY_DIR}/libkdepim_version.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
    )