-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
180 lines (149 loc) · 4.27 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# SPDX-FileCopyrightText: (C) 2008 Kelvie Wong <[email protected]>
# SPDX-FileCopyrightText: (C) 2014 Gleb Baryshev <[email protected]>
# SPDX-FileCopyrightText: (C) 2018 Luigi Toscano <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-or-later
cmake_minimum_required(VERSION 3.5)
project(Basket VERSION 2.49.90)
set(QT_MIN_VERSION "6.5.0")
set(KF_MIN_VERSION "6.2.0")
# Options
option(BUILD_DEVTOOLS "Enabled Devtools" ON)
option(ENABLE_GPG "Enabled GPG Support" OFF)
option(ENABLE_GIT "Enabled Git Support" ON)
option(DEBUG_PIPE "Enabled Named Debugging Pipe" OFF)
# for local usage only
# set(CMAKE_BUILD_PARALLEL_LEVEL 12)
# do we use a GNU compiler?
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-delete-null-pointer-checks")
# TODO: after removing kdelibs4support this could also be removed
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
# ECM
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules)
include(KDEInstallDirs)
include(ECMSetupVersion)
include(KDECMakeSettings)
include(KDEClangFormat)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMInstallIcons)
include(KDEGitCommitHooks)
include(ECMDeprecationSettings)
include(ECMFeatureSummary)
ecm_setup_version(
PROJECT
VARIABLE_PREFIX BASKET
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/basket_version.h")
# GPG
if (ENABLE_GPG)
find_package(Gpgme 1.23.2)
endif()
# libgit2
if (ENABLE_GIT)
find_package(Libgit2 1.8.4 QUIET)
set_package_properties(Libgit2 PROPERTIES DESCRIPTION "A library to manipulate git repositories"
PURPOSE "Add git support to Basket"
URL "https://libgit2.org"
TYPE OPTIONAL
)
endif()
if (LIBGIT2_FOUND)
MESSAGE(STATUS "FOUND: Git2")
include_directories(${LIBGIT2_INCLUDE_DIR})
add_definitions(-DWITH_LIBGIT2)
else()
if (NOT ENABLE_GIT)
MESSAGE(VERBOSE "Git2 disabled, configuring without")
else()
MESSAGE(WARNING "Git2 not found, configuring without")
endif()
endif()
# Debugging Pipe
if (DEBUG_PIPE)
MESSAGE(STATUS "Enable Named Debugging Pipe")
add_definitions(-DDEBUG_PIPE)
endif()
# TODO make X11 optional
find_package(X11 REQUIRED)
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS
Concurrent
Core
DBus
Gui
Widgets
Xml
Core5Compat
)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
Archive
Codecs
Completion
Config
ConfigWidgets #KCM
CoreAddons
Crash
DBusAddons
FileMetaData
GlobalAccel
GuiAddons
I18n
IconThemes
KCMUtils
KIO
Notifications
Parts
Service
TextWidgets
WidgetsAddons
WindowSystem
XmlGui
)
find_package(KF6DocTools ${KF_MIN_VERSION})
set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
"Tools to generate documentation"
TYPE OPTIONAL
)
find_package(Phonon4Qt6 REQUIRED)
if (GPGME_FOUND)
MESSAGE(STATUS "FOUND GPG")
set(HAVE_LIBGPGME 1)
SET(LARGEFILE_SOURCE_1)
ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
else()
if (NOT ENABLE_GPG)
MESSAGE(VERBOSE "GPG disabled, configuring without")
else()
MESSAGE(WARNING "GPG not found, configuring without")
endif()
endif()
#Make libbasketcommon search for translations in basket.mo
add_definitions(-DTRANSLATION_DOMAIN=\"basket\")
add_definitions(-DQT_NO_KEYWORDS)
ecm_set_disabled_deprecation_versions(QT 5.15.0
KF 6.10.0
)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(KF6DocTools_FOUND)
kdoctools_install(po)
add_subdirectory(doc)
endif()
add_subdirectory(src)
add_subdirectory(tags)
add_subdirectory(welcome)
add_subdirectory(backgrounds)
add_subdirectory(images)
add_subdirectory(file-integration)
if(BUILD_DEVTOOLS)
add_subdirectory(devtools)
endif()
ki18n_install(po)
# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)