CMakeLists.txt 3.48 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MailImporterAkonadi")
3
4
add_library(KF5MailImporterAkonadi)
add_library(KF5::MailImporterAkonadi ALIAS KF5MailImporterAkonadi)
Laurent Montel's avatar
Laurent Montel committed
5
configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
6
7
8
9
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5MailImporterAkonadiConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterAkonadiConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
    )
Laurent Montel's avatar
Laurent Montel committed
10
11
12
13
14
15
16
17

ecm_setup_version(PROJECT VARIABLE_PREFIX MAILIMPORTER
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/mailimporterakonadi_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterAkonadiConfigVersion.cmake"
    SOVERSION 5
    )

install(FILES
Laurent Montel's avatar
Laurent Montel committed
18
19
20
21
22
    "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterAkonadiConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterAkonadiConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
    )
Laurent Montel's avatar
Laurent Montel committed
23
24
25
26

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

install(FILES
Laurent Montel's avatar
Laurent Montel committed
27
28
29
    ${CMAKE_CURRENT_BINARY_DIR}/mailimporterakonadi_version.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
    )
Laurent Montel's avatar
Laurent Montel committed
30

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
31
target_sources(KF5MailImporterAkonadi PRIVATE
Laurent Montel's avatar
Laurent Montel committed
32
33
34
    filterimporterakonadi.cpp
    )

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
35
ecm_qt_declare_logging_category(KF5MailImporterAkonadi HEADER mailimporterakonadi_debug.h IDENTIFIER MAILIMPORTERAKONADI_LOG CATEGORY_NAME org.kde.pim.mailimporterakonadi
Laurent Montel's avatar
Laurent Montel committed
36
37
38
39
40
        DESCRIPTION "mailimporterakonadi (mailimporter)"
        EXPORT MAILIMPORTER
    )


Laurent Montel's avatar
Laurent Montel committed
41

42
43
44
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
    set_target_properties(KF5MailImporterAkonadi PROPERTIES UNITY_BUILD ON)
endif()
Laurent Montel's avatar
Laurent Montel committed
45
46
47
48
49
50
51
52
53
54
55
56
57

generate_export_header( KF5MailImporterAkonadi BASE_NAME mailimporterakonadi)

add_library(KF5::MailImporterAkonadi ALIAS KF5MailImporterAkonadi)

target_include_directories(KF5MailImporterAkonadi INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/MailImporterAkonadi/;${KDE_INSTALL_INCLUDEDIR_KF5}/mailimporterakonadi>")
target_include_directories(KF5MailImporterAkonadi PUBLIC "$<BUILD_INTERFACE:${MailImporter_SOURCE_DIR}/src;${MailImporter_BINARY_DIR}/src;>")


target_link_libraries(KF5MailImporterAkonadi
    PUBLIC
    KF5::MailImporter
    KF5::AkonadiCore
Laurent Montel's avatar
Laurent Montel committed
58
    PRIVATE
59
    KF5::Mime
Laurent Montel's avatar
Laurent Montel committed
60
61
62
63
64
    KF5::AkonadiMime
    KF5::I18n
    )

set_target_properties(KF5MailImporterAkonadi PROPERTIES
65
    VERSION ${MAILIMPORTER_VERSION}
Laurent Montel's avatar
Laurent Montel committed
66
67
68
69
70
71
    SOVERSION ${MAILIMPORTER_SOVERSION}
    EXPORT_NAME MailImporterAkonadi
    )

install(TARGETS
    KF5MailImporterAkonadi
72
    EXPORT KF5MailImporterAkonadiTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
Laurent Montel's avatar
Laurent Montel committed
73
74
75
76
77
78
79
80
81
82
83
84
85
    )


ecm_generate_headers(MailImporter_AkonadiCamelCase_HEADERS
    HEADER_NAMES
    FilterImporterAkonadi
    REQUIRED_HEADERS MailImporter_Akonadi_HEADERS
    PREFIX MailImporterAkonadi
    )


ecm_generate_pri_file(BASE_NAME MailImporterAkonadi
    LIB_NAME KF5MailImporterAkonadi
Laurent Montel's avatar
Laurent Montel committed
86
    DEPS "MailImporter AkonadiCore" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/MailImporterAkonadi
Laurent Montel's avatar
Laurent Montel committed
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
    )


install(FILES
    ${MailImporter_AkonadiCamelCase_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/MailImporterAkonadi
    COMPONENT Devel
    )

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/mailimporterakonadi_export.h
    ${MailImporter_Akonadi_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/mailimporterakonadi
    COMPONENT Devel
    )
install(FILES
    ${PRI_FILENAME}
    DESTINATION ${ECM_MKSPECS_INSTALL_DIR})

106
107
108
109
if (BUILD_TESTING)
   add_subdirectory(autotests)
endif()