summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-03-15 22:55:33 +0200
committerTor Lillqvist <tml@iki.fi>2013-03-15 22:55:33 +0200
commit4b4bcb1af57ee376a1185d3559202857d9777b69 (patch)
tree248c3c6029ebca8199b0405f8d7433dcc5fdf841 /ios
parentafce2becdd284c5353eb67155278e609c195e99a (diff)
Make the Xcode build of the Viewer app work when SRCDIR!=BUILDDIR
Change-Id: I03dd3639841bf00d427b8d1b3db13f65f705724f
Diffstat (limited to 'ios')
-rw-r--r--ios/CustomTarget_Viewer_app.mk13
-rw-r--r--ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj2
2 files changed, 11 insertions, 4 deletions
diff --git a/ios/CustomTarget_Viewer_app.mk b/ios/CustomTarget_Viewer_app.mk
index 7640a14fd621..a4ef0ebd8349 100644
--- a/ios/CustomTarget_Viewer_app.mk
+++ b/ios/CustomTarget_Viewer_app.mk
@@ -47,6 +47,7 @@ endif
endif
ifneq ($(SCRIPT_OUTPUT_FILE_0),)
+ifeq ($(EXECUTABLE_NAME),Viewer)
# When run from Xcode, we move the Viewer executable from solver into
# the Viewer.app directory that Xcode uses. We also set up/copy all
# the run-time configuration etc files that the app needs.
@@ -130,11 +131,17 @@ $(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,Viewer)
# Copy a sample document... good old test1.odt...
#
cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt $(appdir)
-
+endif
else
# When run just from the command line, we don't have any app bundle to
-# copy or move the executable to. So do nothing.
-$(call gb_CustomTarget_get_target,ios/Viewer_app) : $(call gb_Executable_get_target,Viewer)
+# copy or move the executable to. So do nothing. Except one trick:
+# Copy the Xcode project to BUILDDIR if SRCDIR!=BUILDDIR, so that one
+# can then open it from there in Xcode.
+$(call gb_CustomTarget_get_target,ios/Viewer_app) : $(gb_Helper_PHONY)
+ if test $(SRCDIR) != $(BUILDDIR); then \
+ rm -rf $(BUILDDIR)/ios/experimental/Viewer; \
+ (cd $(SRCDIR) && tar cf - ios/experimental/Viewer) | (cd $(BUILDDIR) && tar xf -); \
+ fi
$(call gb_CustomTarget_get_clean_target,ios/Viewer_app) :
$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),APP,2)
diff --git a/ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj b/ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj
index 4fad8f0a8a7d..0535a2bd0611 100644
--- a/ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj
+++ b/ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj
@@ -191,7 +191,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "cd ../.. && /opt/lo/bin/make -r";
+ shellScript = "cd ../../.. && /opt/lo/bin/make ios";
};
/* End PBXShellScriptBuildPhase section */