From 7573b0647a78baa3346b6a1a964ece01ed49a86c Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Sat, 10 Sep 2022 12:31:13 -0400 Subject: Add applaunchd gRPC API wrapper Changes: - Add applaunchd gRPC API wrapper in applauncher directory, clients can include AppLauncherClient.h to use it. - To facilitate generating protobuf and gRPC code with protoc, switch from CMake to meson for building. While the code generation can be done in CMake, it is a lot more straightforward with meson, and if use of this library continues meson will be easier to maintain. Known issues: - The behavior of the client implementation here with respect to the server side (i.e. applaunchd) going away is currently robust, but could stand improvement with some further investigation. As the code stands, starting applications works when applaunchd becomes available again, but the streaming status RPC that is tied to window activation in the homescreen does not reconnect, and there seem to be some things that need to be resolved with respect to Qt object connection expiry to do so. If the Qt demos continue to be used in a significant fashion, this may be worth picking up. Bug-AGL: SPEC-4559 Signed-off-by: Scott Murray Change-Id: I5cb480d4ce4d1cb944ebfd4114fb305f09f28ea3 (cherry picked from commit 560d902f4d2bf4ba3bb2edba6436080ee7d5a5ac) --- CMakeLists.txt | 49 ----------- applauncher/AppLauncherClient.cpp | 41 ++++++++++ applauncher/AppLauncherClient.h | 36 ++++++++ applauncher/AppLauncherGrpcClient.cpp | 113 ++++++++++++++++++++++++++ applauncher/AppLauncherGrpcClient.h | 55 +++++++++++++ applauncher/meson.build | 56 +++++++++++++ applauncher/protos/applauncher.proto | 50 ++++++++++++ bluetooth/CMakeLists.txt | 19 ----- bluetooth/qtappfw-bt.pc.in | 12 --- hvac/CMakeLists.txt | 19 ----- hvac/qtappfw-hvac.pc.in | 12 --- map/CMakeLists.txt | 19 ----- map/qtappfw-bt-map.pc.in | 12 --- mediaplayer/CMakeLists.txt | 24 ------ mediaplayer/MpdEventHandler.h | 1 + mediaplayer/qtappfw-mediaplayer.pc.in | 12 --- navigation/CMakeLists.txt | 19 ----- navigation/qtappfw-navigation.pc.in | 12 --- network/CMakeLists.txt | 26 ------ network/qtappfw-network.pc.in | 12 --- pbap/CMakeLists.txt | 19 ----- pbap/qtappfw-bt-pbap.pc.in | 12 --- radio/CMakeLists.txt | 19 ----- radio/qtappfw-radio.pc.in | 12 --- telephony/CMakeLists.txt | 20 ----- telephony/qtappfw-phone.pc.in | 12 --- vehicle-signals/CMakeLists.txt | 19 ----- vehicle-signals/qtappfw-vehicle-signals.pc.in | 12 --- weather/CMakeLists.txt | 19 ----- weather/qtappfw-weather.pc.in | 12 --- 30 files changed, 352 insertions(+), 403 deletions(-) delete mode 100644 CMakeLists.txt create mode 100644 applauncher/AppLauncherClient.cpp create mode 100644 applauncher/AppLauncherClient.h create mode 100644 applauncher/AppLauncherGrpcClient.cpp create mode 100644 applauncher/AppLauncherGrpcClient.h create mode 100644 applauncher/meson.build create mode 100644 applauncher/protos/applauncher.proto delete mode 100644 bluetooth/CMakeLists.txt delete mode 100644 bluetooth/qtappfw-bt.pc.in delete mode 100644 hvac/CMakeLists.txt delete mode 100644 hvac/qtappfw-hvac.pc.in delete mode 100644 map/CMakeLists.txt delete mode 100644 map/qtappfw-bt-map.pc.in delete mode 100644 mediaplayer/CMakeLists.txt delete mode 100644 mediaplayer/qtappfw-mediaplayer.pc.in delete mode 100644 navigation/CMakeLists.txt delete mode 100644 navigation/qtappfw-navigation.pc.in delete mode 100644 network/CMakeLists.txt delete mode 100644 network/qtappfw-network.pc.in delete mode 100644 pbap/CMakeLists.txt delete mode 100644 pbap/qtappfw-bt-pbap.pc.in delete mode 100644 radio/CMakeLists.txt delete mode 100644 radio/qtappfw-radio.pc.in delete mode 100644 telephony/CMakeLists.txt delete mode 100644 telephony/qtappfw-phone.pc.in delete mode 100644 vehicle-signals/CMakeLists.txt delete mode 100644 vehicle-signals/qtappfw-vehicle-signals.pc.in delete mode 100644 weather/CMakeLists.txt delete mode 100644 weather/qtappfw-weather.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index a4def83..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -cmake_minimum_required(VERSION 3.7.2) -project(qtappfw VERSION 1.0.0 LANGUAGES CXX) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) - -set(OE_QMAKE_PATH_EXTERNAL_HOST_BINS $ENV{OE_QMAKE_PATH_HOST_BINS}) - -find_package(Qt5Qml REQUIRED) -find_package(Qt5WebSockets REQUIRED) - -find_package(PkgConfig REQUIRED) -pkg_check_modules(glib REQUIRED IMPORTED_TARGET glib-2.0) -pkg_check_modules(bluez_glib REQUIRED IMPORTED_TARGET bluez-glib) -pkg_check_modules(connman_glib REQUIRED IMPORTED_TARGET connman-glib) -pkg_check_modules(libmpdclient REQUIRED IMPORTED_TARGET libmpdclient) - -include(GNUInstallDirs) - -set(DEST_DIR "${CMAKE_INSTALL_PREFIX}") -set(PRIVATE_LIBS "${PRIVATE_LIBS} -lqtappfw-bt - -lqtappfw-hvac - -lqtappfw-mediaplayer - -lqtappfw-map - -lqtappfw-navigation - -lqtappfw-network - -lqtappfw-pbap - -lqtappfw-radio - -lqtappfw-telephony - -lqtappfw-vehicle-signals - -lqtappfw-weather") - -set (SUBDIRS - docs - bluetooth - hvac - map - mediaplayer - navigation - network - pbap - radio - telephony - vehicle-signals - weather) - -foreach(subdir ${SUBDIRS}) - add_subdirectory(${subdir}) -endforeach() diff --git a/applauncher/AppLauncherClient.cpp b/applauncher/AppLauncherClient.cpp new file mode 100644 index 0000000..bbbcef3 --- /dev/null +++ b/applauncher/AppLauncherClient.cpp @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright (C) 2022 Konsulko Group + */ + +#include + +#include "AppLauncherClient.h" +#include "AppLauncherGrpcClient.h" + +AppLauncherClient::AppLauncherClient(QObject *parent) : QObject(parent) +{ + m_launcher = new AppLauncherGrpcClient(this); +} + +AppLauncherClient::~AppLauncherClient() +{ + delete m_launcher; +} + +bool AppLauncherClient::startApplication(const QString &id) +{ + if (m_launcher) + return m_launcher->StartApplication(id); + + return false; +} + +bool AppLauncherClient::listApplications(QList> &list) +{ + if (!m_launcher) { + return false; + } + + return m_launcher->ListApplications(list); +} + +void AppLauncherClient::sendStatusEvent(const QString &id, const QString &status) +{ + emit appStatusEvent(id, status); +} diff --git a/applauncher/AppLauncherClient.h b/applauncher/AppLauncherClient.h new file mode 100644 index 0000000..91723ab --- /dev/null +++ b/applauncher/AppLauncherClient.h @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright (C) 2022 Konsulko Group + */ + +#ifndef APPLAUNCHER_CLIENT_H +#define APPLAUNCHER_CLIENT_H + +#include +#include +#include + +class AppLauncherGrpcClient; + +class AppLauncherClient : public QObject +{ + Q_OBJECT + +public: + explicit AppLauncherClient(QObject *parent = Q_NULLPTR); + virtual ~AppLauncherClient(); + + Q_INVOKABLE bool startApplication(const QString &id); + Q_INVOKABLE bool listApplications(QList> &list); + +public slots: + void sendStatusEvent(const QString &id, const QString &status); + +signals: + void appStatusEvent(const QString &id, const QString &status); + +private: + AppLauncherGrpcClient *m_launcher; +}; + +#endif // APPLAUNCHER_CLIENT_H diff --git a/applauncher/AppLauncherGrpcClient.cpp b/applauncher/AppLauncherGrpcClient.cpp new file mode 100644 index 0000000..a25b148 --- /dev/null +++ b/applauncher/AppLauncherGrpcClient.cpp @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright (C) 2022 Konsulko Group + */ + +#include +#include "AppLauncherGrpcClient.h" +#include "AppLauncherClient.h" + +using grpc::Channel; +using grpc::ClientContext; +using grpc::ClientReader; +using grpc::Status; + +using automotivegradelinux::AppLauncher; +using automotivegradelinux::StartRequest; +using automotivegradelinux::StartResponse; +using automotivegradelinux::ListRequest; +using automotivegradelinux::ListResponse; +using automotivegradelinux::AppInfo; +using automotivegradelinux::StatusRequest; +using automotivegradelinux::StatusResponse; +using automotivegradelinux::AppStatus; + + +void AppStatusEventReader::GetStatusEvents() +{ + ClientContext context; + StatusRequest request; + StatusResponse response; + + std::unique_ptr > reader(stub_->GetStatusEvents(&context, request)); + while (reader->Read(&response)) { + if (response.has_app()) { + AppStatus app_status = response.app(); + emit statusUpdate(QString::fromStdString(app_status.id()), + QString::fromStdString(app_status.status())); + } + } + Status status = reader->Finish(); + if (!status.ok()) { + qWarning() << "GetStatusEvents RPC failed"; + } + + emit finished(); +} + +AppLauncherGrpcClient::AppLauncherGrpcClient(QObject *parent) : QObject(parent) +{ + stub_ = AppLauncher::NewStub(grpc::CreateChannel("localhost:50052", grpc::InsecureChannelCredentials())); + + // Create thread to read status events + AppStatusEventReader *reader = new AppStatusEventReader(stub_); + reader->moveToThread(&m_event_thread); + connect(&m_event_thread, &QThread::started, reader, &AppStatusEventReader::GetStatusEvents); + connect(reader, &AppStatusEventReader::finished, &m_event_thread, &QThread::quit); + // FIXME: Normally the thread finishing would be connected per the below + // to trigger cleaning up the object. That seems to trigger a crash + // for not entirely obvious reasons. It seems unrelated to the signal + // connection to AppLauncherClient, as not connecting does not prevent + // the crash; further investigation is required. + //connect(reader, &AppStatusEventReader::finished, reader, &AppStatusEventReader::deleteLater); + //connect(&m_event_thread, &QThread::finished, &m_event_thread, &QThread::deleteLater); + + // To avoid having an intermediary slot+signal in this class, try + // casting parent to AppLauncherClient and connect directly to its + // slot. Callers should set parent to ensure this works as required. + if (parent) { + AppLauncherClient *launcher = qobject_cast(parent); + if (launcher) + connect(reader, + &AppStatusEventReader::statusUpdate, + launcher, + &AppLauncherClient::sendStatusEvent); + } + + // Start status event handling + m_event_thread.start(); +} + +bool AppLauncherGrpcClient::StartApplication(const QString &id) +{ + StartRequest request; + request.set_id(id.toStdString()); + + ClientContext context; + StartResponse response; + Status status = stub_->StartApplication(&context, request, &response); + + return status.ok(); +} + +bool AppLauncherGrpcClient::ListApplications(QList> &list) +{ + ListRequest request; // empty + ClientContext context; + ListResponse response; + + Status status = stub_->ListApplications(&context, request, &response); + if (!status.ok()) + return false; + + for (int i = 0; i < response.apps_size(); i++) { + QMap appinfo_map; + AppInfo appinfo = response.apps(i); + appinfo_map["id"] = QString::fromStdString(appinfo.id()); + appinfo_map["name"] = QString::fromStdString(appinfo.name()); + appinfo_map["icon_path"] = QString::fromStdString(appinfo.icon_path()); + list.append(appinfo_map); + } + + return true; +} diff --git a/applauncher/AppLauncherGrpcClient.h b/applauncher/AppLauncherGrpcClient.h new file mode 100644 index 0000000..f9e1d0f --- /dev/null +++ b/applauncher/AppLauncherGrpcClient.h @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright (C) 2022 Konsulko Group + */ + +#ifndef APPLAUNCHER_GRPC_CLIENT_H +#define APPLAUNCHER_GRPC_CLIENT_H + +#include +#include +#include +#include +#include + +#include "applauncher.grpc.pb.h" + +using grpc::Channel; + +class AppStatusEventReader : public QObject +{ + Q_OBJECT +public: + AppStatusEventReader(std::shared_ptr &stub, + QObject *parent = Q_NULLPTR) : QObject(parent), stub_(stub) {} + +public slots: + void GetStatusEvents(); + +signals: + void statusUpdate(const QString &id, const QString &status); + void finished(); + +private: + std::shared_ptr stub_; +}; + +class AppLauncherGrpcClient : public QObject +{ + Q_OBJECT + +public: + AppLauncherGrpcClient(QObject *parent = Q_NULLPTR); + + bool StartApplication(const QString &id); + + bool ListApplications(QList> &list); + +private: + std::shared_ptr stub_; + + QThread m_event_thread; + +}; + +#endif // APPLAUNCHER_GRPC_CLIENT_H diff --git a/applauncher/meson.build b/applauncher/meson.build new file mode 100644 index 0000000..b36184a --- /dev/null +++ b/applauncher/meson.build @@ -0,0 +1,56 @@ +cpp = meson.get_compiler('cpp') +grpcpp_reflection_dep = cpp.find_library('grpc++_reflection') + +qt5_dep = dependency('qt5', modules: ['Qml']) +applauncher_dep = [ + qt5_dep, + dependency('protobuf'), + dependency('grpc'), + dependency('grpc++'), + grpcpp_reflection_dep, +] + +protoc = find_program('protoc') +grpc_cpp = find_program('grpc_cpp_plugin') + +protoc_gen = generator(protoc, \ + output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'], + arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/protos', + '--cpp_out=@BUILD_DIR@', + '@INPUT@']) +generated_protoc_sources = protoc_gen.process('protos/applauncher.proto') + +grpc_gen = generator(protoc, \ + output : ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'], + arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/protos', + '--grpc_out=@BUILD_DIR@', + '--plugin=protoc-gen-grpc=' + grpc_cpp.path(), + '@INPUT@']) +generated_grpc_sources = grpc_gen.process('protos/applauncher.proto') + +moc_files = qt5.compile_moc(headers : ['AppLauncherClient.h', 'AppLauncherGrpcClient.h'], + dependencies: qt5_dep) + +src = [ + 'AppLauncherClient.cpp', + 'AppLauncherGrpcClient.cpp', + generated_protoc_sources, + generated_grpc_sources, + moc_files +] +lib = shared_library('qtappfw-applauncher', + sources: src, + version: '1.0.0', + soversion: '0', + dependencies: applauncher_dep, + install: true) + +install_headers('AppLauncherClient.h') + +pkg_mod = import('pkgconfig') +pkg_mod.generate(libraries : lib, + version : '1.0', + name : 'libqtappfw-applauncher', + filebase : 'qtappfw-applauncher', + requires: 'Qt5Qml', + description : 'Library wrapping AGL AppLauncher API in Qt objects') diff --git a/applauncher/protos/applauncher.proto b/applauncher/protos/applauncher.proto new file mode 100644 index 0000000..0b8e0fc --- /dev/null +++ b/applauncher/protos/applauncher.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package automotivegradelinux; + +service AppLauncher { + rpc StartApplication(StartRequest) returns (StartResponse) {} + rpc ListApplications(ListRequest) returns (ListResponse) {} + rpc GetStatusEvents(StatusRequest) returns (stream StatusResponse) {} +} + +message StartRequest { + string id = 1; +} + +message StartResponse { + bool status = 1; + string message = 2; +} + +message ListRequest { +} + +message ListResponse { + repeated AppInfo apps = 1; +} + +message AppInfo { + string id = 1; + string name = 2; + string icon_path = 3; +} + +message StatusRequest { +} + +message AppStatus { + string id = 1; + string status = 2; +} + +// Future-proofing for e.g. potentially signaling a list refresh +message LauncherStatus { +} + +message StatusResponse { + oneof status { + AppStatus app = 1; + LauncherStatus launcher = 2; + } +} diff --git a/bluetooth/CMakeLists.txt b/bluetooth/CMakeLists.txt deleted file mode 100644 index 3137e3c..0000000 --- a/bluetooth/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -CONFIGURE_FILE("qtappfw-bt.pc.in" "qtappfw-bt.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-bt.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-bt SHARED bluetooth.cpp bluetoothmodel.cpp bluetootheventhandler.cpp) - -target_include_directories(qtappfw-bt PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-bt PRIVATE "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-bt Qt5::Qml PkgConfig::glib PkgConfig::bluez_glib) -set_target_properties(qtappfw-bt PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER "bluetooth.h") - -install(TARGETS qtappfw-bt - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-bt) diff --git a/bluetooth/qtappfw-bt.pc.in b/bluetooth/qtappfw-bt.pc.in deleted file mode 100644 index d32e8ac..0000000 --- a/bluetooth/qtappfw-bt.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-bt -Description: Library wrapping AGL AppFW bluetooth data in Qt objects -Version: 1.0.0 - -Requires: Qt5Qml -Libs: -L${libdir} -lqtappfw-bt -Cflags: -I${includedir}/qtappfw-bt diff --git a/hvac/CMakeLists.txt b/hvac/CMakeLists.txt deleted file mode 100644 index ba62be7..0000000 --- a/hvac/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -CONFIGURE_FILE("qtappfw-hvac.pc.in" "qtappfw-hvac.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-hvac.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-hvac SHARED hvac.cpp) - -target_include_directories(qtappfw-hvac PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-hvac PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-hvac Qt5::Core qtappfw-vehicle-signals) -set_target_properties(qtappfw-hvac PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER hvac.h) - -install(TARGETS qtappfw-hvac - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-hvac) diff --git a/hvac/qtappfw-hvac.pc.in b/hvac/qtappfw-hvac.pc.in deleted file mode 100644 index 60ce631..0000000 --- a/hvac/qtappfw-hvac.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-hvac -Description: Library wrapping AGL AppFW hvac data in Qt objects -Version: 1.0.0 - -Requires: Qt5Qml -Libs: -L${libdir} -lqtappfw-hvac -Cflags: -I${includedir}/qtappfw-hvac diff --git a/map/CMakeLists.txt b/map/CMakeLists.txt deleted file mode 100644 index 0a94e28..0000000 --- a/map/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -CONFIGURE_FILE("qtappfw-bt-map.pc.in" "qtappfw-bt-map.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-bt-map.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-bt-map SHARED map.cpp) - -target_include_directories(qtappfw-bt-map PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-bt-map PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-bt-map Qt5::Qml) -set_target_properties(qtappfw-bt-map PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER map.h) - -install(TARGETS qtappfw-bt-map - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-bt-map) diff --git a/map/qtappfw-bt-map.pc.in b/map/qtappfw-bt-map.pc.in deleted file mode 100644 index d5e5dac..0000000 --- a/map/qtappfw-bt-map.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-bt-map -Description: Library wrapping AGL AppFW bluetooth messaging data in Qt objects -Version: 1.0.0 - -Requires: Qt5Qml -Libs: -L${libdir} -lqtappfw-bt-map -Cflags: -I${includedir}/qtappfw-bt-map diff --git a/mediaplayer/CMakeLists.txt b/mediaplayer/CMakeLists.txt deleted file mode 100644 index 35dda69..0000000 --- a/mediaplayer/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ - -CONFIGURE_FILE("qtappfw-mediaplayer.pc.in" "qtappfw-mediaplayer.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-mediaplayer.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-mediaplayer SHARED - mediaplayer.cpp - MediaplayerBackend.cpp - MediaplayerMpdBackend.cpp - MediaplayerBluezBackend.cpp - MpdEventHandler.cpp) - -target_include_directories(qtappfw-mediaplayer PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-mediaplayer PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-mediaplayer qtappfw-bt Qt5::Qml PkgConfig::libmpdclient) -set_target_properties(qtappfw-mediaplayer PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER mediaplayer.h) - -install(TARGETS qtappfw-mediaplayer - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-mediaplayer) diff --git a/mediaplayer/MpdEventHandler.h b/mediaplayer/MpdEventHandler.h index d51c373..3ce888e 100644 --- a/mediaplayer/MpdEventHandler.h +++ b/mediaplayer/MpdEventHandler.h @@ -18,6 +18,7 @@ #define MPD_EVENT_HANDLER_H #include +#include #include // Use a 60s timeout on our MPD connection diff --git a/mediaplayer/qtappfw-mediaplayer.pc.in b/mediaplayer/qtappfw-mediaplayer.pc.in deleted file mode 100644 index 933e9dc..0000000 --- a/mediaplayer/qtappfw-mediaplayer.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-mediaplayer -Description: Library wrapping AGL AppFW mediaplayer data in Qt objects -Version: 1.0.0 - -Requires: Qt5Qml -Libs: -L${libdir} -lqtappfw-mediaplayer -Cflags: -I${includedir}/qtappfw-mediaplayer diff --git a/navigation/CMakeLists.txt b/navigation/CMakeLists.txt deleted file mode 100644 index 9e0ee84..0000000 --- a/navigation/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -CONFIGURE_FILE("qtappfw-navigation.pc.in" "qtappfw-navigation.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-navigation.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-navigation SHARED navigation.cpp) - -target_include_directories(qtappfw-navigation PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-navigation PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-navigation Qt5::Qml qtappfw-vehicle-signals) -set_target_properties(qtappfw-navigation PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER navigation.h) - -install(TARGETS qtappfw-navigation - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-navigation) diff --git a/navigation/qtappfw-navigation.pc.in b/navigation/qtappfw-navigation.pc.in deleted file mode 100644 index 8f1fa2c..0000000 --- a/navigation/qtappfw-navigation.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-navigation -Description: Library wrapping AGL AppFW navigation data in Qt objects -Version: 1.0.0 - -Requires: Qt5Qml -Libs: -L${libdir} -lqtappfw-navigation -Cflags: -I${includedir}/qtappfw-navigation diff --git a/network/CMakeLists.txt b/network/CMakeLists.txt deleted file mode 100644 index 6627a68..0000000 --- a/network/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ - -CONFIGURE_FILE("qtappfw-network.pc.in" "qtappfw-network.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-network.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-network SHARED network.cpp - networkeventhandler.cpp - wifiadapter.cpp - wiredadapter.cpp - wifinetworkmodel.cpp - wirednetworkmodel.cpp - abstractnetworkmodel.cpp - connectionprofile.cpp) - -target_include_directories(qtappfw-network PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-network PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-network Qt5::Qml PkgConfig::glib PkgConfig::connman_glib) -set_target_properties(qtappfw-network PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER "network.h;networkadapter.h;wifiadapter.h;wiredadapter.h") - -install(TARGETS qtappfw-network - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-network) diff --git a/network/qtappfw-network.pc.in b/network/qtappfw-network.pc.in deleted file mode 100644 index 50b34a0..0000000 --- a/network/qtappfw-network.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-network -Description: Library wrapping AGL AppFW network data in Qt objects -Version: 1.0.0 - -Requires: Qt5Qml -Libs: -L${libdir} -lqtappfw-network -Cflags: -I${includedir}/qtappfw-network diff --git a/pbap/CMakeLists.txt b/pbap/CMakeLists.txt deleted file mode 100644 index 480661a..0000000 --- a/pbap/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -CONFIGURE_FILE("qtappfw-bt-pbap.pc.in" "qtappfw-bt-pbap.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-bt-pbap.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-bt-pbap SHARED pbap.cpp) - -target_include_directories(qtappfw-bt-pbap PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-bt-pbap PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-bt-pbap Qt5::Qml) -set_target_properties(qtappfw-bt-pbap PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER pbap.h) - -install(TARGETS qtappfw-bt-pbap - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-bt-pbap) diff --git a/pbap/qtappfw-bt-pbap.pc.in b/pbap/qtappfw-bt-pbap.pc.in deleted file mode 100644 index 2da9c53..0000000 --- a/pbap/qtappfw-bt-pbap.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-bt-pbap -Description: Library wrapping AGL AppFW bluetooth pbap data in Qt objects -Version: 1.0.0 - -Requires: Qt5Qml -Libs: -L${libdir} -lqtappfw-bt-pbap -Cflags: -I${includedir}/qtappfw-bt-pbap diff --git a/radio/CMakeLists.txt b/radio/CMakeLists.txt deleted file mode 100644 index 24666fb..0000000 --- a/radio/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -CONFIGURE_FILE("qtappfw-radio.pc.in" "qtappfw-radio.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-radio.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-radio SHARED radio.cpp) - -target_include_directories(qtappfw-radio PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-radio PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-radio Qt5::Qml) -set_target_properties(qtappfw-radio PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER radio.h) - -install(TARGETS qtappfw-radio - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-radio) diff --git a/radio/qtappfw-radio.pc.in b/radio/qtappfw-radio.pc.in deleted file mode 100644 index 8f42e39..0000000 --- a/radio/qtappfw-radio.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-radio -Description: Library wrapping AGL AppFW radio data in Qt objects -Version: 1.0.0 - -Requires: Qt5Qml -Libs: -L${libdir} -lqtappfw-radio -Cflags: -I${includedir}/qtappfw-radio diff --git a/telephony/CMakeLists.txt b/telephony/CMakeLists.txt deleted file mode 100644 index 5bd81bc..0000000 --- a/telephony/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ - -CONFIGURE_FILE("qtappfw-phone.pc.in" "qtappfw-phone.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-phone.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-phone SHARED telephony.cpp) - -target_include_directories(qtappfw-phone PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-phone PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-phone Qt5::Qml) -set_target_properties(qtappfw-phone PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER telephony.h) - -install(TARGETS qtappfw-phone - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-phone) - diff --git a/telephony/qtappfw-phone.pc.in b/telephony/qtappfw-phone.pc.in deleted file mode 100644 index 949542f..0000000 --- a/telephony/qtappfw-phone.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-phone -Description: Library wrapping AGL AppFW phone data in Qt objects -Version: 1.0.0 - -Requires: Qt5Qml -Libs: -L${libdir} -lqtappfw-phone -Cflags: -I${includedir}/qtappfw-phone diff --git a/vehicle-signals/CMakeLists.txt b/vehicle-signals/CMakeLists.txt deleted file mode 100644 index f7cbf71..0000000 --- a/vehicle-signals/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -CONFIGURE_FILE("qtappfw-vehicle-signals.pc.in" "qtappfw-vehicle-signals.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-vehicle-signals.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-vehicle-signals SHARED vehiclesignals.cpp) - -target_include_directories(qtappfw-vehicle-signals PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-vehicle-signals PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-vehicle-signals Qt5::Core Qt5::WebSockets) -set_target_properties(qtappfw-vehicle-signals PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER vehiclesignals.h) - -install(TARGETS qtappfw-vehicle-signals - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-vehicle-signals) diff --git a/vehicle-signals/qtappfw-vehicle-signals.pc.in b/vehicle-signals/qtappfw-vehicle-signals.pc.in deleted file mode 100644 index 5afac39..0000000 --- a/vehicle-signals/qtappfw-vehicle-signals.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-vehicle-signals -Description: Library providing VIS vehicle signal updates for Qt objects -Version: 1.0.0 - -Requires: Qt5Core Qt5WebSockets -Libs: -L${libdir} -lqtappfw-vehicle-signals -Cflags: -I${includedir}/qtappfw-vehicle-signals diff --git a/weather/CMakeLists.txt b/weather/CMakeLists.txt deleted file mode 100644 index b622262..0000000 --- a/weather/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -CONFIGURE_FILE("qtappfw-weather.pc.in" "qtappfw-weather.pc" @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtappfw-weather.pc - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) - -add_library(qtappfw-weather SHARED weather.cpp) - -target_include_directories(qtappfw-weather PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(qtappfw-weather PUBLIC "${CMAKE_INSTALL_INCLUDEDIR}") - -target_link_libraries(qtappfw-weather Qt5::Qml) -set_target_properties(qtappfw-weather PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1 - PUBLIC_HEADER weather.h) - -install(TARGETS qtappfw-weather - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtappfw-weather) diff --git a/weather/qtappfw-weather.pc.in b/weather/qtappfw-weather.pc.in deleted file mode 100644 index 1e3e5e1..0000000 --- a/weather/qtappfw-weather.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@DEST_DIR@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: qtappfw-weather -Description: Library wrapping AGL AppFW weather data in Qt objects -Version: 1.0.0 - -Requires: Qt5Qml -Libs: -L${libdir} -lqtappfw-weather -Cflags: -I${includedir}/qtappfw-weather -- cgit 1.2.3-korg