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.95 KB
Newer Older
1 2
cmake_minimum_required(VERSION 3.0)

3
project(kdeconnect)
4

5
set(KDECONNECT_VERSION_MAJOR 1)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
6
set(KDECONNECT_VERSION_MINOR 3)
7
set(KDECONNECT_VERSION_PATCH 3)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
8

9 10
set(KDECONNECT_VERSION "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}.${KDECONNECT_VERSION_PATCH}")

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
find_package(PkgConfig)

if (SAILFISHOS)
    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")
    set(QT_MIN_VERSION "5.7.0")
27
    set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
28
    set(KF5_OPTIONAL_COMPONENTS DocTools)
29
    if(UNIX)
Nicolas Fella's avatar
Nicolas Fella committed
30
        set(KF5_OPTIONAL_COMPONENTS ${KF5_OPTIONAL_COMPONENTS} Runner)
31
    endif()
32 33
    set(QCA_MIN_VERSION "2.1.0")
    find_package(Qca-qt5 ${QCA_MIN_VERSION} REQUIRED)
Nicolas Fella's avatar
Nicolas Fella committed
34
    find_package(KF5PulseAudioQt)
35 36
    add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS)
endif()
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
37

38
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
39
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
40

41
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Quick Network)
42 43 44 45
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()
46

Matthijs Tijink's avatar
Matthijs Tijink committed
47 48 49 50
if (NOT ZSH_AUTOCOMPLETE_DIR)
set(ZSH_AUTOCOMPLETE_DIR "${CMAKE_INSTALL_PREFIX}/share/zsh/site-functions")
endif()

51 52 53 54 55 56
find_package(Phonon4Qt5 4.9.0 NO_MODULE)
set_package_properties(Phonon4Qt5 PROPERTIES
   DESCRIPTION "Qt-based audio library"
   TYPE OPTIONAL
   PURPOSE "Required for Find My Device plugin"
)
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
57

58 59 60 61 62 63 64
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
)

Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
65 66
include_directories(${CMAKE_SOURCE_DIR})

67 68
configure_file(kdeconnect-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h)

69
include(KDEInstallDirs)
70
include(KDECompilerSettings NO_POLICY_SCOPE)
71 72 73 74 75
include(KDECMakeSettings)
include(ECMAddTests)
include(ECMSetupVersion)
include(ECMInstallIcons)
include(FeatureSummary)
76

77 78
include(KDEConnectMacros.cmake)

79
include(GenerateExportHeader)
80
include_directories(${CMAKE_CURRENT_BINARY_DIR})
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
81

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
82
add_subdirectory(core)
83 84 85 86 87 88
if(NOT SAILFISHOS)
    add_subdirectory(kcm)
    add_subdirectory(kcmplugin)
    add_subdirectory(daemon)
endif()

89 90 91
if(NOT WIN32 AND NOT SAILFISHOS)
    add_subdirectory(kio)
    add_subdirectory(plasmoid)
92
endif()
93

94
add_subdirectory(icon)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
95
add_subdirectory(interfaces)
Nicolas Fella's avatar
Nicolas Fella committed
96
add_subdirectory(data)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
97

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
98 99
option(EXPERIMENTALAPP_ENABLED OFF)
if(EXPERIMENTALAPP_ENABLED)
100 101
  find_package(KF5Kirigami2)
  add_subdirectory(app)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
102
endif()
103
add_subdirectory(plugins)
104
add_subdirectory(cli)
105
add_subdirectory(declarativeplugin)
106

107 108 109 110
if(KF5Runner_FOUND)
    add_subdirectory(runners)
endif()

111 112 113 114 115 116 117
if (NOT SAILFISHOS)
    add_subdirectory(indicator)
    add_subdirectory(urlhandler)
    add_subdirectory(nautilus-extension)
else()
    add_subdirectory(sfos)
endif()
118 119 120

option(SMSAPP_ENABLED OFF)
if(SMSAPP_ENABLED)
121
    find_package(KF5Kirigami2)
122
    find_package(KF5People REQUIRED)
123 124 125 126 127 128 129
    find_package(KF5PeopleVCard)
    set_package_properties(KF5PeopleVCard PROPERTIES
        PURPOSE "Read vcards from the file system"
        URL "https://phabricator.kde.org/source/kpeoplevcard/"
        TYPE RUNTIME
    )

130 131
    add_subdirectory(smsapp)
endif()
132

133 134 135
if(KF5DocTools_FOUND)
    add_subdirectory(doc)
endif()
David Edmundson's avatar
David Edmundson committed
136

137
if(BUILD_TESTING AND NOT SAILFISHOS)
Andreas Sturmlechner's avatar
Andreas Sturmlechner committed
138 139
    add_subdirectory(tests)
endif()
140 141

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)