From cc4b8e59777eeb9da033f0d497724b2b137c5de1 Mon Sep 17 00:00:00 2001
From: Maxime Graulich <maxime.graulich@gmail.com>
Date: Wed, 22 May 2013 11:44:10 +0000
Subject: [PATCH] Add iOS icons to the xCode projet + some fixes for iOS

---
 contrib/mobile/CMakeLists.txt                 |   2 ++
 contrib/mobile/drawGModel.h                   |   4 +++
 .../iOS/Onelab.xcodeproj/project.pbxproj      |  24 +++++++++++++-----
 contrib/mobile/iOS/Onelab/EAGLView.mm         |   4 +--
 .../iOS/{Onelab/pictures => }/ic_launcher.png | Bin
 .../pictures => }/ic_launcher_retina.png      | Bin
 6 files changed, 26 insertions(+), 8 deletions(-)
 rename contrib/mobile/iOS/{Onelab/pictures => }/ic_launcher.png (100%)
 rename contrib/mobile/iOS/{Onelab/pictures => }/ic_launcher_retina.png (100%)

diff --git a/contrib/mobile/CMakeLists.txt b/contrib/mobile/CMakeLists.txt
index 4b9d740568..45438d6722 100644
--- a/contrib/mobile/CMakeLists.txt
+++ b/contrib/mobile/CMakeLists.txt
@@ -53,6 +53,8 @@ if(ENABLE_BUILD_IOS_EMULATOR OR ENABLE_BUILD_IOS)
     COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/Onelab/
     COMMAND ${CMAKE_COMMAND} -E copy_directory  ${CMAKE_CURRENT_SOURCE_DIR}/iOS/Onelab/ ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/
     COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/iOS/Onelab.xcodeproj/ ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab.xcodeproj/
+    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/iOS/ic_launcher.png ${CMAKE_CURRENT_BINARY_DIR}/Onelab/
+    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/iOS/ic_launcher_retina.png ${CMAKE_CURRENT_BINARY_DIR}/Onelab/
     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/drawGModel.cpp ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/
     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/drawGModel.h ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/
     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/iosGModel.h ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/
diff --git a/contrib/mobile/drawGModel.h b/contrib/mobile/drawGModel.h
index 0421e4ef89..47ff709ff8 100644
--- a/contrib/mobile/drawGModel.h
+++ b/contrib/mobile/drawGModel.h
@@ -1,6 +1,10 @@
 #ifndef _DRAW_GMODEL_H_
 #define _DRAW_GMODEL_H_
 
+#if !defined(BUILD_ANDROID)
+#define BUILD_IOS 1
+#endif
+
 #include <string>
 
 #if defined(BUILD_IOS)
diff --git a/contrib/mobile/iOS/Onelab.xcodeproj/project.pbxproj b/contrib/mobile/iOS/Onelab.xcodeproj/project.pbxproj
index 1ab22b2589..0781f1f310 100644
--- a/contrib/mobile/iOS/Onelab.xcodeproj/project.pbxproj
+++ b/contrib/mobile/iOS/Onelab.xcodeproj/project.pbxproj
@@ -41,6 +41,8 @@
 		9C99753F17379C440036EC24 /* pmsm.geo in Resources */ = {isa = PBXBuildFile; fileRef = 9C99753517379C440036EC24 /* pmsm.geo */; };
 		9C9975411737A4840036EC24 /* pmsm.pro in Resources */ = {isa = PBXBuildFile; fileRef = 9C9975401737A4840036EC24 /* pmsm.pro */; };
 		9C9975431737B55E0036EC24 /* pmsm_8p_circuit.pro in Resources */ = {isa = PBXBuildFile; fileRef = 9C9975421737B55E0036EC24 /* pmsm_8p_circuit.pro */; };
+		9C9F8BCD174B5A1B004332C5 /* ic_launcher_retina.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C9F8BCC174B5A1B004332C5 /* ic_launcher_retina.png */; };
+		9C9F8BCF174B5A23004332C5 /* ic_launcher.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C9F8BCE174B5A23004332C5 /* ic_launcher.png */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -96,6 +98,8 @@
 		9C9975401737A4840036EC24 /* pmsm.pro */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = pmsm.pro; path = files/pmsm.pro; sourceTree = "<group>"; };
 		9C9975421737B55E0036EC24 /* pmsm_8p_circuit.pro */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = pmsm_8p_circuit.pro; path = files/pmsm_8p_circuit.pro; sourceTree = "<group>"; };
 		9C99754C17390DEE0036EC24 /* iosGModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iosGModel.h; sourceTree = "<group>"; };
+		9C9F8BCC174B5A1B004332C5 /* ic_launcher_retina.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_launcher_retina.png; sourceTree = "<group>"; };
+		9C9F8BCE174B5A23004332C5 /* ic_launcher.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_launcher.png; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -131,6 +135,8 @@
 		9C96082B1712C16300E1D4A0 = {
 			isa = PBXGroup;
 			children = (
+				9C9F8BCE174B5A23004332C5 /* ic_launcher.png */,
+				9C9F8BCC174B5A1B004332C5 /* ic_launcher_retina.png */,
 				9C9608401712C16300E1D4A0 /* Onelab */,
 				9C9608611712C16400E1D4A0 /* OnelabTests */,
 				9C9608391712C16300E1D4A0 /* Frameworks */,
