CMakeLists.txt 2.52 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16)
2

Harald Sitter's avatar
Harald Sitter committed
3
4
project(plasma-volume-control)

5
set(PROJECT_VERSION "5.25.80")
Rajeesh K V's avatar
Rajeesh K V committed
6
7
set(PROJECT_VERSION_MAJOR 5)

8
set(QT_MIN_VERSION "5.15.0")
9
set(KF5_MIN_VERSION "5.94")
10
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
11

Nicolas Fella's avatar
Nicolas Fella committed
12
13
14
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

15
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Harald Sitter's avatar
Harald Sitter committed
16
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ ${ECM_MODULE_PATH})
Harald Sitter's avatar
Harald Sitter committed
17

Nicolas Fella's avatar
Nicolas Fella committed
18
add_definitions(-DTRANSLATION_DOMAIN=\"kcm_pulseaudio\" -DQT_NO_KEYWORDS)
19
20
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050c00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055800)
Harald Sitter's avatar
Harald Sitter committed
21
22
23
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
24
include(KDECompilerSettings NO_POLICY_SCOPE)
25
include(KDEClangFormat)
26
include(KDEGitCommitHooks)
27
include(ECMSetupVersion)
28
include(ECMOptionalAddSubdirectory)
David Rosca's avatar
David Rosca committed
29
30
include(FindPkgConfig)

31
32
33
34
ecm_setup_version(${PROJECT_VERSION}
    VARIABLE_PREFIX PLASMAPA
    VERSION_HEADER ${CMAKE_BINARY_DIR}/version.h)

Laurent Montel's avatar
Laurent Montel committed
35
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS
36
    Core
37
    Gui
38
    DBus
39
40
    Quick
)
David Rosca's avatar
David Rosca committed
41
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
42
43
    CoreAddons
    Declarative
44
    DocTools
45
    GlobalAccel
Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
46
    Notifications
47
48
49
    I18n
    Plasma
)
50

51
find_package(Canberra REQUIRED)
Harald Sitter's avatar
Harald Sitter committed
52

53
54
pkg_check_modules(LIBPULSE libpulse REQUIRED IMPORTED_TARGET)
pkg_check_modules(LIBPULSE_MAINLOOP libpulse-mainloop-glib REQUIRED IMPORTED_TARGET)
55
56

pkg_check_modules(GIO gio-2.0 REQUIRED IMPORTED_TARGET)
Nicolas Fella's avatar
Nicolas Fella committed
57

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
find_package(CanberraPulse)
set_package_properties(CanberraPulse PROPERTIES
    DESCRIPTION "Pulseaudio backend for libcanberra"
    PURPOSE "Required for volume feedback sounds"
    TYPE RUNTIME
)

find_package(SoundThemeFreedesktop)
set_package_properties(SoundThemeFreedesktop PROPERTIES
    DESCRIPTION "The standard freedesktop sound theme"
    PURPOSE "Required for volume feedback sounds"
    URL "https://www.freedesktop.org/wiki/Specifications/sound-theme-spec/"
    TYPE RUNTIME
)

73
74
75
76
77
78
79
find_package(KF5Kirigami2 ${KF5_MIN_VERSION} CONFIG)
set_package_properties(KF5Kirigami2 PROPERTIES
    DESCRIPTION "A QtQuick based components set"
    PURPOSE "Required at runtime the KCM"
    TYPE RUNTIME
)

Harald Sitter's avatar
Harald Sitter committed
80
81
add_subdirectory(applet)
add_subdirectory(src)
82
add_subdirectory(data)
David Rosca's avatar
David Rosca committed
83
add_subdirectory(doc)
Harald Sitter's avatar
Harald Sitter committed
84

85
86
87
# 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})
88
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
89

Harald Sitter's avatar
Harald Sitter committed
90
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)