CMakeLists.txt 1.62 KB
Newer Older
1
2
cmake_minimum_required(VERSION 3.10)

3
4
project(systemmonitor)

5
set(PROJECT_VERSION "5.21.80")
6
set(PROJECT_VERSION_MAJOR 5)
7

8
set(QT_MIN_VERSION "5.15.0")
9
set(KF5_MIN_VERSION "5.78")
10
11
12
13
14
15
16
17
18

find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDEClangFormat)
include(ECMInstallIcons)
19
include(ECMQMLModules)
20
include(FeatureSummary)
21
22
23
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    include(KDEGitCommitHooks)
endif()
24
25

find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Quick Widgets DBus)
26
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n Config Declarative Service GlobalAccel KIO DBusAddons NewStuff)
27
find_package(KSysGuard ${PROJECT_VERSION} REQUIRED)
28
29
30
31
32
33
34
35
36
find_package(Qt5QuickControls2  ${QT_MIN_VERSION})
set_package_properties(Qt5QuickControls2 PROPERTIES
    TYPE RUNTIME
)
find_package(KF5Kirigami2  ${KF5_MIN_VERSION})
set_package_properties(KF5Kirigami2 PROPERTIES
    TYPE RUNTIME
)
ecm_find_qmlmodule(Qt.labs.qmlmodels 1.0)
37
38
39
40

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)

41
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
42
43
44
    add_definitions(-DQT_QML_DEBUG)
endif()

45
46
add_subdirectory(src)

47
48
install(PROGRAMS org.kde.plasma-systemmonitor.desktop  DESTINATION  ${KDE_INSTALL_APPDIR})

49
50
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
51
52
53
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()
54
55

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)