CMakeLists.txt 3.03 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
3
4
5
cmake_minimum_required(VERSION 2.8.12)

project(Akonadi-Contact)

# ECM setup
Laurent Montel's avatar
Laurent Montel committed
6
set(KF5_VERSION "5.22.0")
Laurent Montel's avatar
Laurent Montel committed
7
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
8
9
10
11
12
13
14
15
16
17
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
18
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
19
include(ECMInstallIcons)
Laurent Montel's avatar
Laurent Montel committed
20
21
include(ECMQtDeclareLoggingCategory)

Laurent Montel's avatar
Laurent Montel committed
22
23
24
25
26
set(KDEPIMLIBS_VERSION "5.2.40")
set(KCONTACTS_VERSION "5.2.40")
set(CALENDARCORE_VERSION "5.2.40")
set(KMIMELIB_VERSION "5.2.40")
set(AKONADI_VERSION "5.2.40")
Laurent Montel's avatar
Laurent Montel committed
27

Laurent Montel's avatar
Laurent Montel committed
28
ecm_setup_version(${KDEPIMLIBS_VERSION} VARIABLE_PREFIX AKONADICONTACT
Laurent Montel's avatar
Laurent Montel committed
29
30
31
32
33
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfigVersion.cmake"
                        SOVERSION 5
)

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

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

48
49
50
51
52
53
54
set(Prison_MIN_VERSION "1.2.2")
find_package(KF5Prison ${Prison_MIN_VERSION})
set_package_properties(Prison PROPERTIES DESCRIPTION "Prison" URL "http://projects.kde.org/prison" TYPE OPTIONAL$
if (KF5Prison_FOUND)
    add_definitions(-DHAVE_PRISON)
endif()

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

57
add_definitions(-DTRANSLATION_DOMAIN=\"akonadicontact5\")
58
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
Laurent Montel's avatar
Laurent Montel committed
59
add_subdirectory(src)
60
61
62
63
if (BUILD_TESTING)
  add_subdirectory(autotests)
  add_subdirectory(tests)
endif()
Laurent Montel's avatar
Laurent Montel committed
64
########### CMake Config Files ###########
65
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5AkonadiContact")
Laurent Montel's avatar
Laurent Montel committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

ecm_configure_package_config_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5AkonadiContactConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfig.cmake"
  INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES
  "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfig.cmake"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfigVersion.cmake"
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

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

install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_version.h
84
  DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
85
86
)

87
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)