CMakeLists.txt 2.17 KB
Newer Older
1
cmake_minimum_required(VERSION 3.0)
2
set(PIM_VERSION "5.6.40")
Laurent Montel's avatar
Laurent Montel committed
3

4
project(Akonadi-Contact VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
5 6

# ECM setup
Laurent Montel's avatar
Laurent Montel committed
7

Laurent Montel's avatar
Laurent Montel committed
8
set(KF5_VERSION "5.38.0")
Laurent Montel's avatar
Laurent Montel committed
9

Laurent Montel's avatar
Laurent Montel committed
10
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
11 12 13 14 15
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
Laurent Montel's avatar
Laurent Montel committed
16
include(CMakePackageConfigHelpers)
Laurent Montel's avatar
Laurent Montel committed
17 18 19 20
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
21
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
22
include(ECMInstallIcons)
Laurent Montel's avatar
Laurent Montel committed
23
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
24 25
include(ECMCoverageOption)

Laurent Montel's avatar
Laurent Montel committed
26

Laurent Montel's avatar
Laurent Montel committed
27
set(AKONADI_CONTACTS_VERSION ${PIM_VERSION})
28 29 30 31
set(AKONADI_MIME_VERSION "5.6.40")
set(KCONTACTS_VERSION "5.6.40")
set(KMIMELIB_VERSION "5.6.40")
set(AKONADI_VERSION "5.6.40")
Laurent Montel's avatar
Laurent Montel committed
32

33
set(QT_REQUIRED_VERSION "5.8.0")
Laurent Montel's avatar
Laurent Montel committed
34
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test WebEngine WebEngineWidgets)
Laurent Montel's avatar
Laurent Montel committed
35 36
########### Find packages ###########
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
37
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
38
find_package(KF5Completion ${KF5_VERSION} CONFIG REQUIRED)
39
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
40 41 42
find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
43
find_package(Grantlee5 "5.1" CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
44 45 46

find_package(KF5Contacts ${KCONTACTS_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIMELIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
47
find_package(KF5AkonadiMime ${AKONADI_MIME_VERSION} CONFIG REQUIRED)
Daniel Vrátil's avatar
Daniel Vrátil committed
48
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
49

Laurent Montel's avatar
Laurent Montel committed
50
set(Prison_MIN_VERSION "${KF5_VERSION}")
51 52
find_package(KF5Prison ${Prison_MIN_VERSION} CONFIG REQUIRED)
add_definitions(-DHAVE_PRISON)
53

Laurent Montel's avatar
Laurent Montel committed
54 55
########### Targets ###########

56
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
57 58
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
59
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
Laurent Montel's avatar
Laurent Montel committed
60 61 62 63 64 65

if(BUILD_TESTING)
   add_definitions(-DBUILD_TESTING)
endif(BUILD_TESTING)


Laurent Montel's avatar
Laurent Montel committed
66
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
67
add_subdirectory(kcm)
Laurent Montel's avatar
Laurent Montel committed
68

69
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)