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

3
project(kdeconnect)
4

5
if (SAILFISHOS)
6
    set(KF5_MIN_VERSION "5.36.0")
7 8
    set(QT_MIN_VERSION "5.6.0")
else()
Nicolas Fella's avatar
Nicolas Fella committed
9
    set(KF5_MIN_VERSION "5.64.0")
10 11
    set(QT_MIN_VERSION "5.10.0")
endif()
12
set(QCA_MIN_VERSION "2.1.0")
13

Nicolas Fella's avatar
Nicolas Fella committed
14 15 16 17 18 19 20 21 22 23 24
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)
include(FeatureSummary)
include(GenerateExportHeader)
Nicolas Fella's avatar
Nicolas Fella committed
25
include(ECMQMLModules)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
26

Nicolas Fella's avatar
Nicolas Fella committed
27 28
include(KDEConnectMacros.cmake)

29
ecm_setup_version(1.4.0
Nicolas Fella's avatar
Nicolas Fella committed
30 31 32
    VARIABLE_PREFIX KDECONNECT
    VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h
)
33

34
if (SAILFISHOS)
35
    set(KF5_REQUIRED_COMPONENTS I18n CoreAddons Config)
36
    set(KF5_OPTIONAL_COMPONENTS)
37

38 39
    set(Qca_LIBRARY CONAN_PKG::Qca-qt5)

40 41
    add_definitions(-DSAILFISHOS)
else()
42 43 44
    find_package(Qca-qt5 ${QCA_MIN_VERSION} REQUIRED)
    set(Qca_LIBRARY qca-qt5)

Nicolas Fella's avatar
Nicolas Fella committed
45
    set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Kirigami2 People)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
46
    set(KF5_OPTIONAL_COMPONENTS DocTools)
Nicolas Fella's avatar
Nicolas Fella committed
47 48

    set_package_properties(KF5Kirigami2 PROPERTIES
Nicolas Fella's avatar
Nicolas Fella committed
49 50 51 52
        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
53 54
    )

55
    if(UNIX AND NOT APPLE)
Nicolas Fella's avatar
Nicolas Fella committed
56
        find_package(KF5PulseAudioQt)
57
    endif()
Nicolas Fella's avatar
Nicolas Fella committed
58 59 60 61 62 63 64 65

    find_package(KF5PeopleVCard)
    set_package_properties(KF5PeopleVCard PROPERTIES
        PURPOSE "Read vcards from the file system"
        URL "https://phabricator.kde.org/source/kpeoplevcard/"
        TYPE RUNTIME
    )

66
    add_definitions(-DHAVE_KIO)
Nicolas Fella's avatar
Nicolas Fella committed
67 68 69

    ecm_find_qmlmodule(org.kde.people 1.0)

70
endif()
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
71

72 73 74
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 Network Multimedia)
75 76
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS})
if (KF5_OPTIONAL_COMPONENTS)
77
    find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS ${KF5_OPTIONAL_COMPONENTS})
78
endif()
79

Matthijs Tijink's avatar
Matthijs Tijink committed
80 81 82 83
if (NOT ZSH_AUTOCOMPLETE_DIR)
set(ZSH_AUTOCOMPLETE_DIR "${CMAKE_INSTALL_PREFIX}/share/zsh/site-functions")
endif()

Weixuan Xiao's avatar
Weixuan Xiao committed
84 85 86 87
option(PRIVATE_DBUS_ENABLED "Use private dbus session for kdeconnect" OFF)
if(PRIVATE_DBUS_ENABLED OR APPLE)
    add_compile_definitions(USE_PRIVATE_DBUS)
endif()
88

89
add_subdirectory(core)
90 91
add_subdirectory(plugins)
add_subdirectory(interfaces)
92 93 94 95 96 97 98

if (NOT SAILFISHOS)
    add_subdirectory(icon)
    add_subdirectory(data)
    add_subdirectory(cli)
    add_subdirectory(declarativeplugin)

99 100 101
    add_subdirectory(kcm)
    add_subdirectory(kcmplugin)
    add_subdirectory(daemon)
Nicolas Fella's avatar
Nicolas Fella committed
102
    add_subdirectory(app)
103 104 105
    add_subdirectory(indicator)
    add_subdirectory(urlhandler)
    add_subdirectory(nautilus-extension)
106
    add_subdirectory(fileitemactionplugin)
Nicolas Fella's avatar
Nicolas Fella committed
107
    add_subdirectory(smsapp)
108 109
    add_subdirectory(settings)

110 111 112 113
    if(NOT WIN32)
        add_subdirectory(kio)
        add_subdirectory(plasmoid)
    endif()
114
endif()
115

116 117 118
if(KF5DocTools_FOUND)
    add_subdirectory(doc)
endif()
119

120 121
if(BUILD_TESTING)
    add_subdirectory(tests)
122
endif()
123

124
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)