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.2 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 7
set(KDECONNECT_VERSION_MINOR 3)
set(KDECONNECT_VERSION_PATCH 0)
8 9
set(KDECONNECT_VERSION "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}.${KDECONNECT_VERSION_PATCH}")

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
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")
    set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils)
    set(KF5_OPTIONAL_COMPONENTS DocTools PulseAudioQt)
    set(QCA_MIN_VERSION "2.1.0")
    find_package(Qca-qt5 ${QCA_MIN_VERSION} REQUIRED)
    add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS)
endif()
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
32

33
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
34
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
35

36
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Quick Network)
37 38 39 40
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()
41

42 43 44 45 46 47
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
48

Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
49 50
include_directories(${CMAKE_SOURCE_DIR})

51 52
configure_file(kdeconnect-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h)

53
include(KDEInstallDirs)
54
include(KDECompilerSettings NO_POLICY_SCOPE)
55 56 57 58 59
include(KDECMakeSettings)
include(ECMAddTests)
include(ECMSetupVersion)
include(ECMInstallIcons)
include(FeatureSummary)
60

61 62
include(KDEConnectMacros.cmake)

63
include(GenerateExportHeader)
64
include_directories(${CMAKE_CURRENT_BINARY_DIR})
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
65

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
66
add_subdirectory(core)
67 68 69 70 71 72
if(NOT SAILFISHOS)
    add_subdirectory(kcm)
    add_subdirectory(kcmplugin)
    add_subdirectory(daemon)
endif()

73
if(NOT WIN32)
74 75 76
    if (NOT SAILFISHOS)
        add_subdirectory(kio)
    endif()
77
	add_subdirectory(plasmoid)
78
endif()
79

80
add_subdirectory(icon)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
81 82
add_subdirectory(interfaces)

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
83 84 85 86
option(EXPERIMENTALAPP_ENABLED OFF)
if(EXPERIMENTALAPP_ENABLED)
    add_subdirectory(app)
endif()
87
add_subdirectory(plugins)
88
add_subdirectory(cli)
89 90 91 92 93 94 95 96

if (NOT SAILFISHOS)
    add_subdirectory(indicator)
    add_subdirectory(urlhandler)
    add_subdirectory(nautilus-extension)
else()
    add_subdirectory(sfos)
endif()
97 98 99 100 101 102

option(SMSAPP_ENABLED OFF)
if(SMSAPP_ENABLED)
    find_package(KF5People REQUIRED)
    add_subdirectory(smsapp)
endif()
103

104 105 106
if(KF5DocTools_FOUND)
    add_subdirectory(doc)
endif()
David Edmundson's avatar
David Edmundson committed
107

108
if(BUILD_TESTING AND NOT SAILFISHOS)
Andreas Sturmlechner's avatar
Andreas Sturmlechner committed
109 110
    add_subdirectory(tests)
endif()
111

112 113 114
if(NOT SAILFISHOS)
    install(FILES org.kde.kdeconnect.kcm.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
endif()
115
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)