CMakeLists.txt 4.18 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
2
3
set(PIM_VERSION "5.14.40")
project(pim-data-exporter VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4
set(RELEASE_SERVICE_VERSION "20.07.40")
5
set(KF5_MIN_VERSION "5.70.0")
Laurent Montel's avatar
Laurent Montel committed
6

7
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
8
9
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(ECMInstallIcons)

11

Laurent Montel's avatar
Laurent Montel committed
12
13
include(ECMSetupVersion)
include(ECMAddTests)
14

Laurent Montel's avatar
Laurent Montel committed
15
16
include(GenerateExportHeader)
include(ECMGenerateHeaders)
17

Laurent Montel's avatar
Laurent Montel committed
18
19
20
21
22
23
include(FeatureSummary)
include(CheckFunctionExists)
include(ECMGeneratePriFile)

include(KDEInstallDirs)
include(KDECMakeSettings)
Laurent Montel's avatar
Laurent Montel committed
24
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
25
26
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
27

Laurent Montel's avatar
Laurent Montel committed
28
# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
29
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
30
31
32
33

# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
    set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
34
35
endif()

36
set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})")
Laurent Montel's avatar
Laurent Montel committed
37

38
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
39
40
set(KDEPIM_LIB_SOVERSION "5")

41
set(QT_REQUIRED_VERSION "5.12.0")
42
43
44
if(BUILD_TESTING)
    find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test)
endif()
45

Laurent Montel's avatar
Laurent Montel committed
46
47
48
49
50
51
52
53
54
set(AKONADI_VERSION "5.14.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.14.40")
set(KMAILTRANSPORT_LIB_VERSION "5.14.40")
set(KMIME_LIB_VERSION "5.14.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.40")
set(LIBKDEPIM_LIB_VERSION_LIB "5.14.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.14.40")
set(PIMCOMMON_LIB_VERSION_LIB "5.14.40")
set(AKONADINOTES_LIB_VERSION "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
55
56

# Find KF5 package
57
58
59
60
61
62
63
64
65
66
67
68
find_package(KF5Archive ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5CoreAddons ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5ItemViews ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Notifications ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
69
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
70
71
72

# Find KdepimLibs Package
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
73
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
74
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
75
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
76
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
77
find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
78
79
80
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
81
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
82
find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
83

84
find_package(KUserFeedback 0.9.90 CONFIG) # Needs Provider::describeDataSources()
Laurent Montel's avatar
Laurent Montel committed
85
86
87
set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional). It can be disable in apps.")


Laurent Montel's avatar
Laurent Montel committed
88
89
include_directories(${pim-data-exporter_SOURCE_DIR} ${pim-data-exporter_BINARY_DIR})

Laurent Montel's avatar
Laurent Montel committed
90
add_definitions(-DTRANSLATION_DOMAIN=\"pimdataexporter\")
91

92
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
93
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
94
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054600)
95
96
endif()

97

Laurent Montel's avatar
Laurent Montel committed
98
configure_file(pimdataexporter-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/pimdataexporter-version.h @ONLY)
Laurent Montel's avatar
Laurent Montel committed
99
add_definitions(-DQT_NO_FOREACH)
100
add_definitions(-DQT_NO_KEYWORDS)
101

Laurent Montel's avatar
Laurent Montel committed
102
103
104
105
if(BUILD_TESTING)
   add_definitions(-DBUILD_TESTING)
endif(BUILD_TESTING)

Laurent Montel's avatar
Laurent Montel committed
106
add_subdirectory(core)
107
add_subdirectory(gui)
Laurent Montel's avatar
Laurent Montel committed
108
add_subdirectory(console)
Laurent Montel's avatar
Laurent Montel committed
109

110
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
111
112
113
114
115
116
        EXPORT PIMDATAEXPORTER
        FILE pimdataexporter.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )


Laurent Montel's avatar
Laurent Montel committed
117
install(FILES org.kde.pimdataexporter.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
Laurent Montel's avatar
Laurent Montel committed
118
119


Laurent Montel's avatar
Laurent Montel committed
120
121
add_subdirectory(doc)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)