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

4
project(eventviews VERSION ${PIM_VERSION})
5
6

# ECM setup
7
set(KF5_MIN_VERSION "5.71.0")
8

9
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
10
11
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
12
13
if(POLICY CMP0053)
  cmake_policy(SET CMP0053 NEW)
Laurent Montel's avatar
Laurent Montel committed
14
endif()
15
16
17
18
19

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

20
21
22
23
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
24

25
26
27
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
28

Laurent Montel's avatar
Laurent Montel committed
29

Laurent Montel's avatar
Laurent Montel committed
30
set(EVENTVIEW_LIB_VERSION ${PIM_VERSION})
31
set(CALENDARUTILS_LIB_VERSION "5.14.40")
32
set(AKONADI_LIB_VERSION "5.14.43")
33
set(QT_REQUIRED_VERSION "5.13.0")
34
35
36
set(AKONADICALENDAR_LIB_VERSION "5.14.40")
set(KMIME_LIB_VERSION "5.14.40")
set(LIBKDEPIM_LIB_VERSION "5.14.40")
37
set(CALENDARSUPPORT_LIB_VERSION "5.14.42")
38

Laurent Montel's avatar
Laurent Montel committed
39
find_package(KF5Akonadi ${AKONADI_LIB_VERSION} CONFIG REQUIRED)
40
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets)
41
42
43
44
45
46
47
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5GuiAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
48
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
49

Laurent Montel's avatar
Laurent Montel committed
50
51
set(KDIAGRAM_LIB_VERSION "1.4.0")
find_package(KGantt ${KDIAGRAM_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
52

Laurent Montel's avatar
Laurent Montel committed
53
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
54
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
55
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
56
find_package(KF5CalendarSupport ${CALENDARSUPPORT_LIB_VERSION} CONFIG REQUIRED)
57
58
59
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)

60
ecm_setup_version(PROJECT VARIABLE_PREFIX EVENTVIEWS
61
62
63
64
65
66
67
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/eventviews_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5EventViewsConfigVersion.cmake"
                        SOVERSION 5
)

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

68

69
70
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054700)
71

Laurent Montel's avatar
Laurent Montel committed
72
add_definitions(-DQT_NO_FOREACH)
73
add_definitions(-DQT_NO_KEYWORDS)
74
75
76
77

########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5EventViews")

Laurent Montel's avatar
Laurent Montel committed
78
configure_package_config_file(
79
80
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5EventViewsConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5EventViewsConfig.cmake"
81
  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
82
83
84
85
86
87
88
89
90
91
92
93
)

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

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

install(FILES
94
  ${CMAKE_CURRENT_BINARY_DIR}/eventviews_version.h
95
96
97
98
  DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)

add_subdirectory(src)
99
100
101
if(BUILD_TESTING)
  find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Test)
  add_subdirectory(tests)
102
endif()
103

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