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

4
project(incidenceeditor VERSION ${PIM_VERSION})
5

6
set(KF5_MIN_VERSION "5.67.0")
7

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

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

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

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

Laurent Montel's avatar
Laurent Montel committed
29

30 31


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

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

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

find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
58
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
59 60
find_package(KF5CalendarSupport ${CALENDARSUPPORT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5EventViews ${EVENTVIEW_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
61
find_package(KF5LibkdepimAkonadi ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
62 63
find_package(KF5KdepimDBusInterfaces ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
64
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
65
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
66
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
67

68
ecm_setup_version(PROJECT VARIABLE_PREFIX INCIDENCEEDITOR
69 70
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/incidenceeditor_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5IncidenceEditorConfigVersion.cmake"
71 72 73 74 75 76 77 78 79 80 81
                        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 ###########

82

83 84
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
85
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
86 87
endif()

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

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

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

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

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

Laurent Montel's avatar
Laurent Montel committed
111 112 113
if (ECM_VERSION VERSION_LESS "5.68.0")
    install(FILES incidenceeditor.categories incidenceeditor.renamecategories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
endif()
Laurent Montel's avatar
Laurent Montel committed
114
add_definitions(-DQT_NO_FOREACH)
115
set(CMAKE_CXX_STANDARD 14)
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)