Quantcast
Viewing all articles
Browse latest Browse all 21

Integrating XMP into iOS – Work in progress

I am currently attempting to integrate Adobe’s XMP Toolkit into iOS. Although it is simple enough to use the toolkit on a simple C++ program, it is proving difficult to link the library to iOS as it not only uses a different architecture, but also a different language (Swift). However, XCode is able to compile both languages and a linking of them should be possible, using a wrapper in order to access the functions from Swift.

I am currently unsuccessful but I will detail my attempts.

First, I created a basic 1-page application which allows the user to attribute a license to a static image. This is simply for testing once the library is linked.

Image may be NSFW.
Clik here to view.
Screenshot 2015-03-08 18.38.34

Next, I generated the static library for the XMP toolkit. To do this, download the toolkit, install CMake and run the shell code located at XMP-Toolkit/build/GenerateXMPToolkitSDK_mac.sh this will generate the .a files you need for the static library. This will not have dynamic sizing which is useful for mobile development. Copy the XMP-Toolkit folder into your project folder.

From here a great deal of trawling for research and anecdotes from blogs of people achieving similar goals of cross-platform and cross-language compilation in XCode assisted in determining the following settings. Within build settings and you’ll need to change the build settings for the following:

Architectures: Standard architectures
Base SDK: iOS 8.1
Build Active Architecture Only: No
Supported platforms: iphonesimulator iphoneos macosx
Valid architectures: arm64 armv7 armv7s x86_64 i386
Scan all source files for includes: yes
Header search paths: the include directory for XMP (public/include)
Preprocessor macros: MAC_ENV=1
Other linker flags:
-WI,-search_paths_first
-WI,-headerpad_max_install_names
directory to libXMPCoreStatic.a
directory to libXMPCoreFiles.a
-framework Cocoa
-lstdc++

Here are some screenshots of what some of those build settings look like:
Image may be NSFW.
Clik here to view.
Screenshot 2015-03-08 18.39.23

Image may be NSFW.
Clik here to view.
Screenshot 2015-03-08 18.39.09

Image may be NSFW.
Clik here to view.
Screenshot 2015-03-08 18.38.58

At this point, I seem to be pointed in the correct direction, and it seems to be an issue with how the compilation process is searching, or linking the headers specified in Header Search Path to the compilation. I’m receiving 12 lexical and/or pre-processor issues (not finding the file) or processing issues (not being able to build the specified header).

It should be possible to link it, as Adobe mentions that the toolkit works in iOS (XMP Toolkit SDK Overview – Adobe).

I am seeking assistance in attempting to link this static library to iOS at the moment in hopes that an easily configured process can be determined. At the moment there seems to be applications which are capable of doing basic XMP reading, and a custom developed API which is capable of both reading and writing (http://www.chilkatsoft.com/xmp-objc.asp) though this application comes at a charge. If you are interested in assisting me, or have insight into this process please don’t hesitate to contact me.

Sources:

https://jbmeta.wordpress.com/2013/03/14/set-up-xmptoolkit-sdk-in-xcode/

http://partiallyattended.com/2012/07/11/getting-to-grips-with-xmp-on-osx/

http://stackoverflow.com/questions/9380186/availability-h-uikit-h-etc-not-found

There were many more, but I did not save all the sources as I went.

My stack overflow question:

http://stackoverflow.com/questions/28910796/building-an-app-using-adobes-xmp-c-static-library


Viewing all articles
Browse latest Browse all 21

Trending Articles