CMakeLists.txt 6.95 KB
Newer Older
Matthieu Gallien's avatar
Matthieu Gallien committed
1
2
3
4
# SPDX-FileCopyrightText: 2015 (c) Matthieu Gallien <matthieu_gallien@yahoo.fr>
#
# SPDX-License-Identifier: LGPL-3.0-or-later

5
cmake_minimum_required(VERSION 3.8)
6

7
# KDE Applications version, managed by release script.
8
set(RELEASE_SERVICE_VERSION_MAJOR "21")
9
set(RELEASE_SERVICE_VERSION_MINOR "11")
10
set(RELEASE_SERVICE_VERSION_MICRO "70")
Nate Graham's avatar
Nate Graham committed
11
set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
12

13
project(elisa
14
    VERSION ${RELEASE_SERVICE_VERSION}
15
    LANGUAGES CXX)
16

Devin Lin's avatar
Devin Lin committed
17
set(REQUIRED_QT_VERSION "5.15.0")
18
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Network Qml Quick Test Sql Multimedia Svg Gui Widgets QuickTest Concurrent QuickControls2)
19

20
21
find_package(Qt5Core ${REQUIRED_QT_VERSION} CONFIG REQUIRED Private)

Nate Graham's avatar
Nate Graham committed
22
23
# TODO: bump dependency to 5.86 once 5.86 is tagged
set(REQUIRED_KF5_VERSION "5.85.0")
24
find_package(ECM ${REQUIRED_KF5_VERSION} REQUIRED NO_MODULE)
25
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH})
26

27
28
include(KDEInstallDirs)
include(KDECMakeSettings)
29
include(KDECompilerSettings NO_POLICY_SCOPE)
30
include(ECMInstallIcons)
Luca Beltrame's avatar
Luca Beltrame committed
31
include(FeatureSummary)
32
include(ECMAddAppIcon)
33
include(ECMAddTests)
34
include(ECMQtDeclareLoggingCategory)
35
include(ECMGenerateQmlTypes)
36

Matthieu Gallien's avatar
Matthieu Gallien committed
37
if (NOT WIN32 AND NOT ANDROID)
38
39
40
41
42
    find_package(Qt5DBus ${REQUIRED_QT_VERSION} CONFIG QUIET)
    set_package_properties(Qt5DBus PROPERTIES
        DESCRIPTION "Qt5 DBus is needed to provide MPris2 interface to allow remote control by the desktop workspace."
        TYPE OPTIONAL)
endif()
43
44
45
46
47
48
49
50
51

find_package(Qt5QuickWidgets ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5QuickWidgets PROPERTIES
    DESCRIPTION "Qt5 Quick Widgets is needed at runtime to provide the interface."
    TYPE RUNTIME)

find_package(Qt5QuickControls2 ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5QuickControls2 PROPERTIES
    DESCRIPTION "Qt5 Quick Controls version 2 is needed at runtime to provide the interface."
52
    TYPE RUNTIME)
53
54
55

if (ANDROID)
    find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS AndroidExtras)
56
57
58
    set_package_properties(Qt5AndroidExtras PROPERTIES
        DESCRIPTION "Qt5 AndroidExtras is needed to provide the Android integration."
        TYPE REQUIRED)
59
60
endif()

61
62
63
64
find_package(KF5Kirigami2 ${REQUIRED_KF5_VERSION} CONFIG QUIET)

set_package_properties(KF5Kirigami2 PROPERTIES
    DESCRIPTION "KF5 Kirigami 2 is needed to provide the mobile UI components."
65
    TYPE REQUIRED)
66

67
68
69
70
find_package(KF5I18n ${REQUIRED_KF5_VERSION} CONFIG QUIET)
set_package_properties(KF5I18n PROPERTIES
    DESCRIPTION "KF5 text internationalization library."
    TYPE REQUIRED)
71
72

find_package(KF5Declarative ${REQUIRED_KF5_VERSION} CONFIG QUIET)
73
74
75
76
set_package_properties(KF5Declarative PROPERTIES
    DESCRIPTION "Integration of QML and KDE work spaces."
    TYPE RECOMMENDED)

77
find_package(KF5CoreAddons ${REQUIRED_KF5_VERSION} CONFIG QUIET)
78
79
set_package_properties(KF5CoreAddons PROPERTIES
    DESCRIPTION "Qt addon library with a collection of non-GUI utilities."
80
    TYPE REQUIRED)
81

Matthieu Gallien's avatar
Matthieu Gallien committed
82
83
84
85
86
find_package(KF5IconThemes ${REQUIRED_KF5_VERSION} CONFIG QUIET)
set_package_properties(KF5IconThemes PROPERTIES
    DESCRIPTION "Support for icon themes."
    TYPE REQUIRED)

87
if (NOT WIN32)
88
find_package(KF5Baloo ${REQUIRED_KF5_VERSION} CONFIG QUIET)
89
90
91
set_package_properties(KF5Baloo PROPERTIES
    DESCRIPTION "Baloo provides file searching and indexing."
    TYPE RECOMMENDED)
92
endif()
93

