Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

3
project(kdeconnect)
4

Nicolas Fella's avatar
Nicolas Fella committed
5 6 7 8 9 10 11 12 13 14
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)
15
include(ECMQtDeclareLoggingCategory)
Nicolas Fella's avatar
Nicolas Fella committed
16
include(GenerateExportHeader)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
17

Nicolas Fella's avatar
Nicolas Fella committed
18 19 20 21 22 23
include(KDEConnectMacros.cmake)

ecm_setup_version(1.3.3
    VARIABLE_PREFIX KDECONNECT
    VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h
)
24

25
if (SAILFISHOS)
26
    find_package(PkgConfig)
27 28 29 30 31 32 33 34 35 36 37 38
    set(KF5_MIN_VERSION "5.31.0")
    set(QT_MIN_VERSION "5.6.0")
    set(KF5_REQUIRED_COMPONENTS I18n DBusAddons CoreAddons IconThemes Config)
    set(KF5_OPTIONAL_COMPONENTS)
    set(QCA_MIN_VERSION 2.0.0)
    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()
    set(KF5_MIN_VERSION "5.42.0")
39
    set(QT_MIN_VERSION "5.10.0")
40
    set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
41
    set(KF5_OPTIONAL_COMPONENTS DocTools)
42
    if(UNIX)
Nicolas Fella's avatar
Nicolas Fella committed
43
        set(KF5_OPTIONAL_COMPONENTS ${KF5_OPTIONAL_COMPONENTS} Runner)
44
    endif()
45 46
    set(QCA_MIN_VERSION "2.1.0")
    find_package(Qca-qt5 ${QCA_MIN_VERSION} REQUIRED)
Weixuan Xiao's avatar
Weixuan Xiao committed
47
    if(NOT WIN32 AND NOT APPLE)
Piyush Aggarwal's avatar
Piyush Aggarwal committed
48 49
        find_package(KF5PulseAudioQt REQUIRED)
    endif()
50
    add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS -DQT_NO_CAST_FROM_ASCII)
51
endif()
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
52

53
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Quick Network)
54 55 56 57
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()
58

Matthijs Tijink's avatar
Matthijs Tijink committed
59 60 61 62
if (NOT ZSH_AUTOCOMPLETE_DIR)
set(ZSH_AUTOCOMPLETE_DIR "${CMAKE_INSTALL_PREFIX}/share/zsh/site-functions")
endif()

63
find_package(Qt5Multimedia)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
64

65 66 67 68 69 70 71
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
)

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
72
add_subdirectory(core)
73 74 75 76 77 78
if(NOT SAILFISHOS)
    add_subdirectory(kcm)
    add_subdirectory(kcmplugin)
    add_subdirectory(daemon)
endif()

79 80 81
if(NOT WIN32 AND NOT SAILFISHOS)
    add_subdirectory(kio)
    add_subdirectory(plasmoid)
82
endif()
83

84
add_subdirectory(icon)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
85
add_subdirectory(interfaces)
Nicolas Fella's avatar
Nicolas Fella committed
86
add_subdirectory(data)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
87

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
88 89
option(EXPERIMENTALAPP_ENABLED OFF)
if(EXPERIMENTALAPP_ENABLED)
90 91
  find_package(KF5Kirigami2)
  add_subdirectory(app)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
92
endif()
93
add_subdirectory(plugins)
94
add_subdirectory(cli)
95
add_subdirectory(declarativeplugin)
96

97 98 99 100
if(KF5Runner_FOUND)
    add_subdirectory(runners)
endif()

101 102 103 104
if (NOT SAILFISHOS)
    add_subdirectory(indicator)
    add_subdirectory(urlhandler)
    add_subdirectory(nautilus-extension)
105
    add_subdirectory(fileitemactionplugin)
106 107 108
else()
    add_subdirectory(sfos)
endif()
109 110 111

option(SMSAPP_ENABLED OFF)
if(SMSAPP_ENABLED)
112
    find_package(KF5Kirigami2)
113
    find_package(KF5People REQUIRED)
114 115 116 117 118 119 120
    find_package(KF5PeopleVCard)
    set_package_properties(KF5PeopleVCard PROPERTIES
        PURPOSE "Read vcards from the file system"
        URL "https://phabricator.kde.org/source/kpeoplevcard/"
        TYPE RUNTIME
    )

121 122
    add_subdirectory(smsapp)
endif()
123

124 125 126
if(KF5DocTools_FOUND)
    add_subdirectory(doc)
endif()
David Edmundson's avatar
David Edmundson committed
127

128
if(BUILD_TESTING AND NOT SAILFISHOS)
Andreas Sturmlechner's avatar
Andreas Sturmlechner committed
129 130
    add_subdirectory(tests)
endif()
131 132

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)