CMakeLists.txt 3.77 KB
Newer Older
1
cmake_minimum_required(VERSION 3.0)
Jan Grulich's avatar
Jan Grulich committed
2

3
project(plasma-networkmanagement)
Jan Grulich's avatar
Jan Grulich committed
4

5
set(PROJECT_VERSION "5.17.90")
6
set(PROJECT_VERSION_MAJOR 5)
Jan Grulich's avatar
Jan Grulich committed
7

8
set(QT_MIN_VERSION "5.12.0")
9
set(KF5_MIN_VERSION "5.66.0")
10

11
12
################# set KDE specific information #################

13
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Jan Grulich's avatar
Jan Grulich committed
14
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
15
16
17

include(KDEInstallDirs)
include(KDECMakeSettings)
18
include(KDECompilerSettings NO_POLICY_SCOPE)
19
include(KDEClangFormat)
20
include(ECMQMLModules)
21

22
include(FeatureSummary)
Jan Grulich's avatar
Jan Grulich committed
23
24
25
26
27
28

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    Core
    DBus
    Network
    Quick
29
    QuickWidgets
Jan Grulich's avatar
Jan Grulich committed
30
31
    Widgets
)
32

33
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
34
    ConfigWidgets
35
36
    Completion
    CoreAddons
37
    Declarative
38
    DBusAddons
39
40
41
42
    KIO
    I18n
    IconThemes
    NetworkManagerQt
43
44
    Notifications
    Plasma
45
46
47
48
49
    Service
    Solid
    Wallet
    WidgetsAddons
    WindowSystem
50
)
51

52
find_package(KF5ModemManagerQt ${KF5_MIN_VERSION})
Jan Grulich's avatar
Jan Grulich committed
53
54
set_package_properties(KF5ModemManagerQt PROPERTIES
                       TYPE OPTIONAL)
Jan Grulich's avatar
Jan Grulich committed
55

56
57
ecm_find_qmlmodule(org.kde.prison 1.0)

58
59
60
61
62
63
64
65
66
if (BUILD_MOBILE)
    find_package(KF5Kirigami2 ${KF5_MIN_VERSION} CONFIG)
    set_package_properties(KF5Kirigami2 PROPERTIES
        DESCRIPTION "A QtQuick based components set"
        PURPOSE "Required at runtime by the mobile KCMs"
        TYPE RUNTIME
    )
endif()

67
# Required only for getting information about NetworkManager version in CMake
Jan Grulich's avatar
Jan Grulich committed
68
find_package(NetworkManager 1.4.0)
69
70
71
set_package_properties(NetworkManager PROPERTIES
                       TYPE REQUIRED)

Jan Grulich's avatar
Jan Grulich committed
72
73
74
find_package(MobileBroadbandProviderInfo)
set_package_properties(MobileBroadbandProviderInfo PROPERTIES
                       DESCRIPTION "Database of mobile broadband service providers"
75
                       URL "https://wiki.gnome.org/action/show/Projects/NetworkManager/MobileBroadband/ServiceProviders"
Jan Grulich's avatar
Jan Grulich committed
76
                       TYPE OPTIONAL)
Jan Grulich's avatar
Jan Grulich committed
77

78
79
find_package(Qca-qt5 2.1.0)
set_package_properties(Qca-qt5 PROPERTIES DESCRIPTION "Support for encryption"
80
                       URL "https://download.kde.org/stable/qca-qt5/"
81
82
                       TYPE REQUIRED)

83
84
find_package(KF5Prison ${KF5_MIN_VERSION})
set_package_properties(KF5Prison PROPERTIES DESCRIPTION "Prison library"
85
                       URL "https://commits.kde.org/prison"
86
87
88
89
                       TYPE RUNTIME
                       PURPOSE "Needed to create mobile barcodes for WiFi networks"
                      )

Jan Grulich's avatar
Jan Grulich committed
90
91
92
if (DISABLE_MODEMMANAGER_SUPPORT)
    message(STATUS "Disabling ModemManager support")
    set(WITH_MODEMMANAGER_SUPPORT 0)
93
else()
94
    if (KF5ModemManagerQt_FOUND)
Jan Grulich's avatar
Jan Grulich committed
95
96
        message(STATUS "Enabling ModemManager support")
        set(WITH_MODEMMANAGER_SUPPORT 1)
97
    else()
98
        message(STATUS "ModemManager or ModemManagerQt not found")
Jan Grulich's avatar
Jan Grulich committed
99
        set(WITH_MODEMMANAGER_SUPPORT 0)
100
101
    endif()
endif()
Jan Grulich's avatar
Jan Grulich committed
102

Jan Grulich's avatar
Jan Grulich committed
103
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
104
add_definitions(-DQT_USE_FAST_OPERATOR_PLUS)
105
106
107
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)

remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY)
Jan Grulich's avatar
Jan Grulich committed
108

Jan Grulich's avatar
Jan Grulich committed
109
add_definitions(-DWITH_MODEMMANAGER_SUPPORT=${WITH_MODEMMANAGER_SUPPORT})
Daniel Nicoletti's avatar
Daniel Nicoletti committed
110

111
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs
112
113
                    ${CMAKE_CURRENT_SOURCE_DIR}/libs/editor/)

Jan Grulich's avatar
Jan Grulich committed
114
add_subdirectory(applet)
115
add_subdirectory(kded)
Jan Grulich's avatar
Jan Grulich committed
116
add_subdirectory(kcm)
Jan Grulich's avatar
Jan Grulich committed
117
add_subdirectory(libs)
Jan Grulich's avatar
Jan Grulich committed
118
add_subdirectory(vpn)
Jan Grulich's avatar
Jan Grulich committed
119
120
121
122

if (BUILD_MOBILE)
    add_subdirectory(mobile)
endif()
123
124
125
126

# Enable unit testing
if (BUILD_TESTING)
    add_subdirectory(tests)
Jan Grulich's avatar
Jan Grulich committed
127
endif()
Harald Sitter's avatar
Harald Sitter committed
128

129
130
131
132
# 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})

133
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)