CMakeLists.txt 6.33 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
3
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
4 5 6

# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
7
  set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
8 9
endif()

10
set(PIM_VERSION "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
11
set(RELEASE_SERVICE_VERSION "20.07.40")
12

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

15
project(korganizer VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
16

17 18
if(POLICY CMP0063)
  cmake_policy(SET CMP0063 NEW)
Laurent Montel's avatar
Laurent Montel committed
19
endif()
20
set(KF5_MIN_VERSION "5.68.0")
Laurent Montel's avatar
Laurent Montel committed
21

22
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
23

Laurent Montel's avatar
Laurent Montel committed
24
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
25

Laurent Montel's avatar
Laurent Montel committed
26 27 28
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMAddTests)
29

Laurent Montel's avatar
Laurent Montel committed
30 31
include(GenerateExportHeader)
include(ECMGenerateHeaders)
32

Laurent Montel's avatar
Laurent Montel committed
33 34 35 36 37 38
include(FeatureSummary)
include(CheckFunctionExists)
include(ECMGeneratePriFile)

include(KDEInstallDirs)
include(KDECMakeSettings)
39
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
40 41
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
42

Laurent Montel's avatar
Laurent Montel committed
43

Laurent Montel's avatar
Laurent Montel committed
44 45 46 47 48 49
set(AKONADI_MIMELIB_VERSION "5.14.40")
set(AKONADI_CONTACT_VERSION "5.14.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.14.40")
set(KLDAP_LIB_VERSION "5.14.40")
set(KMAILTRANSPORT_LIB_VERSION "5.14.40")
set(CALENDARUTILS_LIB_VERSION "5.14.40")
50
set(AKONADICALENDAR_LIB_VERSION "5.14.41")
Laurent Montel's avatar
Laurent Montel committed
51
set(KONTACTINTERFACE_LIB_VERSION "5.14.41")
Laurent Montel's avatar
Laurent Montel committed
52 53 54
set(KMIME_LIB_VERSION "5.14.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.40")
set(AKONADI_VERSION "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
55

56
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
57
set(KDEPIM_LIB_SOVERSION "5")
Laurent Montel's avatar
Laurent Montel committed
58
set(AKONADINOTES_LIB_VERSION "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
59

60
set(QT_REQUIRED_VERSION "5.12.0")
Laurent Montel's avatar
Laurent Montel committed
61
option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)
62
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Gui Widgets Test UiTools)
63

64
find_package(KUserFeedback 0.9.90 CONFIG) # Needs Provider::describeDataSources()
Laurent Montel's avatar
Laurent Montel committed
65
set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional). It can be disable in apps.")
66 67 68 69 70

if (TARGET KUserFeedbackWidgets)
    add_definitions(-DWITH_KUSERFEEDBACK)
endif()

Laurent Montel's avatar
Laurent Montel committed
71 72 73 74
set(KDEPIM_APPS_LIB_VERSION_LIB "5.14.40")
set(PIMCOMMON_LIB_VERSION_LIB "5.14.40")
set(LIBKDEPIM_LIB_VERSION_LIB "5.14.40")
set(LIBINCIDENCEEDITOR_LIB_VERSION_LIB "5.14.40")
75
set(CALENDARSUPPORT_LIB_VERSION_LIB "5.14.41")
Laurent Montel's avatar
Laurent Montel committed
76
set(EVENTVIEW_LIB_VERSION_LIB "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
77

Laurent Montel's avatar
Laurent Montel committed
78
find_package(KF5AkonadiSearch "5.14.40" CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
79
set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")
Laurent Montel's avatar
Laurent Montel committed
80 81

# Find KF5 package
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG 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(KF5IconThemes ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5ItemViews ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5JobWidgets ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5NewStuff ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Parts ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WindowSystem ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
102 103 104 105

# Find KdepimLibs Package
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
106 107
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
108 109
find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
110
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
111 112 113 114 115 116 117 118 119 120 121
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
find_package(Phonon4Qt5 CONFIG REQUIRED)

find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)

find_package(KF5KdepimDBusInterfaces ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
122
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
123
find_package(KF5LibkdepimAkonadi ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
124 125 126
find_package(KF5IncidenceEditor ${LIBINCIDENCEEDITOR_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5CalendarSupport ${CALENDARSUPPORT_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5EventViews ${EVENTVIEW_LIB_VERSION_LIB} CONFIG REQUIRED)
127 128
if(NOT APPLE)
  find_package(X11)
Laurent Montel's avatar
Laurent Montel committed
129 130 131
endif()

set(KDEPIM_HAVE_X11 ${X11_FOUND})
132 133
configure_file(config-korganizer.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-korganizer.h)
configure_file(korgac/config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h)
Laurent Montel's avatar
Laurent Montel committed
134
include_directories(${korganizer_SOURCE_DIR} ${korganizer_BINARY_DIR} ${korgac_SOURCE_DIR} ${korgac_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
135
configure_file(korganizer-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/korganizer-version.h @ONLY)
Laurent Montel's avatar
Laurent Montel committed
136

137

138
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
139
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
140
endif()
141
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400)
142
set(CMAKE_CXX_STANDARD 14)
Laurent Montel's avatar
Laurent Montel committed
143
#add_definitions(-DQT_NO_FOREACH)
Laurent Montel's avatar
Laurent Montel committed
144
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
145
add_subdirectory(korgac)
Laurent Montel's avatar
Laurent Montel committed
146

147
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
148 149 150 151
        EXPORT KORGANIZER
        FILE korganizer.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
152

Laurent Montel's avatar
Laurent Montel committed
153 154
add_subdirectory(doc)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)