From efc871d597ad7e65a370ce622251bf0ff90f6f3f Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Date: Sat, 5 Mar 2016 15:56:37 -0300
Subject: [PATCH 3/3] Remove leftovers from the other trials for iOS build.

This should make things sane again.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
---
 CMakeLists.txt                                  | 25 +++++-----------
 packaging/ios/subsurface-ios/MainForm.ui.qml    | 25 ----------------
 packaging/ios/subsurface-ios/main.qml           | 40 -------------------------
 packaging/ios/subsurface-ios/qml.qrc            |  6 ----
 packaging/ios/subsurface-ios/subsurface-ios.pro |  2 +-
 5 files changed, 8 insertions(+), 90 deletions(-)
 delete mode 100644 packaging/ios/subsurface-ios/MainForm.ui.qml
 delete mode 100644 packaging/ios/subsurface-ios/main.qml
 delete mode 100644 packaging/ios/subsurface-ios/qml.qrc

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 309a335..13f34fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,18 +87,11 @@ include(cmake/Modules/pkgconfig_helper.cmake)
 # if you think a module miss anything, take a look on the specific
 # module file.
 include(cmake/Modules/HandleFindGit2.cmake)
-
-if(NOT IOS_PLATFORM)
-	include(cmake/Modules/HandleFindLibDiveComputer.cmake)
-    if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopExecutable")
-    	include(cmake/Modules/HandleFindMarble.cmake)
-    	include(cmake/Modules/HandleFindGrantlee.cmake)
-    	include(cmake/Modules/HandleUserManual.cmake)
-    endif()
-else()
-	if(LIBDC_HEADERSONLY)
-		include_directories(${CMAKE_SOURCE_DIR}/../libdivecomputer/include)
-	endif()
+include(cmake/Modules/HandleFindLibDiveComputer.cmake)
+if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopExecutable")
+	include(cmake/Modules/HandleFindMarble.cmake)
+	include(cmake/Modules/HandleFindGrantlee.cmake)
+	include(cmake/Modules/HandleUserManual.cmake)
 endif()
 include(cmake/Modules/HandleFtdiSupport.cmake)
 include(cmake/Modules/HandleVersionGeneration.cmake)
@@ -108,9 +101,7 @@ pkg_config_library(LIBXML libxml-2.0 REQUIRED)
 pkg_config_library(LIBSQLITE3 sqlite3 REQUIRED)
 pkg_config_library(LIBXSLT libxslt REQUIRED)
 pkg_config_library(LIBZIP libzip REQUIRED)
-if(NOT IOS_PLATFORM)
-	pkg_config_library(LIBUSB libusb-1.0 QUIET)
-endif()
+pkg_config_library(LIBUSB libusb-1.0 QUIET)
 
 if(SMARTTRAK_IMPORT)
 	pkg_config_library(GLIB2 glib-2.0 REQUIRED)
@@ -167,9 +158,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
                 OUTPUT_STRIP_TRAILING_WHITESPACE
         )
         find_library(APP_SERVICES_LIBRARY ApplicationServices)
-	if(NOT IOS_PLATFORM)
-		find_library(HID_LIB HidApi)
-	endif()
+        find_library(HID_LIB HidApi)
         set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${HID_LIB})
         set(EXTRA_LIBS ${APP_SERVICES_LIBRARY})
         set(ICON_FILE ${CMAKE_SOURCE_DIR}/packaging/macosx/Subsurface.icns)
diff --git a/packaging/ios/subsurface-ios/MainForm.ui.qml b/packaging/ios/subsurface-ios/MainForm.ui.qml
deleted file mode 100644
index 7913bb2..0000000
--- a/packaging/ios/subsurface-ios/MainForm.ui.qml
+++ /dev/null
@@ -1,25 +0,0 @@
-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/main.qml b/packaging/ios/subsurface-ios/main.qml
deleted file mode 100644
index 26b1a79..0000000
--- a/packaging/ios/subsurface-ios/main.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-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
deleted file mode 100644
index 7684346..0000000
--- a/packaging/ios/subsurface-ios/qml.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<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
index 278c71d..9cf84a3 100644
--- a/packaging/ios/subsurface-ios/subsurface-ios.pro
+++ b/packaging/ios/subsurface-ios/subsurface-ios.pro
@@ -101,7 +101,7 @@ SOURCES += ../../../subsurface-mobile-main.cpp \
     ../../../profile-widget/diverectitem.cpp \
     ../../../profile-widget/divetextitem.cpp
 
-RESOURCES += qml.qrc ../../../subsurface.qrc ../../../qt-mobile/qml/mobile-resources.qrc
+RESOURCES += ../../../subsurface.qrc ../../../qt-mobile/qml/mobile-resources.qrc
 
 LIBS += ../install-root/lib/libcrypto.a \
         ../install-root/lib/libdivecomputer.a \
-- 
2.5.4 (Apple Git-61)

