CMakeLists.txt 2.39 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16)
Nicolas Fella's avatar
Nicolas Fella committed
2

Aaron J. Seigo's avatar
Aaron J. Seigo committed
3
project(plasma-phone-components)
Aaron J. Seigo's avatar
Aaron J. Seigo committed
4

Nicolas Fella's avatar
Nicolas Fella committed
5
set(QT_MIN_VERSION "5.15.0")
6
set(KF5_MIN_VERSION "5.86")
7
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
Aaron J. Seigo's avatar
Aaron J. Seigo committed
8

Nicolas Fella's avatar
Nicolas Fella committed
9
10
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Aaron J. Seigo's avatar
Aaron J. Seigo committed
11

Nicolas Fella's avatar
Nicolas Fella committed
12
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Nicolas Fella's avatar
Nicolas Fella committed
13
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
Aaron J. Seigo's avatar
Aaron J. Seigo committed
14
15
16

include(KDEInstallDirs)
include(KDECMakeSettings)
17
include(KDECompilerSettings NO_POLICY_SCOPE)
Aaron J. Seigo's avatar
Aaron J. Seigo committed
18
19
20
21
22
23
include(ECMOptionalAddSubdirectory)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMMarkNonGuiExecutable)
include(ECMGenerateHeaders)
include(GenerateExportHeader)
24
25
include(KDEGitCommitHooks)
include(KDEClangFormat)
Aaron J. Seigo's avatar
Aaron J. Seigo committed
26
27
include(FeatureSummary)

28
29
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)

Nicolas Fella's avatar
Nicolas Fella committed
30
31
32
33
34
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
    Core
    Qml
    Quick
)
Aaron J. Seigo's avatar
Aaron J. Seigo committed
35

36
37
38
39
40
41
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
    I18n
    KIO
    Plasma
    PlasmaQuick
    Service
David Faure's avatar
David Faure committed
42
    Notifications
Nicolas Fella's avatar
Nicolas Fella committed
43
    Wayland
44
    ModemManagerQt
45
)
46
find_package(KWinDBusInterface)
47
48
49
50
set_package_properties(KWinDBusInterface PROPERTIES DESCRIPTION "KWin DBus interface"
    TYPE REQUIRED
    PURPOSE "Needed for virtual keyboard toggle button"
)
Aaron J. Seigo's avatar
Aaron J. Seigo committed
51
52
53

include(CheckIncludeFiles)

54
plasma_install_package(look-and-feel org.kde.plasma.phone look-and-feel)
55
plasma_install_package(shell org.kde.plasma.phoneshell shells)
56
plasma_install_package(quicksettings/nightcolor org.kde.plasma.nightcolor quicksettings)
57
plasma_install_package(quicksettings/airplanemode org.kde.plasma.airplanemode quicksettings)
58

59
install(FILES plasma_phone_components.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
60

61

62
add_subdirectory(bin)
63
add_subdirectory(applets)
Marco Martin's avatar
Marco Martin committed
64
add_subdirectory(containments)
65
add_subdirectory(components)
66
add_subdirectory(mmplugin)
67

68
69
70
71
72
73
74
find_program(PlasmaOpenSettings plasma-open-settings)
set_package_properties(PlasmaOpenSettings PROPERTIES
                                          URL https://invent.kde.org/plasma/kde-cli-tools/
                                          DESCRIPTION "Opens KCMs properly"
                                          TYPE RUNTIME
                                          PURPOSE "Used on the top panel")

75
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
76

77
78
79
80
# 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})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)