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

4
project(incidenceeditor VERSION ${PIM_VERSION})
5

Laurent Montel's avatar
Laurent Montel committed
6
set(KF5_MIN_VERSION "5.56.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
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
18

19
20
21
22
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
23
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
24
25
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
26

Laurent Montel's avatar
Laurent Montel committed
27

28
29


Laurent Montel's avatar
Laurent Montel committed
30
set(INCIDENCEEDITOR_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
31
32
set(AKONADI_MIMELIB_VERSION "5.11.0")
set(KDEPIM_LIB_VERSION "5.11.0")
33
set(QT_REQUIRED_VERSION "5.10.0")
Laurent Montel's avatar
Laurent Montel committed
34
35
36
37
38
39
40
41
42
set(KMIME_LIB_VERSION "5.11.0")
set(KMAILTRANSPORT_LIB_VERSION "5.11.0")
set(KLDAP_LIB_VERSION "5.11.0")
set(CALENDARUTILS_LIB_VERSION "5.11.0")
set(KCALENDARCORE_LIB_VERSION "5.11.0")
set(CALENDARSUPPORT_LIB_VERSION "5.11.0")
set(LIBKDEPIM_LIB_VERSION "5.11.0")
set(EVENTVIEW_LIB_VERSION "5.11.0")
set(AKONADI_VERSION "5.11.0")
43

Laurent Montel's avatar
Laurent Montel committed
44

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

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

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

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

80

Laurent Montel's avatar
Laurent Montel committed
81
82
83
84
85
86
# workaround for https://bugreports.qt.io/browse/QTBUG-74665 (bug in qt5.13 reevaluate it)
if (${Qt5Widgets_VERSION} STRGREATER "5.13")
   MESSAGE(STATUS "Qt version: ${Qt5Widgets_VERSION} DISABLE compile without deprecated methods. bug QTBUG-74665")
else()
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
87
########### CMake Config Files ###########
88
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IncidenceEditor")
89

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

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

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

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

Laurent Montel's avatar
Laurent Montel committed
110
install( FILES incidenceeditor.categories incidenceeditor.renamecategories DESTINATION ${KDE_INSTALL_CONFDIR} )
Laurent Montel's avatar
Laurent Montel committed
111
112
113
114
if (${KF5Config_VERSION} STRGREATER "5.56.0")
        add_definitions(-DQT_NO_FOREACH)
        MESSAGE(STATUS "compile without foreach")
endif()
115

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)