CMakeLists.txt 4.24 KB
Newer Older
1
2
cmake_minimum_required(VERSION 3.0)

3
# KDE Release Service Version, managed by release script
4
5
set (RELEASE_SERVICE_VERSION_MAJOR "21")
set (RELEASE_SERVICE_VERSION_MINOR "03")
6
set (RELEASE_SERVICE_VERSION_MICRO "80")
7
8
9
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")

project(kdeconnect VERSION ${RELEASE_SERVICE_VERSION})
10

11
if (SAILFISHOS)
12
    set(KF5_MIN_VERSION "5.36.0")
13
14
    set(QT_MIN_VERSION "5.6.0")
else()
15
    set(KF5_MIN_VERSION "5.71.0")
16
17
    set(QT_MIN_VERSION "5.10.0")
endif()
18
set(QCA_MIN_VERSION "2.1.0")
19

Nicolas Fella's avatar
Nicolas Fella committed
20
21
22
23
24
25
26
27
28
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMAddTests)
include(ECMSetupVersion)
include(ECMInstallIcons)
29
include(ECMQtDeclareLoggingCategory)
Nicolas Fella's avatar
Nicolas Fella committed
30
31
include(FeatureSummary)
include(GenerateExportHeader)
32
33
34
if (NOT SAILFISHOS)
    include(ECMQMLModules)
endif()
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
35

Nicolas Fella's avatar
Nicolas Fella committed
36
37
include(KDEConnectMacros.cmake)

38
ecm_setup_version(${RELEASE_SERVICE_VERSION}
Nicolas Fella's avatar
Nicolas Fella committed
39
40
41
    VARIABLE_PREFIX KDECONNECT
    VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h
)
42

43
44
45
46
# Make the version header available by linking against kdeconnectversion
add_library(kdeconnectversion INTERFACE)
target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR})

47
if (SAILFISHOS)
48
    set(KF5_REQUIRED_COMPONENTS I18n CoreAddons Config)
49
    set(KF5_OPTIONAL_COMPONENTS)
50

51
52
    set(Qca_LIBRARY CONAN_PKG::Qca-qt5)

53
54
    add_definitions(-DSAILFISHOS)
else()
55
56
57
    find_package(Qca-qt5 ${QCA_MIN_VERSION} REQUIRED)
    set(Qca_LIBRARY qca-qt5)

58
    set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami2 People)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
59
    set(KF5_OPTIONAL_COMPONENTS DocTools)
Nicolas Fella's avatar
Nicolas Fella committed
60
61

    set_package_properties(KF5Kirigami2 PROPERTIES
Nicolas Fella's avatar
Nicolas Fella committed
62
63
64
65
        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
Nicolas Fella's avatar
Nicolas Fella committed
66
67
    )

Weixuan Xiao's avatar
Weixuan Xiao committed
68
    if(UNIX AND NOT APPLE)
Nicolas Fella's avatar
Nicolas Fella committed
69
        find_package(KF5PulseAudioQt)
70
    endif()
Nicolas Fella's avatar
Nicolas Fella committed
71
72
73
74

    find_package(KF5PeopleVCard)
    set_package_properties(KF5PeopleVCard PROPERTIES
        PURPOSE "Read vcards from the file system"
75
        URL "https://invent.kde.org/pim/kpeoplevcard"
Nicolas Fella's avatar
Nicolas Fella committed
76
77
78
        TYPE RUNTIME
    )

79
    add_definitions(-DHAVE_KIO)
Nicolas Fella's avatar
Nicolas Fella committed
80
81

    ecm_find_qmlmodule(org.kde.people 1.0)
82
    ecm_find_qmlmodule(QtQuick.Particles 2.0)
Nicolas Fella's avatar
Nicolas Fella committed
83

84
endif()
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
85

86
87
add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS -DQT_NO_CAST_FROM_ASCII)

Nicolas Fella's avatar
Nicolas Fella committed
88
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Quick QuickControls2 Network Multimedia)
89
90
91
if (UNIX AND NOT APPLE)
    find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
endif()
92
93
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS})
if (KF5_OPTIONAL_COMPONENTS)
94
    find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS ${KF5_OPTIONAL_COMPONENTS})
95
endif()
96

Matthijs Tijink's avatar
Matthijs Tijink committed
97
if (NOT ZSH_AUTOCOMPLETE_DIR)
Heiko Becker's avatar
Heiko Becker committed
98
set(ZSH_AUTOCOMPLETE_DIR "${KDE_INSTALL_DATADIR}/zsh/site-functions")
Matthijs Tijink's avatar
Matthijs Tijink committed
99
100
endif()

Weixuan Xiao's avatar
Weixuan Xiao committed
101
102
103
104
option(PRIVATE_DBUS_ENABLED "Use private dbus session for kdeconnect" OFF)
if(PRIVATE_DBUS_ENABLED OR APPLE)
    add_compile_definitions(USE_PRIVATE_DBUS)
endif()
105

Nicolas Fella's avatar
Nicolas Fella committed
106
add_subdirectory(core)
107
108
add_subdirectory(plugins)
add_subdirectory(interfaces)
109
110

if (NOT SAILFISHOS)
Nicolas Fella's avatar
Nicolas Fella committed
111

112
    add_subdirectory(icons)
113
114
115
116
    add_subdirectory(data)
    add_subdirectory(cli)
    add_subdirectory(declarativeplugin)

Nicolas Fella's avatar
Nicolas Fella committed
117
118
119
    add_subdirectory(kcm)
    add_subdirectory(kcmplugin)
    add_subdirectory(daemon)
Nicolas Fella's avatar
Nicolas Fella committed
120
    add_subdirectory(app)
121
122
123
    add_subdirectory(indicator)
    add_subdirectory(urlhandler)
    add_subdirectory(nautilus-extension)
124
    add_subdirectory(fileitemactionplugin)
Nicolas Fella's avatar
Nicolas Fella committed
125
    add_subdirectory(smsapp)
126
127
    add_subdirectory(settings)

Nicolas Fella's avatar
Nicolas Fella committed
128
129
130
131
    if(NOT WIN32)
        add_subdirectory(kio)
        add_subdirectory(plasmoid)
    endif()
132
endif()
133

134
135
136
if(KF5DocTools_FOUND)
    add_subdirectory(doc)
endif()
Nicolas Fella's avatar
Nicolas Fella committed
137

138
139
if(BUILD_TESTING)
    add_subdirectory(tests)
140
endif()
141

142
143
ecm_qt_install_logging_categories(EXPORT kdeconnect-kde FILE kdeconnect-kde.categories SORT DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}")

144
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)