aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2021-09-08 17:00:35 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2021-09-08 17:16:28 +0100
commitd4629afe76c0df5b14fe085e0a479e4b0e8f14cd (patch)
treee8a9ebfcfa7fb076859fa3ad1ae2ab5ed5d2bf3f
parentfa3bd315abd8a710d7493e6ffb7b54c521632202 (diff)
WIP: Add flatpak-builder+CMake build systemsandbox/samthursfield/flatpak
The existing QMake build relies on `wgtpkg` from app-fw. As QMake is becoming obsolete[1], I implemented a separate build system in CMake. This branch is WIP as it modifies the config search directory to /app/etc directly, which would break the native app build. 1. https://www.qt.io/blog/2019/08/07/technical-vision-qt-6 Signed-off-by: Sam Thursfield <sam.thursfield@codethink.co.uk> Change-Id: I89bfba04265cfad2b0d641e8c1060e62a5e275fd
-rw-r--r--CMakeLists.txt14
-rw-r--r--app/CMakeLists.txt20
-rw-r--r--app/file_operation.h4
-rw-r--r--org.automotivelinux.apps.Navigation.yml32
-rw-r--r--package/CMakeLists.txt4
-rw-r--r--package/naviconfig.ini9
6 files changed, 81 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..3232050
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.7.0)
+
+project(ondemandnavi VERSION 1.0.0 LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+find_package(Qt5 COMPONENTS Core Quick Location Widgets REQUIRED)
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(QTAPPFW_NAVIGATION qtappfw-navigation REQUIRED)
+
+add_subdirectory(app)
+add_subdirectory(package)
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
new file mode 100644
index 0000000..61fc721
--- /dev/null
+++ b/app/CMakeLists.txt
@@ -0,0 +1,20 @@
+qt5_add_resources(RESOURCES navigation.qrc images/images.qrc)
+
+set(
+ SOURCES file_operation.cpp file_operation.h guidance_module.h main.cpp
+ markermodel.h
+)
+
+add_executable(navigation ${SOURCES} ${RESOURCES})
+
+target_compile_options(navigation
+ PUBLIC ${QTAPPFW_NAVIGATION_COMPILE_OPTIONS}
+)
+target_include_directories(navigation
+ PUBLIC ${QTAPPFW_NAVIGATION_INCLUDE_DIRS}
+)
+target_link_libraries(navigation
+ ${QTAPPFW_NAVIGATION_LIBRARIES} Qt5::Core Qt5::Qml Qt5::Quick Qt5::Location Qt5::Widgets
+)
+
+install(TARGETS navigation DESTINATION bin)
diff --git a/app/file_operation.h b/app/file_operation.h
index da753a8..8a8af79 100644
--- a/app/file_operation.h
+++ b/app/file_operation.h
@@ -9,9 +9,9 @@
/******************************************************
* Please set mapAccessToken, mapStyleUrl, speed,
* interval, latitude and longitude in JSON format
- * in /etc/naviconfig.ini
+ * in /app/etc/naviconfig.ini
******************************************************/
-#define NAVI_CONFIG_FILEPATH "/etc/naviconfig.ini"
+#define NAVI_CONFIG_FILEPATH "/app/etc/naviconfig.ini"
class File_Operation: public QObject{
diff --git a/org.automotivelinux.apps.Navigation.yml b/org.automotivelinux.apps.Navigation.yml
new file mode 100644
index 0000000..c273a4c
--- /dev/null
+++ b/org.automotivelinux.apps.Navigation.yml
@@ -0,0 +1,32 @@
+app-id: org.automotivelinux.apps.Navigation
+runtime: iot.poky_agl.BaseSdk
+runtime-version: "current"
+sdk: iot.poky_agl.BaseSdk
+command: navigation
+finish-args:
+ - --share=ipc
+ - --share=network
+ - --socket=wayland
+ - --device=dri
+
+modules:
+ - name: agl-service-navigation
+ buildsystem: cmake
+ builddir: true
+ config-opts:
+ - -DCMAKE_MODULE_PATH=/app/share/cmake-3.16/Modules
+ sources:
+ - type: git
+ url: https://git.automotivelinux.org/apps/agl-service-navigation/
+ branch: master
+
+ - name: ondemandnavi
+ buildsystem: cmake
+ config-opts:
+ # FIXME: We should remove the need for this Yocto-specific config.
+ - -DOE_QMAKE_PATH_EXTERNAL_HOST_BINS=/usr/bin
+ post-install:
+ - install -D -m644 ./package/naviconfig.ini /app/etc/naviconfig.ini
+ sources:
+ - type: dir
+ path: .
diff --git a/package/CMakeLists.txt b/package/CMakeLists.txt
new file mode 100644
index 0000000..9b2b69e
--- /dev/null
+++ b/package/CMakeLists.txt
@@ -0,0 +1,4 @@
+install(
+ FILES flite jtalk
+ DESTINATION bin
+)
diff --git a/package/naviconfig.ini b/package/naviconfig.ini
new file mode 100644
index 0000000..75bc590
--- /dev/null
+++ b/package/naviconfig.ini
@@ -0,0 +1,9 @@
+{
+ "mapAccessToken":"Please set mapbox access token",
+ "speed":60,
+ "interval":100,
+ "latitude":36.1363,
+ "longitude":-115.151,
+ "mapStyleUrls":"styles/v1/mapbox/streets-v11",
+ "enableOSM":true
+}