CMakeLists.txt 5.16 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
set(PIM_VERSION "5.18.40")
2
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
3
project(knotes VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4
set(RELEASE_SERVICE_VERSION "21.11.40")
5

Laurent Montel's avatar
Laurent Montel committed
6

7
set(KF5_MIN_VERSION "5.85.0")
8

9
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
10
11
12
set(CMAKE_MODULE_PATH ${knotes_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
include(ECMInstallIcons)

13

Laurent Montel's avatar
Laurent Montel committed
14
15
include(ECMSetupVersion)
include(ECMAddTests)
16

Laurent Montel's avatar
Laurent Montel committed
17
18
include(GenerateExportHeader)
include(ECMGenerateHeaders)
19

Laurent Montel's avatar
Laurent Montel committed
20
include(FeatureSummary)
21
include(KDEGitCommitHooks)
Laurent Montel's avatar
Laurent Montel committed
22
23
24
25
26
include(CheckFunctionExists)
include(ECMGeneratePriFile)

include(KDEInstallDirs)
include(KDECMakeSettings)
27
include(KDECompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
28
29
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
30

31

Laurent Montel's avatar
Laurent Montel committed
32
# Do NOT add quote
33
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
34
35
36
37
38
39
40

# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
    set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
endif()


41

42
43
set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})")
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
44
45
46
set(KDEPIM_LIB_SOVERSION "5")


47
48
49
50
51
52
53
54
55
56
set(AKONADINOTES_LIB_VERSION "5.18.40")
set(AKONADI_VERSION "5.18.40")
set(CALENDARUTILS_LIB_VERSION "5.18.40")
set(KONTACTINTERFACE_LIB_VERSION "5.18.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.18.40")
set(LIBKDEPIM_LIB_VERSION "5.18.40")
set(KMIME_LIB_VERSION "5.18.40")
set(PIMCOMMON_LIB_VERSION "5.18.40")
set(GRANTLEETHEME_LIB_VERSION "5.18.40")
set(AKONADI_SEARCH_VERSION "5.18.40")
Laurent Montel's avatar
Laurent Montel committed
57

58
set(QT_REQUIRED_VERSION "5.15.0")
Laurent Montel's avatar
Laurent Montel committed
59
60
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network PrintSupport Test Widgets Xml)
find_package(Qt5X11Extras NO_MODULE)
Laurent Montel's avatar
Laurent Montel committed
61
find_package(Grantlee5 "5.2" CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
62
# Find KF5 package
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
find_package(KF5Completion ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5CoreAddons ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5DNSSD ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5GlobalAccel ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ItemModels ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ItemViews ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5NewStuff ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5NotifyConfig ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Parts ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5TextWidgets ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5WindowSystem ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
82
83
84
85
86
find_package(KF5DocTools ${KF5_MIN_VERSION})
set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
    "Tools to generate documentation"
    TYPE OPTIONAL
)
Laurent Montel's avatar
Laurent Montel committed
87
88
89
90
91
92
93


# Find KdepimLibs Package
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
94
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
95
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
96
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
97
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
98
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
99
100


Laurent Montel's avatar
Laurent Montel committed
101
find_package(KF5AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
102
set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "ttps://invent.kde.org/pim/akonadi-search" TYPE REQUIRED PURPOSE "Provides search capabilities in pim apps and Akonadi")
Laurent Montel's avatar
Laurent Montel committed
103
104
105

if (NOT APPLE)
    find_package(X11)
Laurent Montel's avatar
Laurent Montel committed
106
endif()
Laurent Montel's avatar
Laurent Montel committed
107
108
109

set(KDEPIM_HAVE_X11 ${X11_FOUND})

Laurent Montel's avatar
Laurent Montel committed
110
111
112
set(CMAKE_MODULE_PATH ${knotes_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
find_package(Xsltproc)
set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")
Laurent Montel's avatar
Laurent Montel committed
113

114
include_directories(${knotes_SOURCE_DIR} ${knotes_BINARY_DIR})
115

116
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
117
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055600)
118

119
configure_file(knotes-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/knotes-version.h @ONLY)
120
121
122
if(BUILD_TESTING)
   add_definitions(-DBUILD_TESTING)
endif()
123
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
124

125
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
126
if (USE_UNITY_CMAKE_SUPPORT)
127
    set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
128
endif()
129

130
131
132
add_subdirectory(noteshared)
add_subdirectory(src)
add_subdirectory(notesagent)
133

134
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
135
136
137
138
        EXPORT KNOTES
        FILE knotes.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
139

Laurent Montel's avatar
Laurent Montel committed
140
141
142
143
144
if(KF5DocTools_FOUND)
    kdoctools_install(po)
    add_subdirectory(doc)
endif()

145
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
146
ki18n_install(po)
Laurent Montel's avatar
Laurent Montel committed
147
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)