CMakeLists.txt 2.37 KB
Newer Older
1
cmake_minimum_required(VERSION 3.0)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.6.1")
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

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

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

Laurent Montel's avatar
Laurent Montel committed
25

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

32
set(QT_REQUIRED_VERSION "5.7.0")
Laurent Montel's avatar
Laurent Montel committed
33
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test WebEngine WebEngineWidgets)
Laurent Montel's avatar
Laurent Montel committed
34
35
########### Find packages ###########
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
36
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
37
find_package(KF5Completion ${KF5_VERSION} CONFIG REQUIRED)
38
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
39
40
41
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
42
find_package(Grantlee5 "5.1" CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
43
44
45

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

Laurent Montel's avatar
Laurent Montel committed
49
set(Prison_MIN_VERSION "${KF5_VERSION}")
50
find_package(KF5Prison ${Prison_MIN_VERSION})
Daniel Vrátil's avatar
Daniel Vrátil committed
51
set_package_properties(Prison PROPERTIES
Laurent Montel's avatar
indent    
Laurent Montel committed
52
53
54
55
    DESCRIPTION "Prison"
    URL "http://projects.kde.org/prison"
    TYPE OPTIONAL
    PURPOSE "Needed to show mobile barcodes of your contacts")
56
57
58
59
if (KF5Prison_FOUND)
    add_definitions(-DHAVE_PRISON)
endif()

Laurent Montel's avatar
Laurent Montel committed
60
61
########### Targets ###########

62
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
63
64
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
65
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
Laurent Montel's avatar
Laurent Montel committed
66
67
68
69
70
71

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


Laurent Montel's avatar
Laurent Montel committed
72
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
73
add_subdirectory(kcm)
Laurent Montel's avatar
Laurent Montel committed
74

75
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)