CMakeLists.txt 4.54 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.15.40")
3

4
project(incidenceeditor VERSION ${PIM_VERSION})
5

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

8
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
9
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
10
11
12
if (POLICY CMP0053)
    cmake_policy(SET CMP0053 NEW)
endif()
13
14
15
16
17

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

18
19
20
21
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
22

23
24
25
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
26

Laurent Montel's avatar
Laurent Montel committed
27

28
29


Laurent Montel's avatar
Laurent Montel committed
30
set(INCIDENCEEDITOR_LIB_VERSION ${PIM_VERSION})
31
32
set(AKONADI_MIMELIB_VERSION "5.15.40")
set(KDEPIM_LIB_VERSION "5.15.40")
33
set(QT_REQUIRED_VERSION "5.13.0")
34
35
36
37
38
39
40
41
42
43
set(KMIME_LIB_VERSION "5.15.40")
set(KMAILTRANSPORT_LIB_VERSION "5.15.40")
set(KLDAP_LIB_VERSION "5.15.40")
set(CALENDARUTILS_LIB_VERSION "5.15.40")
set(CALENDARSUPPORT_LIB_VERSION "5.15.40")
set(LIBKDEPIM_LIB_VERSION "5.15.40")
set(EVENTVIEW_LIB_VERSION "5.15.40")
set(AKONADI_VERSION "5.15.40")
set(AKONADICONTACT_LIB_VERSION "5.15.40")
set(AKONADICALENDAR_LIB_VERSION "5.15.40")
Laurent Montel's avatar
Laurent Montel committed
44
set(PIMCOMMON_LIB_VERSION "5.15.40")
45
set(GRANTLEETHEME_LIB_VERSION "5.15.40")
Laurent Montel's avatar
Laurent Montel committed
46

Laurent Montel's avatar
Laurent Montel committed
47
48
set(KDIAGRAM_LIB_VERSION "1.4.0")
find_package(KGantt ${KDIAGRAM_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
49

Laurent Montel's avatar
Laurent Montel committed
50
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
51
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets)
52
53
54
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
55
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
56
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
57
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
58
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
59
60

find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
61
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
62
63
find_package(KF5CalendarSupport ${CALENDARSUPPORT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5EventViews ${EVENTVIEW_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
64
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
65
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
66
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
67
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
68
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
69
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
70

71
ecm_setup_version(PROJECT VARIABLE_PREFIX INCIDENCEEDITOR
72
73
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/incidenceeditor_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5IncidenceEditorConfigVersion.cmake"
74
75
76
77
78
79
80
81
82
83
84
                        SOVERSION 5
)

option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)


# config-enterprise.h is needed for both ENTERPRISE_BUILD and BUILD_EVERYTHING
configure_file(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config-enterprise.h )

########### Targets ###########

85

86
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
87
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054A00)
88

89
########### CMake Config Files ###########
90
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IncidenceEditor")
91

Laurent Montel's avatar
Laurent Montel committed
92
configure_package_config_file(
93
94
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5IncidenceEditorConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IncidenceEditorConfig.cmake"
95
96
97
98
  INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES
99
100
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IncidenceEditorConfig.cmake"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IncidenceEditorConfigVersion.cmake"
101
102
103
104
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

105
install(EXPORT KF5IncidenceEditorTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5IncidenceEditorTargets.cmake NAMESPACE KF5::)
106
107

install(FILES
108
   ${CMAKE_CURRENT_BINARY_DIR}/incidenceeditor_version.h
109
110
111
  DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)

Laurent Montel's avatar
Laurent Montel committed
112
add_definitions(-DQT_NO_FOREACH)
113
add_definitions(-DQT_NO_KEYWORDS)
114
set(CMAKE_CXX_STANDARD 14)
115
set(CMAKE_CXX_STANDARD_REQUIRED ON)
116
117
add_subdirectory(src)
if (BUILD_TESTING)
118
119
   find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Test)

120
121
122
123
   add_subdirectory(autotests)
   add_subdirectory(tests)
endif()

Laurent Montel's avatar
Laurent Montel committed
124
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)