CMakeLists.txt 3.49 KB
Newer Older
1
cmake_minimum_required(VERSION 3.0)
2
set(PIM_VERSION "5.5.40")
3

4
project(calendarsupport VERSION ${PIM_VERSION})
5

Laurent Montel's avatar
Laurent Montel committed
6
set(KF5_VERSION "5.32.0")
Laurent Montel's avatar
Laurent Montel committed
7
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
8 9 10 11 12 13
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
Laurent Montel's avatar
Laurent Montel committed
14
include(CMakePackageConfigHelpers)
15 16 17 18
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
19
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
20 21
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
Laurent Montel's avatar
Laurent Montel committed
22 23
include(ECMCoverageOption)

24 25


Laurent Montel's avatar
Laurent Montel committed
26
set(CALENDARSUPPORT_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
27 28
set(AKONADI_MIMELIB_VERSION "5.4.90")
set(KDEPIM_LIB_VERSION "5.4.90")
Laurent Montel's avatar
Laurent Montel committed
29
set(QT_REQUIRED_VERSION "5.6.0")
Laurent Montel's avatar
Laurent Montel committed
30 31 32 33 34 35 36 37 38
set(KMIME_LIB_VERSION "5.4.90")
set(CALENDARUTILS_LIB_VERSION "5.4.90")
set(KCALENDARCORE_LIB_VERSION "5.4.90")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.4.90")
set(KHOLIDAYS_LIB_VERSION "5.4.90")
set(AKONADICALENDAR_LIB_VERSION "5.4.90")
set(PIMCOMMON_LIB_VERSION "5.4.90")
set(AKONADI_VERSION "5.4.90")
set(KIMAP_LIB_VERSION "5.4.90")
Laurent Montel's avatar
Laurent Montel committed
39
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
40 41 42
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools)
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
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 45 46 47 48 49
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${KHOLIDAYS_LIB_VERSION} CONFIG REQUIRED)
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)
Laurent Montel's avatar
Laurent Montel committed
52
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
53

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


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

add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
64
add_definitions( -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT )
65 66 67
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5CalendarSupport")

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

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::)

install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_version.h
  DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

add_subdirectory(src)

92
install( FILES calendarsupport.categories calendarsupport.renamecategories DESTINATION ${KDE_INSTALL_CONFDIR} )