Commit 7a6db7da authored by Volker Krause's avatar Volker Krause
Browse files

Add build option to properly install the demo application

Needed for Flatpak/Android builds.
parent 6384e6a6
Pipeline #47172 canceled with stage
......@@ -10,6 +10,8 @@ set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(KOSMIndoorMap VERSION ${RELEASE_SERVICE_VERSION})
option(BUILD_STANDALONE_APP "Build and install the stand-alone test/demo app." OFF)
find_package(ECM 5.59 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
......@@ -33,7 +35,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KOSMINDOORMAP
SOVERSION 1
)
find_package(Qt5 5.14 REQUIRED COMPONENTS Quick)
find_package(Qt5 5.14 REQUIRED COMPONENTS Quick OPTIONAL_COMPONENTS Widgets)
find_package(KF5 REQUIRED COMPONENTS I18n)
find_package(KPublicTransport REQUIRED)
find_package(KOpeningHours)
......@@ -43,6 +45,19 @@ if (BUILD_TESTING)
find_package(Qt5 5.14 REQUIRED COMPONENTS Test Widgets)
endif()
if (BUILD_STANDALONE_APP)
if (NOT ANDROID)
find_package(Qt5 5.14 REQUIRED COMPONENTS Widgets)
else()
find_package(KF5 REQUIRED COMPONENTS Kirigami)
find_package(Qt5 5.14 REQUIRED COMPONENTS QuickControls2 Svg)
find_package(OpenSSL REQUIRED)
if (NOT DEFINED BREEZEICONS_DIR AND EXISTS ${CMAKE_SOURCE_DIR}/../breeze-icons)
set(BREEZEICONS_DIR ${CMAKE_SOURCE_DIR}/../breeze-icons)
endif()
endif()
endif()
find_package(ZLIB REQUIRED)
find_package(OsmTools)
set_package_properties(OsmTools PROPERTIES TYPE OPTIONAL PURPOSE "Needed only for regenereating line metadata tables (ie. you most likely don't need this)")
......
......@@ -8,6 +8,8 @@ add_subdirectory(map)
if (TARGET Qt5::Quick)
add_subdirectory(map-quick)
add_subdirectory(map-publictransport-integration)
endif()
if (TARGET Qt5::Widgets OR BUILD_STANDALONE_APP)
add_subdirectory(app)
endif()
if (NOT CROSS_COMPILING)
......
......@@ -10,22 +10,22 @@ target_include_directories(kosmindoormap-app PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(kosmindoormap-app PRIVATE
KOSMIndoorMap
Qt5::Quick
#Qt5::QuickControls2
)
if (ANDROID)
#target_include_directories(itinerary-app PRIVATE ${Qt5Core_PRIVATE_INCLUDE_DIRS})
# explicitly add runtime dependencies and transitive link dependencies,
# so androiddeployqt picks them up
#target_link_libraries(kosmindoormap-app PRIVATE
#KF5::Kirigami2
#Qt5::Svg
#OpenSSL::SSL
#)
target_link_libraries(kosmindoormap-app PRIVATE
KF5::Kirigami2
Qt5::Svg
OpenSSL::SSL
Qt5::QuickControls2
)
#kirigami_package_breeze_icons(ICONS
#document-open
#)
kirigami_package_breeze_icons(ICONS
document-open
go-home
)
else ()
target_link_libraries(kosmindoormap-app PRIVATE
Qt5::Widgets
......@@ -33,6 +33,8 @@ else ()
set_target_properties(kosmindoormap-app PROPERTIES OUTPUT_NAME "kosmindoormap")
endif()
#install(TARGETS kosmindoormap-app ${INSTALL_TARGETS_DEFAULT_ARGS})
#install(PROGRAMS org.kde.kosmindoormap.desktop DESTINATION ${KDE_INSTALL_APPDIR})
#install(FILES org.kde.kosmindoormap.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
if (BUILD_STANDALONE_APP)
install(TARGETS kosmindoormap-app ${INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.kde.kosmindoormap.desktop DESTINATION ${KDE_INSTALL_APPDIR})
#install(FILES org.kde.kosmindoormap.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
endif()
......@@ -6,12 +6,12 @@
#include <kosmindoormap_version.h>
// #include <QQuickStyle>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#ifdef Q_OS_ANDROID
#include <QGuiApplication>
#include <QQuickStyle>
#else
#include <QApplication>
#endif
......@@ -32,7 +32,7 @@ int main(int argc, char **argv)
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#ifdef Q_OS_ANDROID
QGuiApplication app(argc, argv);
// QQuickStyle::setStyle(QStringLiteral("Material"));
QQuickStyle::setStyle(QStringLiteral("Material"));
#else
QApplication app(argc, argv); // for native file dialogs
#endif
......
[Desktop Entry]
Name=KDE OSM Indoor Map
GenericName=OSM Indoop Map
Exec=kosmindoormap
Icon=go-home
Type=Application
Comment=OSM indoor map demo application
Terminal=false
Categories=Qt;KDE;SDK;
SPDX-License-Identifier: CC0-1.0
SPDX-FileCopyrightText: none
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment