-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
110 lines (82 loc) · 3.45 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
# SPDX-FileCopyrightText: 2008 Volker Lanz <[email protected]>
# SPDX-FileCopyrightText: 2015 Teo Mrnjavac <[email protected]>
# SPDX-FileCopyrightText: 2014-2022 Andrius Štikonas <[email protected]>
# SPDX-FileCopyrightText: 2020 David Edmundson <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
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(kpmcore VERSION ${RELEASE_SERVICE_VERSION})
set(SOVERSION "12")
add_definitions(-D'VERSION="${RELEASE_SERVICE_VERSION}"') #"
set(CMAKE_USE_RELATIVE_PATHS OFF)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
# Note that KPMcore is restricted to only run binaries installed into trusted prefixes
# See src/util/trustedprefixes
# By default this is set to / and /usr which is good for majority of distros
# Dependencies
set(QT_MIN_VERSION "6.5.0")
set(KF_MIN_VERSION "5.240.0")
set(BLKID_MIN_VERSION "2.33.2")
# PolkitQt5-1
# Runtime
# smartmontools 7.0
set(KDE_COMPILERSETTINGS_LEVEL "5.85")
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(FeatureSummary)
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMConfiguredInstall)
include(ECMDeprecationSettings)
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KPMCORE
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kpmcore_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfigVersion.cmake"
SOVERSION ${SOVERSION})
find_package(Qt6 ${QT_MIN_VERSION} COMPONENTS REQUIRED
Core
DBus
Gui
Widgets
)
# Load the frameworks we need
find_package(KF6 ${KF_MIN_VERSION} REQUIRED
CoreAddons
I18n
WidgetsAddons
)
find_package(PolkitQt6-1 REQUIRED)
ecm_set_disabled_deprecation_versions(QT 6.7
KF 6.4
)
kde_enable_exceptions()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
find_package(PkgConfig REQUIRED)
pkg_check_modules(BLKID REQUIRED blkid>=${BLKID_MIN_VERSION})
endif()
add_subdirectory(src)
# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KPMcore")
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KPMcoreConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel )
install(EXPORT KPMcoreTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KPMcoreTargets.cmake )
ki18n_install(po)
set_target_properties( kpmcore
PROPERTIES VERSION ${RELEASE_SERVICE_VERSION} SOVERSION ${SOVERSION}
)
message(STATUS "kpmcore ${RELEASE_SERVICE_VERSION} will be built for install into ${CMAKE_INSTALL_PREFIX}")
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
enable_testing()
add_subdirectory(test)