CMakeLists.txt 3.32 KB
Newer Older
1
cmake_minimum_required(VERSION 3.0)
2
set(PIM_VERSION "5.5.3")
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.32.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.5.2")
set(KCONTACTS_VERSION "5.5.2")
set(KMIMELIB_VERSION "5.5.2")
set(AKONADI_VERSION "5.5.2")
Laurent Montel's avatar
Laurent Montel committed
31

32
ecm_setup_version(PROJECT VARIABLE_PREFIX AKONADICONTACT
Laurent Montel's avatar
indent    
Laurent Montel committed
33
34
35
36
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfigVersion.cmake"
    SOVERSION 5
    )
Laurent Montel's avatar
Laurent Montel committed
37

38
set(QT_REQUIRED_VERSION "5.6.0")
Laurent Montel's avatar
Laurent Montel committed
39
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test WebEngine WebEngineWidgets)
Laurent Montel's avatar
Laurent Montel committed
40
41
########### Find packages ###########
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
42
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
43
find_package(KF5Completion ${KF5_VERSION} CONFIG REQUIRED)
44
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
45
46
47
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
48
find_package(Grantlee5 "5.1" CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
49
50
51

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

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

Laurent Montel's avatar
Laurent Montel committed
66
67
########### Targets ###########

68
add_definitions(-DTRANSLATION_DOMAIN=\"akonadicontact5\")
69
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
Laurent Montel's avatar
Laurent Montel committed
70
add_subdirectory(src)
71
if (BUILD_TESTING)
Laurent Montel's avatar
indent    
Laurent Montel committed
72
73
    add_subdirectory(autotests)
    add_subdirectory(tests)
74
endif()
Laurent Montel's avatar
Laurent Montel committed
75
########### CMake Config Files ###########
76
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5AkonadiContact")
Laurent Montel's avatar
Laurent Montel committed
77

Laurent Montel's avatar
Laurent Montel committed
78
configure_package_config_file(
Laurent Montel's avatar
indent    
Laurent Montel committed
79
80
81
82
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5AkonadiContactConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
    )
Laurent Montel's avatar
Laurent Montel committed
83
84

install(FILES
Laurent Montel's avatar
indent    
Laurent Montel committed
85
86
87
88
89
    "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
    )
Laurent Montel's avatar
Laurent Montel committed
90
91
92
93

install(EXPORT KF5AkonadiContactTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5AkonadiContactTargets.cmake NAMESPACE KF5::)

install(FILES
Laurent Montel's avatar
indent    
Laurent Montel committed
94
95
96
    ${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_version.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
    )
Laurent Montel's avatar
Laurent Montel committed
97

98
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)