kdeconnect-kde/CMakeLists.txt
Adam Pigg 9a8f1b48a0 Build kdeconnect on sailfish and port some simple plugins
Summary:
Below is a lost of the commits, but, in summary
Port the build system for Sailfish, which means selectively building only the bits we need/can, and only against the KF5 libs that are available.
Allow to build on Qt 5.6
Switch from knotification to nemo notification (not complete!)
Add a very simple example sailfish app.

Note, there is still much missing functionality.  Notifications dont work, pairing sort of works but not really, but when it is paired you can send a ping to the desktop client

Dont build kio for Sailfish

Port core build system

Port daemon buld system

Require CoreAddons on Sailfish

Port plugins build for sailfish and include the ping plugin for now

Final build changes for sailfish.

Disable tests and other not needed parts

Add includes for QCA

Fix build errors on sailfish

Get core/ to build on sailfish

Get interfaces/ to build on sailfish

Build daemon on sailfish

On sailfish, dont install the kcm file

Start port plugin to sailfish

Fixup installed files

Add sfos app

Hack declarative plugin to give a public interface

Build sfos app

Compile declarativeplugin into the sfos app for now

Redefine qAsConst for qt 5.6

Packaging fixes

Use official icon

Package .desktop

Reviewers: #kde_connect, apol, nicolasfella, albertvaka

Reviewed By: #kde_connect, apol, nicolasfella, albertvaka

Subscribers: kdeconnect, andyholmes, albertvaka, kossebau, mtijink, vonreth, apol, #kde_connect, nicolasfella

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D10703
2018-08-02 20:10:59 +01:00

115 lines
3.2 KiB
CMake

cmake_minimum_required(VERSION 3.0)
project(kdeconnect)
set(KDECONNECT_VERSION_MAJOR 1)
set(KDECONNECT_VERSION_MINOR 3)
set(KDECONNECT_VERSION_PATCH 0)
set(KDECONNECT_VERSION "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}.${KDECONNECT_VERSION_PATCH}")
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()
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Quick Network)
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()
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"
)
include_directories(${CMAKE_SOURCE_DIR})
configure_file(kdeconnect-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMAddTests)
include(ECMSetupVersion)
include(ECMInstallIcons)
include(FeatureSummary)
include(KDEConnectMacros.cmake)
include(GenerateExportHeader)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(core)
if(NOT SAILFISHOS)
add_subdirectory(kcm)
add_subdirectory(kcmplugin)
add_subdirectory(daemon)
endif()
if(NOT WIN32)
if (NOT SAILFISHOS)
add_subdirectory(kio)
endif()
add_subdirectory(plasmoid)
endif()
add_subdirectory(icon)
add_subdirectory(interfaces)
option(EXPERIMENTALAPP_ENABLED OFF)
if(EXPERIMENTALAPP_ENABLED)
add_subdirectory(app)
endif()
add_subdirectory(plugins)
add_subdirectory(cli)
if (NOT SAILFISHOS)
add_subdirectory(indicator)
add_subdirectory(urlhandler)
add_subdirectory(nautilus-extension)
else()
add_subdirectory(sfos)
endif()
option(SMSAPP_ENABLED OFF)
if(SMSAPP_ENABLED)
find_package(KF5People REQUIRED)
add_subdirectory(smsapp)
endif()
if(KF5DocTools_FOUND)
add_subdirectory(doc)
endif()
if(BUILD_TESTING AND NOT SAILFISHOS)
add_subdirectory(tests)
endif()
if(NOT SAILFISHOS)
install(FILES org.kde.kdeconnect.kcm.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
endif()
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)