forked from KDE/kdeconnect-kde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
162 lines (128 loc) · 5.09 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
cmake_minimum_required(VERSION 3.0)
# KDE Release Service Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "21")
set (RELEASE_SERVICE_VERSION_MINOR "11")
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(kdeconnect VERSION ${RELEASE_SERVICE_VERSION})
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 17)
if (SAILFISHOS)
set(KF5_MIN_VERSION "5.36.0")
set(QT_MIN_VERSION "5.6.0")
else()
set(KF5_MIN_VERSION "5.71.0")
set(QT_MIN_VERSION "5.10.0")
endif()
set(QCA_MIN_VERSION "2.1.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMAddTests)
include(ECMSetupVersion)
include(ECMInstallIcons)
include(ECMQtDeclareLoggingCategory)
include(FeatureSummary)
include(GenerateExportHeader)
include(ECMGenerateQmlTypes)
if (NOT SAILFISHOS)
include(ECMQMLModules)
endif()
include(KDEConnectMacros.cmake)
ecm_setup_version(${RELEASE_SERVICE_VERSION}
VARIABLE_PREFIX KDECONNECT
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h
)
# Make the version header available by linking against kdeconnectversion
add_library(kdeconnectversion INTERFACE)
target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
if (SAILFISHOS)
set(KF5_REQUIRED_COMPONENTS I18n CoreAddons Config)
set(KF5_OPTIONAL_COMPONENTS)
set(Qca_LIBRARY CONAN_PKG::Qca-qt5)
add_definitions(-DSAILFISHOS)
else()
find_package(Qca-qt5 ${QCA_MIN_VERSION} REQUIRED)
set(Qca_LIBRARY qca-qt5)
set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami2 People WindowSystem)
set(KF5_OPTIONAL_COMPONENTS DocTools)
set_package_properties(KF5Kirigami2 PROPERTIES
DESCRIPTION "QtQuick plugins to build user interfaces based on KDE UX guidelines"
PURPOSE "Required for KDE Connect's QML-based GUI applications"
URL "https://www.kde.org/products/kirigami/"
TYPE RUNTIME
)
if(UNIX AND NOT APPLE)
find_package(KF5PulseAudioQt)
endif()
find_package(KF5PeopleVCard)
set_package_properties(KF5PeopleVCard PROPERTIES
PURPOSE "Read vcards from the file system"
URL "https://invent.kde.org/pim/kpeoplevcard"
TYPE RUNTIME
)
add_definitions(-DHAVE_KIO)
#ecm_find_qmlmodule(org.kde.people 1.0) FIXME This results in KPeople code being called which triggers DBus calls which breaks the Windows CI
ecm_find_qmlmodule(QtQuick.Particles 2.0)
endif()
add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS -DQT_NO_CAST_FROM_ASCII)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Quick QuickControls2 Network Multimedia)
if (UNIX AND NOT APPLE)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS})
if (KF5_OPTIONAL_COMPONENTS)
find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS ${KF5_OPTIONAL_COMPONENTS})
endif()
if (WIN32)
get_filename_component(WINDOWS_KITS_DIR
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
file(READ "${WINDOWS_KITS_DIR}/SDKManifest.xml" SDK_MANIFEST)
string(REGEX MATCH "PlatformIdentity[^\n]*" PLATFORM_IDENTITY "${SDK_MANIFEST}" )
string(REGEX MATCH "[0-9][0-9][0-9][0-9][0-9]" WIN_SDK_VERSION "${PLATFORM_IDENTITY}" )
add_compile_definitions(WIN_SDK_VERSION=${WIN_SDK_VERSION})
endif()
if (NOT ZSH_AUTOCOMPLETE_DIR)
set(ZSH_AUTOCOMPLETE_DIR "${KDE_INSTALL_DATADIR}/zsh/site-functions")
endif()
option(PRIVATE_DBUS_ENABLED "Use private dbus session for kdeconnect" OFF)
if(PRIVATE_DBUS_ENABLED OR APPLE)
add_compile_definitions(USE_PRIVATE_DBUS)
endif()
add_subdirectory(core)
add_subdirectory(plugins)
add_subdirectory(interfaces)
if (NOT SAILFISHOS)
find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED)
set_package_properties(KF5QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
add_subdirectory(icons)
add_subdirectory(data)
add_subdirectory(cli)
add_subdirectory(declarativeplugin)
add_subdirectory(kcm)
add_subdirectory(kcmplugin)
add_subdirectory(daemon)
add_subdirectory(app)
add_subdirectory(indicator)
add_subdirectory(urlhandler)
add_subdirectory(nautilus-extension)
add_subdirectory(fileitemactionplugin)
add_subdirectory(smsapp)
add_subdirectory(settings)
if(NOT WIN32)
add_subdirectory(kio)
add_subdirectory(plasmoid)
endif()
endif()
if(KF5DocTools_FOUND)
add_subdirectory(doc)
endif()
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
ecm_qt_install_logging_categories(EXPORT kdeconnect-kde FILE kdeconnect-kde.categories SORT DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}")
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)