CMakeLists.txt 2.39 KB
Newer Older
1
2
cmake_minimum_required(VERSION 3.0)

3
project(ksysguard)
4
set(PROJECT_VERSION "5.17.80")
5

6
set(KSYSGUARD_VERSION 4.98.0)
7
8
set(KSYSGUARD_STRING_VERSION "${KSYSGUARD_VERSION}")

9
set(QT_MIN_VERSION "5.12.0")
10
set(KF5_MIN_VERSION "5.58.0")
11

12
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
13
14
15
16
17
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

include(CheckIncludeFiles)
include(KDEInstallDirs)
include(KDECMakeSettings)
18
include(KDECompilerSettings NO_POLICY_SCOPE)
19
include(KDEClangFormat)
20
21
22
23
24
25
26
27
include(ECMAddTests)
include(ECMInstallIcons)
include(FeatureSummary)

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    Core
    Widgets
)
28
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
29
    Config
30
    CoreAddons
31
32
    DBusAddons
    DocTools
33
    I18n
34
35
    IconThemes
    Init
36
    ItemViews
37
    KIO
38
    NewStuff
39
    Notifications
40
    WindowSystem
41
42
)

43
find_package(KF5 REQUIRED COMPONENTS SysGuard)
44

Laurent Montel's avatar
Laurent Montel committed
45
46
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_QSTRINGBUILDER)
47
48
49
#add_definitions(-DQT_NO_CAST_FROM_ASCII)
#add_definitions(-DQT_NO_CAST_TO_ASCII)
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
50
51
52
53
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
endif()
54

55
56
57
58
59
find_package(Sensors)
set_package_properties(Sensors PROPERTIES
                       TYPE OPTIONAL
                       PURPOSE "Allows to show sensor information")

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
find_package(libpcap)
set_package_properties(
    libpcap PROPERTIES
    TYPE RECOMMENDED
    PURPOSE "libpcap is used for per-application network usage."
)

if (libpcap_FOUND)
    find_package(Libcap)
    set_package_properties(Libcap PROPERTIES
        TYPE OPTIONAL
        PURPOSE "Needed for setting capabilities of the per-application network plugin."
    )
endif()

75
76
77
include_directories(${CMAKE_CURRENT_BINARY_DIR})
configure_file(config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h)

78
add_subdirectory( gui )
79

80
add_subdirectory( doc )
81
82
add_subdirectory( pics )
add_subdirectory( example )
83

Aaron J. Seigo's avatar
Aaron J. Seigo committed
84
add_subdirectory( ksysguardd )
85

86
87
add_subdirectory( plugins )

88
89
90
91
# 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})

92
93
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)