CMakeLists.txt 3.5 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
2
set(PIM_VERSION "5.13.40")
3

4
project(calendarsupport VERSION ${PIM_VERSION})
5

6
set(KF5_MIN_VERSION "5.65.0")
7

8
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
9

10
11
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
12
13
14
15
16

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

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

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

Laurent Montel's avatar
Laurent Montel committed
27

Laurent Montel's avatar
Laurent Montel committed
28
set(CALENDARSUPPORT_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
29
30
set(AKONADI_MIMELIB_VERSION "5.13.40")
set(KDEPIM_LIB_VERSION "5.13.40")
31
set(QT_REQUIRED_VERSION "5.12.0")
Laurent Montel's avatar
Laurent Montel committed
32
33
34
35
36
37
set(KMIME_LIB_VERSION "5.13.40")
set(CALENDARUTILS_LIB_VERSION "5.13.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.13.40")
set(AKONADICALENDAR_LIB_VERSION "5.13.40")
set(PIMCOMMON_LIB_VERSION "5.13.40")
set(AKONADI_VERSION "5.13.40")
Laurent Montel's avatar
Laurent Montel committed
38
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
39
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools PrintSupport)
40
41
42
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5GuiAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
43
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
44
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
45
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
46
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
47
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
48
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
49
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
50
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
51
find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
52
53
find_package(KF5KdepimDBusInterfaces ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)

54
ecm_setup_version(PROJECT VARIABLE_PREFIX CALENDARSUPPORT
55
56
57
58
59
60
61
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfigVersion.cmake"
                        SOVERSION 5
)

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

62

63
64
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
65
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
66
67
endif()

68
69
70
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5CalendarSupport")

Laurent Montel's avatar
Laurent Montel committed
71
configure_package_config_file(
72
73
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5CalendarSupportConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfig.cmake"
74
  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
75
76
77
78
79
80
81
82
83
84
85
)

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

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

86
87
install(
  FILES ${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_version.h
88
89
90
  DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)

Laurent Montel's avatar
Laurent Montel committed
91
add_definitions(-DQT_NO_FOREACH)
92

93
94
95

add_subdirectory(src)

96
install(FILES calendarsupport.categories calendarsupport.renamecategories DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
97

98
99

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)