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

4
project(calendarsupport VERSION ${PIM_VERSION})
5

6
set(KF5_MIN_VERSION "5.68.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
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
25

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

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
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
64
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
65
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400)
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

add_subdirectory(src)
95

96 97

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)