CMakeLists.txt 3.21 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
2
set(PIM_VERSION "5.13.43")
3

4
project(pimcommon VERSION ${PIM_VERSION})
5

6
set(KF5_MIN_VERSION "5.67.0")
Laurent Montel's avatar
Laurent Montel committed
7

8
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
9
10
11
set(LIBRARY_NAMELINK)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})

12
13
14
15
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

16
17
18
19
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
20

21
22
23
24
25
include(ECMSetupVersion)
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
include(ECMInstallIcons)
26

Laurent Montel's avatar
Laurent Montel committed
27

28

Laurent Montel's avatar
Laurent Montel committed
29
30

set(PIMCOMMON_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
31
32
set(AKONADICONTACT_LIB_VERSION "5.13.40")
set(LIBKDEPIM_LIB_VERSION "5.13.40")
33
set(QT_REQUIRED_VERSION "5.12.0")
Laurent Montel's avatar
Laurent Montel committed
34
35
36
37
set(KMIME_LIB_VERSION "5.13.40")
set(KIMAP_LIB_VERSION "5.13.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.13.40")
set(AKONADI_VERSION "5.13.40")
38

39
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets DBus Network Test Xml PrintSupport)
40

41
42
43
44
45
46
47
48
49
50
51
52
53
54
find_package(KF5Archive ${KF5_MIN_VERSION} CONFIG REQUIRED)
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(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ItemModels ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5JobWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5NewStuff ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
55

Laurent Montel's avatar
Laurent Montel committed
56
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
57
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
58
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
59
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
60
find_package(KF5LibkdepimAkonadi ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
61
62
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)

Laurent Montel's avatar
Laurent Montel committed
63
find_package(KF5Purpose ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
64

65

66
67
option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON)
add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer")
68
69
70
71

find_package(Xsltproc)
set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")

72
if(BUILD_TESTING)
73
   find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
74
75
   add_definitions(-DBUILD_TESTING)
endif(BUILD_TESTING)
76

77
78
########### Targets ###########

79
80
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
81
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000) 
82
83
endif()

Laurent Montel's avatar
Laurent Montel committed
84
add_definitions(-DQT_NO_FOREACH)
85

86
add_subdirectory(src)
87
install(FILES pimcommon.renamecategories pimcommon.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
88
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)