94
find_package(KF5FileMetaData ${REQUIRED_KF5_VERSION} CONFIG QUIET)
95
96
set_package_properties(KF5FileMetaData PROPERTIES
    DESCRIPTION "Provides a simple library for extracting metadata."
97
    TYPE RECOMMENDED)
98

Alexander Stippich's avatar
Alexander Stippich committed
99
find_package(KF5DocTools ${REQUIRED_KF5_VERSION} CONFIG QUIET)
100
101
102
103
set_package_properties(KF5DocTools PROPERTIES
    DESCRIPTION "Create documentation from DocBook library."
    TYPE OPTIONAL)

104
find_package(KF5XmlGui ${REQUIRED_KF5_VERSION} CONFIG QUIET)
105
106
107
108
109
110
111
set_package_properties(KF5XmlGui PROPERTIES
    DESCRIPTION "Framework for managing menu and toolbar actions."
    TYPE RECOMMENDED)

find_package(KF5Config ${REQUIRED_KF5_VERSION} CONFIG QUIET)
set_package_properties(KF5Config PROPERTIES
    DESCRIPTION "Persistent platform-independent application settings."
112
113
114
115
116
    TYPE REQUIRED)

find_package(KF5ConfigWidgets ${REQUIRED_KF5_VERSION} CONFIG QUIET)
set_package_properties(KF5ConfigWidgets PROPERTIES
    DESCRIPTION "Widgets for configuration dialogs."
117
118
    TYPE RECOMMENDED)

119
find_package(KF5Crash ${REQUIRED_KF5_VERSION} CONFIG QUIET)
120
121
122
123
set_package_properties(KF5Crash PROPERTIES
    DESCRIPTION "Graceful handling of application crashes."
    TYPE OPTIONAL)

Matthieu Gallien's avatar
Matthieu Gallien committed
124
if (NOT WIN32 AND NOT ANDROID)
125
126
127
128
129
    find_package(KF5DBusAddons ${REQUIRED_KF5_VERSION} CONFIG QUIET)
    set_package_properties(KF5DBusAddons PROPERTIES
        DESCRIPTION "Convenience classes for D-Bus."
        TYPE OPTIONAL)
endif()
130

131
132
133
134
135
find_package(KF5Package ${REQUIRED_KF5_VERSION} CONFIG QUIET)
set_package_properties(KF5Package PROPERTIES
    DESCRIPTION "KF5 package management library needed to get the configuration dialogs."
    TYPE RECOMMENDED)

Nicolas Fella's avatar
Nicolas Fella committed
136
137
138
139
140
if (NOT ANDROID)
    find_package(KF5KIO ${REQUIRED_KF5_VERSION} CONFIG QUIET)
    set_package_properties(KF5KIO PROPERTIES
        DESCRIPTION "File management libraries used for file browsing."
        TYPE REQUIRED)
141
endif()
Alexander Stippich's avatar
Alexander Stippich committed
142

143
find_package(UPNPQT CONFIG QUIET)
144
set_package_properties(UPNPQT PROPERTIES
145
    DESCRIPTION "UPNP layer build with Qt 5. UPnP support is currently broken. You should probably avoid this dependency."
146
147
    URL "https://gitlab.com/homeautomationqt/upnp-player-qt"
    TYPE OPTIONAL)
148

149
150
151
152
if (UPNPQT_FOUND)
    message(WARNING "UPnP support is experimental and may not work.")
endif()

153
154
find_package(LIBVLC QUIET)
set_package_properties(LIBVLC PROPERTIES
155
    DESCRIPTION "libvlc allows to play music in Elisa (otherwise it will use QtMultimedia)"
156
    URL "https://www.videolan.org/vlc/libvlc.html"
157
    TYPE RECOMMENDED)
158

159
160
161
162
163
164
include(FeatureSummary)
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(CMakePackageConfigHelpers)

165
configure_file(config-upnp-qt.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-upnp-qt.h)
166

167
ecm_setup_version(${RELEASE_SERVICE_VERSION}
168
169
170
    VARIABLE_PREFIX ELISA
    VERSION_HEADER elisa-version.h)

171
172
set(QML_IMPORT_PATH ${CMAKE_BINARY_DIR}/bin CACHE STRING "" FORCE)

173
add_subdirectory(src)
174
add_subdirectory(icons)
175
176
177
if (BUILD_TESTING)
    add_subdirectory(autotests)
endif()
Matthieu Gallien's avatar
Matthieu Gallien committed
178
add_subdirectory(doc)
179

180
181
182
183
184
install(
    PROGRAMS org.kde.elisa.desktop
    DESTINATION ${XDG_APPS_INSTALL_DIR}
)

185
186
187
188
189
install(
    FILES org.kde.elisa.appdata.xml
    DESTINATION ${KDE_INSTALL_METAINFODIR}
)

190
ki18n_install(po)
191
192
193
if (KF5DocTools_FOUND)
    kdoctools_install(po)
endif()
194

195
install(FILES elisa.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
196

197
198
199
200
201
if (ANDROID)
    file(COPY androidResources/icon.png androidResources/splash.xml androidResources/vendor_logo.png androidResources/splash_logo.png
        DESTINATION ${CMAKE_SOURCE_DIR}/data/res/drawable)
endif()

202
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
203