diff options
-rwxr-xr-x | packaging/ios/configure-for-ios.sh | 106 | ||||
-rw-r--r-- | packaging/ios/deployment.pri | 13 | ||||
-rw-r--r-- | packaging/ios/iPhoneDeviceCMakeToolchain | 20 | ||||
-rw-r--r-- | packaging/ios/iPhoneSimulatorCMakeToolchain | 20 | ||||
-rw-r--r-- | packaging/ios/subsurface-ios/MainForm.ui.qml | 25 | ||||
-rw-r--r-- | packaging/ios/subsurface-ios/deployment.pri | 13 | ||||
-rw-r--r-- | packaging/ios/subsurface-ios/main.qml | 40 | ||||
-rw-r--r-- | packaging/ios/subsurface-ios/qml.qrc | 6 | ||||
-rw-r--r-- | packaging/ios/subsurface-ios/subsurface-ios.pro | 220 |
9 files changed, 357 insertions, 106 deletions
diff --git a/packaging/ios/configure-for-ios.sh b/packaging/ios/configure-for-ios.sh deleted file mode 100755 index 1624bc391..000000000 --- a/packaging/ios/configure-for-ios.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/sh -set -e - -usage () { - echo "Usage: [VARIABLE...] $(basename $0) architecture" - echo "" - echo " architecture Target architecture. [armv7|armv7s|arm64|i386|x86_64]" - echo "" - echo " VARIABLEs are:" - echo " SDKVERSION Target a specific SDK version." - echo " PREFIX Custom install prefix, useful for local installs." - echo " CHOST Configure host, set if not deducable by ARCH." - echo " SDK SDK target, set if not deducable by ARCH. [iphoneos|iphonesimulator]" - echo "" - echo " CFLAGS CPPFLAGS CXXFLAGS LDFLAGS PKG_CONFIG_PATH" - echo "" - echo " All additional parameters are passed to the configure script." - exit 1 -} - -# Sanity checks -if [ "$#" -lt 1 ]; then - echo "Please supply an architecture name." - usage -fi - -if [ ! -x "./configure" ] ; then - echo "No configure script found." - usage -fi - -# Build architecture -export ARCH=$1 - -# Export supplied CHOST or deduce by ARCH -if [ ! -z "$CHOST" ]; then - export CHOST -else - case $ARCH in - armv7 | armv7s ) - export CHOST=arm-apple-darwin* - ;; - arm64 ) - export CHOST=aarch64-apple-darwin* - ;; - i386 | x86_64 ) - export CHOST=$ARCH-apple-darwin* - ;; - * ) - usage - ;; - esac -fi - -# Export supplied SDK or deduce by ARCH -if [ ! -z "$SDK" ]; then - export SDK -else - case $ARCH in - armv7 | armv7s | arm64 ) - export SDK=iphoneos - ;; - i386 | x86_64 ) - export SDK=iphonesimulator - ;; - * ) - usage - ;; - esac -fi - -# Export supplied SDKVERSION or use system default -if [ ! -z "$SDKVERSION" ]; then - SDKNAME=$(basename $(xcrun --sdk $SDK --show-sdk-platform-path) .platform) - export SDKVERSION - export SDKROOT=$(xcrun --sdk $SDK --show-sdk-platform-path)"/Developer/SDKs/$SDKNAME.$SDKVERSION.sdk" -else - export SDKVERSION=$(xcrun --sdk $SDK --show-sdk-version) # current version - export SDKROOT=$(xcrun --sdk $SDK --show-sdk-path) # current version -fi - -export PREFIX - -# Binaries -export CC=$(xcrun --sdk $SDK --find gcc) -export CPP=$(xcrun --sdk $SDK --find gcc)" -E" -export CXX=$(xcrun --sdk $SDK --find g++) -export LD=$(xcrun --sdk $SDK --find ld) - -# Flags -export CFLAGS="$CFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -miphoneos-version-min=$SDKVERSION" -export CPPFLAGS="$CPPFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -miphoneos-version-min=$SDKVERSION" -export CXXFLAGS="$CXXFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include" -export LDFLAGS="$LDFLAGS -arch $ARCH -isysroot $SDKROOT -L$PREFIX/lib" -export PKG_CONFIG_PATH="$PKG_CONFIG_PATH":"$SDKROOT/usr/lib/pkgconfig":"$PREFIX/lib/pkgconfig" - -# Remove script parameters -shift 1 - -# Run configure -./configure \ - --prefix="$PREFIX" \ - --host="$CHOST" \ - --enable-static \ - --disable-shared \ - $@ diff --git a/packaging/ios/deployment.pri b/packaging/ios/deployment.pri new file mode 100644 index 000000000..265ce71f3 --- /dev/null +++ b/packaging/ios/deployment.pri @@ -0,0 +1,13 @@ +unix:!android { + isEmpty(target.path) { + qnx { + target.path = /tmp/$${TARGET}/bin + } else { + target.path = /opt/$${TARGET}/bin + } + export(target.path) + } + INSTALLS += target +} + +export(INSTALLS) diff --git a/packaging/ios/iPhoneDeviceCMakeToolchain b/packaging/ios/iPhoneDeviceCMakeToolchain new file mode 100644 index 000000000..35d8b8923 --- /dev/null +++ b/packaging/ios/iPhoneDeviceCMakeToolchain @@ -0,0 +1,20 @@ +INCLUDE(CMakeForceCompiler) + +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Darwin") +SET (CMAKE_SYSTEM_PROCESSOR "arm") +SET (CMAKE_OSX_SYSROOT "$ENV{PLATFORM_DIR}") + +SET (CMAKE_C_COMPILER $ENV{CC}) +SET (CMAKE_CXX_COMPILER $ENV{CXX}) + +SET (CMAKE_FIND_ROOT_PATH "$ENV{SDK_DIR}" "$ENV{PLATFORM_DIR}") +SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +MESSAGE (STATUS "PLATFORM_DIR = $ENV{PLATFORM_DIR}") +MESSAGE (STATUS "SDK_DIR = $ENV{SDK_DIR}") +MESSAGE (STATUS "CC = $ENV{CC}") +MESSAGE (STATUS "CXX = $ENV{CXX}") +MESSAGE (STATUS "LD = $ENV{LD}") diff --git a/packaging/ios/iPhoneSimulatorCMakeToolchain b/packaging/ios/iPhoneSimulatorCMakeToolchain new file mode 100644 index 000000000..0d3cc40a4 --- /dev/null +++ b/packaging/ios/iPhoneSimulatorCMakeToolchain @@ -0,0 +1,20 @@ +INCLUDE(CMakeForceCompiler) + +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Darwin") +SET (CMAKE_SYSTEM_PROCESSOR "i386") +SET (CMAKE_OSX_SYSROOT "$ENV{PLATFORM_DIR}") + +SET (CMAKE_C_COMPILER $ENV{CC}) +SET (CMAKE_CXX_COMPILER $ENV{CXX}) + +SET (CMAKE_FIND_ROOT_PATH "$ENV{SDK_DIR}" "$ENV{PLATFORM_DIR}") +SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +MESSAGE (STATUS "PLATFORM_DIR = $ENV{PLATFORM_DIR}") +MESSAGE (STATUS "SDK_DIR = $ENV{SDK_DIR}") +MESSAGE (STATUS "CC = $ENV{CC}") +MESSAGE (STATUS "CXX = $ENV{CXX}") +MESSAGE (STATUS "LD = $ENV{LD}") diff --git a/packaging/ios/subsurface-ios/MainForm.ui.qml b/packaging/ios/subsurface-ios/MainForm.ui.qml new file mode 100644 index 000000000..7913bb2b8 --- /dev/null +++ b/packaging/ios/subsurface-ios/MainForm.ui.qml @@ -0,0 +1,25 @@ +import QtQuick 2.6 +import QtQuick.Controls 1.5 +import QtQuick.Layouts 1.3 + +Item { + width: 640 + height: 480 + + property alias button1: button1 + property alias button2: button2 + + RowLayout { + anchors.centerIn: parent + + Button { + id: button1 + text: qsTr("Press Me 1") + } + + Button { + id: button2 + text: qsTr("Press Me 2") + } + } +} diff --git a/packaging/ios/subsurface-ios/deployment.pri b/packaging/ios/subsurface-ios/deployment.pri new file mode 100644 index 000000000..265ce71f3 --- /dev/null +++ b/packaging/ios/subsurface-ios/deployment.pri @@ -0,0 +1,13 @@ +unix:!android { + isEmpty(target.path) { + qnx { + target.path = /tmp/$${TARGET}/bin + } else { + target.path = /opt/$${TARGET}/bin + } + export(target.path) + } + INSTALLS += target +} + +export(INSTALLS) diff --git a/packaging/ios/subsurface-ios/main.qml b/packaging/ios/subsurface-ios/main.qml new file mode 100644 index 000000000..26b1a7998 --- /dev/null +++ b/packaging/ios/subsurface-ios/main.qml @@ -0,0 +1,40 @@ +import QtQuick 2.6 +import QtQuick.Controls 1.5 +import QtQuick.Dialogs 1.2 + +ApplicationWindow { + visible: true + width: 640 + height: 480 + title: qsTr("Hello World") + + menuBar: MenuBar { + Menu { + title: qsTr("File") + MenuItem { + text: qsTr("&Open") + onTriggered: console.log("Open action triggered"); + } + MenuItem { + text: qsTr("Exit") + onTriggered: Qt.quit(); + } + } + } + + MainForm { + anchors.fill: parent + button1.onClicked: messageDialog.show(qsTr("Button 1 pressed")) + button2.onClicked: messageDialog.show(qsTr("Button 2 pressed")) + } + + MessageDialog { + id: messageDialog + title: qsTr("May I have your attention, please?") + + function show(caption) { + messageDialog.text = caption; + messageDialog.open(); + } + } +} diff --git a/packaging/ios/subsurface-ios/qml.qrc b/packaging/ios/subsurface-ios/qml.qrc new file mode 100644 index 000000000..7684346a5 --- /dev/null +++ b/packaging/ios/subsurface-ios/qml.qrc @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + <file>MainForm.ui.qml</file> + </qresource> +</RCC> diff --git a/packaging/ios/subsurface-ios/subsurface-ios.pro b/packaging/ios/subsurface-ios/subsurface-ios.pro new file mode 100644 index 000000000..6447970c0 --- /dev/null +++ b/packaging/ios/subsurface-ios/subsurface-ios.pro @@ -0,0 +1,220 @@ +TEMPLATE = app + +QT += qml quick widgets positioning concurrent + +DEFINES += SUBSURFACE_MOBILE + +CONFIG += c++11 + +SOURCES += ../../../subsurface-mobile-main.cpp \ + ../../../subsurface-mobile-helper.cpp \ + ../../../subsurface-core/cloudstorage.cpp \ + ../../../subsurface-core/configuredivecomputerthreads.cpp \ + ../../../subsurface-core/devicedetails.cpp \ + ../../../subsurface-core/gpslocation.cpp \ + ../../../subsurface-core/imagedownloader.cpp \ + ../../../subsurface-core/qthelper.cpp \ + ../../../subsurface-core/checkcloudconnection.cpp \ + ../../../subsurface-core/color.cpp \ + ../../../subsurface-core/configuredivecomputer.cpp \ + ../../../subsurface-core/divecomputer.cpp \ + ../../../subsurface-core/divelogexportlogic.cpp \ + ../../../subsurface-core/divesite.cpp \ + ../../../subsurface-core/divesitehelpers.cpp \ + ../../../subsurface-core/exif.cpp \ + ../../../subsurface-core/gettextfromc.cpp \ + ../../../subsurface-core/isocialnetworkintegration.cpp \ + ../../../subsurface-core/metrics.cpp \ + ../../../subsurface-core/pluginmanager.cpp \ + ../../../subsurface-core/qt-init.cpp \ + ../../../subsurface-core/subsurfacesysinfo.cpp \ + ../../../subsurface-core/windowtitleupdate.cpp \ + ../../../subsurface-core/file.c \ + ../../../subsurface-core/subsurfacestartup.c \ + ../../../subsurface-core/macos.c \ + ../../../subsurface-core/profile.c \ + ../../../subsurface-core/device.c \ + ../../../subsurface-core/dive.c \ + ../../../subsurface-core/divelist.c \ + ../../../subsurface-core/gas-model.c \ + ../../../subsurface-core/gaspressures.c \ + ../../../subsurface-core/git-access.c \ + ../../../subsurface-core/liquivision.c \ + ../../../subsurface-core/load-git.c \ + ../../../subsurface-core/parse-xml.c \ + ../../../subsurface-core/save-html.c \ + ../../../subsurface-core/statistics.c \ + ../../../subsurface-core/worldmap-save.c \ + ../../../subsurface-core/libdivecomputer.c \ + ../../../subsurface-core/version.c \ + ../../../subsurface-core/save-git.c \ + ../../../subsurface-core/datatrak.c \ + ../../../subsurface-core/ostctools.c \ + ../../../subsurface-core/planner.c \ + ../../../subsurface-core/save-xml.c \ + ../../../subsurface-core/cochran.c \ + ../../../subsurface-core/deco.c \ + ../../../subsurface-core/divesite.c \ + ../../../subsurface-core/equipment.c \ + ../../../subsurface-core/membuffer.c \ + ../../../subsurface-core/sha1.c \ + ../../../subsurface-core/strtod.c \ + ../../../subsurface-core/taxonomy.c \ + ../../../subsurface-core/time.c \ + ../../../subsurface-core/uemis.c \ + ../../../subsurface-core/subsurface-qt/DiveObjectHelper.cpp \ + ../../../subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp \ + ../../../qt-mobile/qmlmanager.cpp \ + ../../../qt-mobile/qmlprofile.cpp \ + ../../../qt-models/cylindermodel.cpp \ + ../../../qt-models/divelistmodel.cpp \ + ../../../qt-models/diveplotdatamodel.cpp \ + ../../../qt-models/gpslistmodel.cpp \ + ../../../qt-models/yearlystatisticsmodel.cpp \ + ../../../qt-models/diveplannermodel.cpp \ + ../../../qt-models/cleanertablemodel.cpp \ + ../../../qt-models/completionmodels.cpp \ + ../../../qt-models/divecomputerextradatamodel.cpp \ + ../../../qt-models/divecomputermodel.cpp \ + ../../../qt-models/divelocationmodel.cpp \ + ../../../qt-models/divepicturemodel.cpp \ + ../../../qt-models/divesitepicturesmodel.cpp \ + ../../../qt-models/divetripmodel.cpp \ + ../../../qt-models/filtermodels.cpp \ + ../../../qt-models/models.cpp \ + ../../../qt-models/tankinfomodel.cpp \ + ../../../qt-models/treemodel.cpp \ + ../../../qt-models/weightmodel.cpp \ + ../../../qt-models/weigthsysteminfomodel.cpp \ + ../../../qt-models/ssrfsortfilterproxymodel.cpp \ + ../../../profile-widget/divecartesianaxis.cpp \ + ../../../profile-widget/diveeventitem.cpp \ + ../../../profile-widget/diveprofileitem.cpp \ + ../../../profile-widget/profilewidget2.cpp \ + ../../../profile-widget/ruleritem.cpp \ + ../../../profile-widget/animationfunctions.cpp \ + ../../../profile-widget/divepixmapitem.cpp \ + ../../../profile-widget/divetooltipitem.cpp \ + ../../../profile-widget/tankitem.cpp \ + ../../../profile-widget/divelineitem.cpp \ + ../../../profile-widget/diverectitem.cpp \ + ../../../profile-widget/divetextitem.cpp + +RESOURCES += qml.qrc ../../../subsurface.qrc ../../../qt-mobile/qml/mobile-resources.qrc + +LIBS += ../install-root/lib/libcrypto.a \ + ../install-root/lib/libdivecomputer.a \ + ../install-root/lib/libgit2.a \ + ../install-root/lib/libsqlite3.a \ + ../install-root/lib/libzip.a \ + ../install-root/lib/libxslt.a \ + ../install-root/lib/libxml2.a \ + ../install-root/lib/libssh2.a \ + ../install-root/lib/libssl.a \ + -liconv + +INCLUDEPATH += ../install-root/include/ \ + ../install-root/lib/libzip/include \ + ../install-root/include/libxml2 \ + ../install-root/include/libxstl \ + ../install-root/include/libexstl \ + ../install-root/include/openssl \ + ../../.. \ + ../../../subsurface-core + +HEADERS += \ + ../../../subsurface-core/libdivecomputer.h \ + ../../../subsurface-core/cloudstorage.h \ + ../../../subsurface-core/configuredivecomputerthreads.h \ + ../../../subsurface-core/device.h \ + ../../../subsurface-core/devicedetails.h \ + ../../../subsurface-core/dive.h \ + ../../../subsurface-core/git-access.h \ + ../../../subsurface-core/gpslocation.h \ + ../../../subsurface-core/helpers.h \ + ../../../subsurface-core/imagedownloader.h \ + ../../../subsurface-core/pref.h \ + ../../../subsurface-core/profile.h \ + ../../../subsurface-core/qthelper.h \ + ../../../subsurface-core/save-html.h \ + ../../../subsurface-core/statistics.h \ + ../../../subsurface-core/units.h \ + ../../../subsurface-core/qthelperfromc.h \ + ../../../subsurface-core/version.h \ + ../../../subsurface-core/planner.h \ + ../../../subsurface-core/divesite.h \ + ../../../subsurface-core/checkcloudconnection.h \ + ../../../subsurface-core/cochran.h \ + ../../../subsurface-core/color.h \ + ../../../subsurface-core/configuredivecomputer.h \ + ../../../subsurface-core/datatrak.h \ + ../../../subsurface-core/deco.h \ + ../../../subsurface-core/display.h \ + ../../../subsurface-core/divecomputer.h \ + ../../../subsurface-core/divelist.h \ + ../../../subsurface-core/divelogexportlogic.h \ + ../../../subsurface-core/divesitehelpers.h \ + ../../../subsurface-core/exif.h \ + ../../../subsurface-core/file.h \ + ../../../subsurface-core/gaspressures.h \ + ../../../subsurface-core/gettext.h \ + ../../../subsurface-core/gettextfromc.h \ + ../../../subsurface-core/isocialnetworkintegration.h \ + ../../../subsurface-core/membuffer.h \ + ../../../subsurface-core/metrics.h \ + ../../../subsurface-core/pluginmanager.h \ + ../../../subsurface-core/prefs-macros.h \ + ../../../subsurface-core/qt-gui.h \ + ../../../subsurface-core/sha1.h \ + ../../../subsurface-core/strndup.h \ + ../../../subsurface-core/subsurfacestartup.h \ + ../../../subsurface-core/subsurfacesysinfo.h \ + ../../../subsurface-core/taxonomy.h \ + ../../../subsurface-core/uemis.h \ + ../../../subsurface-core/webservice.h \ + ../../../subsurface-core/windowtitleupdate.h \ + ../../../subsurface-core/worldmap-options.h \ + ../../../subsurface-core/worldmap-save.h \ + ../../../subsurface-core/subsurface-qt/DiveObjectHelper.h \ + ../../../subsurface-core/subsurface-qt/SettingsObjectWrapper.h \ + ../../../qt-mobile/qmlmanager.h \ + ../../../qt-mobile/qmlprofile.h \ + ../../../qt-models/divelistmodel.h \ + ../../../qt-models/diveplotdatamodel.h \ + ../../../qt-models/gpslistmodel.h \ + ../../../qt-models/divelocationmodel.h \ + ../../../qt-models/cylindermodel.h \ + ../../../qt-models/divecomputermodel.h \ + ../../../qt-models/diveplannermodel.h \ + ../../../qt-models/divetripmodel.h \ + ../../../qt-models/models.h \ + ../../../qt-models/weightmodel.h \ + ../../../qt-models/cleanertablemodel.h \ + ../../../qt-models/divepicturemodel.h \ + ../../../qt-models/ssrfsortfilterproxymodel.h \ + ../../../qt-models/divesitepicturesmodel.h \ + ../../../qt-models/completionmodels.h \ + ../../../qt-models/weigthsysteminfomodel.h \ + ../../../qt-models/divecomputerextradatamodel.h \ + ../../../qt-models/filtermodels.h \ + ../../../qt-models/tankinfomodel.h \ + ../../../qt-models/treemodel.h \ + ../../../qt-models/yearlystatisticsmodel.h \ + ../../../profile-widget/diveprofileitem.h \ + ../../../profile-widget/profilewidget2.h \ + ../../../profile-widget/ruleritem.h \ + ../../../profile-widget/diveeventitem.h \ + ../../../profile-widget/divetooltipitem.h \ + ../../../profile-widget/tankitem.h \ + ../../../profile-widget/animationfunctions.h \ + ../../../profile-widget/divecartesianaxis.h \ + ../../../profile-widget/divelineitem.h \ + ../../../profile-widget/divepixmapitem.h \ + ../../../profile-widget/diverectitem.h \ + ../../../profile-widget/divetextitem.h + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = + +# Default rules for deployment. +include(deployment.pri) |