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

3
project(kdeconnect)
4

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

Nicolas Fella's avatar
Nicolas Fella committed
15 16 17 18 19 20 21 22 23 24 25
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)
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
    find_package(PkgConfig)
36 37 38 39 40 41 42 43
    set(KF5_REQUIRED_COMPONENTS I18n DBusAddons CoreAddons IconThemes Config)
    set(KF5_OPTIONAL_COMPONENTS)
    pkg_search_module(SFOS REQUIRED sailfishapp)
    pkg_check_modules(QCA2 qca2-qt5>=${QCA_MIN_VERSION} REQUIRED)
    add_definitions(-DSAILFISHOS)
    include_directories(${QCA2_INCLUDEDIR})
    add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
else()
Nicolas Fella's avatar
Nicolas Fella committed
44
    set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Kirigami2 People)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
45
    set(KF5_OPTIONAL_COMPONENTS DocTools)
Nicolas Fella's avatar
Nicolas Fella committed
46 47

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

Weixuan Xiao's avatar
Weixuan Xiao committed
54
    if(UNIX AND NOT APPLE)
Nicolas Fella's avatar
Nicolas Fella committed
55
        find_package(KF5PulseAudioQt)
56
    endif()
57
    find_package(Qca-qt5 ${QCA_MIN_VERSION} REQUIRED)
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(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS -DQT_NO_CAST_FROM_ASCII -DHAVE_KIO)
67
endif()
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
68

Nicolas Fella's avatar
Nicolas Fella committed
69
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Quick Network Multimedia)
70 71 72 73
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()
74

Matthijs Tijink's avatar
Matthijs Tijink committed
75 76 77 78
if (NOT ZSH_AUTOCOMPLETE_DIR)
set(ZSH_AUTOCOMPLETE_DIR "${CMAKE_INSTALL_PREFIX}/share/zsh/site-functions")
endif()

Weixuan Xiao's avatar
Weixuan Xiao committed
79 80 81 82
option(PRIVATE_DBUS_ENABLED "Use private dbus session for kdeconnect" OFF)
if(PRIVATE_DBUS_ENABLED OR APPLE)
    add_compile_definitions(USE_PRIVATE_DBUS)
endif()
83

Nicolas Fella's avatar
Nicolas Fella committed
84
add_subdirectory(core)
85
add_subdirectory(icon)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
86
add_subdirectory(interfaces)
Nicolas Fella's avatar
Nicolas Fella committed
87
add_subdirectory(data)
88
add_subdirectory(plugins)
89
add_subdirectory(cli)
90
add_subdirectory(declarativeplugin)
91

Nicolas Fella's avatar
Nicolas Fella committed
92 93 94 95
if(NOT SAILFISHOS)
    add_subdirectory(kcm)
    add_subdirectory(kcmplugin)
    add_subdirectory(daemon)
Nicolas Fella's avatar
Nicolas Fella committed
96
    add_subdirectory(app)
97 98 99
    add_subdirectory(indicator)
    add_subdirectory(urlhandler)
    add_subdirectory(nautilus-extension)
100
    add_subdirectory(fileitemactionplugin)
Nicolas Fella's avatar
Nicolas Fella committed
101
    add_subdirectory(smsapp)
Nicolas Fella's avatar
Nicolas Fella committed
102 103 104 105

    if(BUILD_TESTING)
        add_subdirectory(tests)
    endif()
Nicolas Fella's avatar
Nicolas Fella committed
106 107 108 109 110 111 112 113 114

    if(NOT WIN32)
        add_subdirectory(kio)
        add_subdirectory(plasmoid)
    endif()

    if(KF5DocTools_FOUND)
        add_subdirectory(doc)
    endif()
115 116 117
else()
    add_subdirectory(sfos)
endif()
118

119
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)