@@ -308,6 +314,8 @@
 				9C99753F17379C440036EC24 /* pmsm.geo in Resources */,
 				9C9975411737A4840036EC24 /* pmsm.pro in Resources */,
 				9C9975431737B55E0036EC24 /* pmsm_8p_circuit.pro in Resources */,
+				9C9F8BCD174B5A1B004332C5 /* ic_launcher_retina.png in Resources */,
+				9C9F8BCF174B5A23004332C5 /* ic_launcher.png in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -446,7 +454,8 @@
 			buildSettings = {
 				CLANG_ENABLE_OBJC_ARC = YES;
 				CLANG_WARN_OBJCPP_ARC_ABI = YES;
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
+				CODE_SIGN_IDENTITY = "iPhone Developer";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SRCROOT)/../../getdp-iOS\"",
@@ -459,11 +468,12 @@
 				INFOPLIST_FILE = "Onelab/Onelab-Info.plist";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
-					"\"$(SRCROOT)/../../petsc-3.3-p6/arch-darwin-cxx-opt/lib\"",
-					"\"$(SRCROOT)/../../petsc-3.3-p6/arch-darwin-cxx-opt/lib/openmpi\"",
 				);
 				OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				PROVISIONING_PROFILE = "";
+				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+				TARGETED_DEVICE_FAMILY = 2;
 				VALID_ARCHS = armv7;
 				WRAPPER_EXTENSION = app;
 			};
@@ -474,7 +484,8 @@
 			buildSettings = {
 				CLANG_ENABLE_OBJC_ARC = YES;
 				CLANG_WARN_OBJCPP_ARC_ABI = YES;
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
+				CODE_SIGN_IDENTITY = "iPhone Developer";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SRCROOT)/../../getdp-iOS\"",
@@ -487,10 +498,11 @@
 				INFOPLIST_FILE = "Onelab/Onelab-Info.plist";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
-					"\"$(SRCROOT)/../../petsc-3.3-p6/arch-darwin-cxx-opt/lib\"",
-					"\"$(SRCROOT)/../../petsc-3.3-p6/arch-darwin-cxx-opt/lib/openmpi\"",
 				);
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				PROVISIONING_PROFILE = "";
+				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+				TARGETED_DEVICE_FAMILY = 2;
 				VALID_ARCHS = armv7;
 				WRAPPER_EXTENSION = app;
 			};
diff --git a/contrib/mobile/iOS/Onelab/EAGLView.mm b/contrib/mobile/iOS/Onelab/EAGLView.mm
index 4a45c32263..25c3823399 100644
--- a/contrib/mobile/iOS/Onelab/EAGLView.mm
+++ b/contrib/mobile/iOS/Onelab/EAGLView.mm
@@ -45,7 +45,7 @@
         NSString *ressourcePath = [[NSBundle mainBundle] resourcePath];
         NSString *startupModel = [ressourcePath stringByAppendingPathComponent:@"pmsm.geo"];
 
-        mGModel = new drawGModel("");
+        mGModel = new drawGModel();
         mGModel->load(*new std::string([startupModel fileSystemRepresentation]));
     }
     return self;
@@ -67,7 +67,7 @@
 {
     NSString *ressourcePath = [[NSBundle mainBundle] resourcePath];
     NSString *msh = [ressourcePath stringByAppendingPathComponent: file];
-    mGModel = new drawGModel([msh UTF8String]);
+    mGModel = new drawGModel();
     mGModel->load(*new std::string([msh fileSystemRepresentation]));
     [self drawView];
 }
diff --git a/contrib/mobile/iOS/Onelab/pictures/ic_launcher.png b/contrib/mobile/iOS/ic_launcher.png
similarity index 100%
rename from contrib/mobile/iOS/Onelab/pictures/ic_launcher.png
rename to contrib/mobile/iOS/ic_launcher.png
diff --git a/contrib/mobile/iOS/Onelab/pictures/ic_launcher_retina.png b/contrib/mobile/iOS/ic_launcher_retina.png
similarity index 100%
rename from contrib/mobile/iOS/Onelab/pictures/ic_launcher_retina.png
rename to contrib/mobile/iOS/ic_launcher_retina.png
-- 
GitLab