-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
125 lines (99 loc) · 3.14 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
cmake_minimum_required (VERSION 3.16 FATAL_ERROR)
# KDE Application Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "25")
set (RELEASE_SERVICE_VERSION_MINOR "03")
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(KSystemLog VERSION ${RELEASE_SERVICE_VERSION})
set (QT_MIN_VERSION "6.7.0")
set (KF_MIN_VERSION "6.3.0")
find_package (ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
add_definitions(-DTRANSLATION_DOMAIN="ksystemlog")
include(ECMSetupVersion)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)
include(KDEGitCommitHooks)
include(KDEClangFormat)
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.c)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KSYSTEMLOG
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/ksystemlog_version.h")
find_package (Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Concurrent
Core
Widgets
Test
PrintSupport
)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
XmlGui
CoreAddons
WidgetsAddons
ItemViews
KIO
Config
Archive
I18n
Completion
TextWidgets
Crash
)
find_package(KF6DocTools ${KF_MIN_VERSION})
set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
"Tools to generate documentation"
TYPE OPTIONAL
)
find_package(Journald)
if(JOURNALD_FOUND)
find_package(Qt6Network ${QT_MIN_VERSION} CONFIG REQUIRED)
add_definitions(-DHAVE_JOURNALD)
endif()
find_package(Audit)
if(AUDIT_FOUND)
add_definitions(-DHAVE_AUDIT)
endif()
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckFunctionExists)
include(CheckLibraryExists)
include(CheckTypeSize)
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
# Help Eclipse to parse errors more efficiently
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif(CMAKE_COMPILER_IS_GNUCXX)
add_custom_target(
pkg
COMMAND ./build-package.sh
)
##
# To specify a different install prefix, use :
# cmake -D CMAKE_INSTALL_PREFIX=build .
#
# To help Eclipse discover include paths, use :
# cmake -D CMAKE_VERBOSE_MAKEFILE=true .
##
########### Subfolders ##########
ecm_set_disabled_deprecation_versions(QT 6.7
KF 6.4.0
)
add_subdirectory(src)
add_subdirectory(autotests)
find_package(KF6I18n CONFIG REQUIRED)
if (KF6DocTools_FOUND)
kdoctools_install(po)
add_subdirectory(doc)
endif()
ki18n_install(po)
ecm_qt_install_logging_categories(EXPORT KSYSTEMLOG FILE ksystemlog.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)