On 8/29/10, Thomas Hogarth <[email protected]> wrote:
> Hi Stephan, Robert and anyone else interested in the IPhone port of OSG
>
> Finally got round to downloading the git hub version of the IPhone port.
> Nice one for setting that up guys.
>
> I've had some success getting CMake support for IPhone in OSG
> and surprisingly the changes are very few, but essentially i have generated
> and compiled all the OSG libs for IPhone using CMkae. I only have a few
> minor issues remaining in order for the process to be completely automated,
> which are as follows.

Congrats. I hope to actually try this myself someday.

>
> OSG needs to NOT be 'Compiled for Thumb', at the moment this is
> automatically set by IPhone projects and you have to manually uncheck the
> box on everything you want to compile. I dare say there is
> a pre-processor definition that does the same thing as ticking the box (if
> anyone knows it, could save me some digging).

Might require CMake support to automatically do. I haven't kept up to
date on CMake/iPhone efforts but I haven't seen much on the public
mailing list.

One thing I have been thinking about for a long time that would help
both Mac and iPhone is .xcconfig support via CMake. If we could simply
tell CMake to load an external .xcconfig file, this would cover about
80% of the options we need to set in Xcode without requiring a CMake
API for every single feature. .xcconfig files are also extremely easy
to deal with (in contrast to the CMake API).

> The FIND_PACKAGE(OpenGL) command doesn't find the OpenGLES frameworks (I
> wouldn't expect it to I guess). At the moment, as things
> are statically linked it isn't too much of an issue as you only have to
> manually add it to your actual application.

This is probably a fix which should get pushed into CMake mainline.
The question is, do we make a separate OpenGLES find package or try to
make a separate one? I suppose the trickier parts of implementing such
a module will be how detect/deal with ES version numbers.

> osgDB FileUtils needs to be compiled as an ObjectiveC file, this has to
> be manually done through XCode (again if anyone knows how or if you can do
> this through CMake, would be a massive help)

Assuming this is a .cpp file, my guess is you need to compile as
Obj-C++, not Obj-C. I recall there was a feature request to CMake
about being able to specify Obj-C++ as a compile option. I don't know
if it was ever implemented. I would say the easier approach is to move
the Obj-C code out of the .cpp file into another .m (or .mm) file and
wrap all the Obj-C calls into C functions so the .cpp file doesn't
need to know about Obj-C. (I thought I've done things like this
elsewhere in the OSG code base in the past to avoid this very issue.)

> I also need to review the changes to the ImageIO plugin, if it is different
> (which I know at least the location of the libs used will be) should we have
> two cpp files in the plugin folder (one with _iphone at the end) then use
> CMake to add the relevant one. Rather then have another plugin?

ImageIO was not available on iPhone until very recently. But I hope
now that it's here, it is identical to Snow Leopard. (There were a
couple of API changes between 10.5 and 10.6. I hope iOS doesn't
introduce any more.) Unless they are drastically different, I would
recommend keeping them in the same file as the same plugin.

> As the IPhone sdk is a platform within a platform OSG will require a switch
> somewhere to say I specifically want an IPhone project. i've done a basic
> version for now, but think it's something the CMake experts should be
> involved with. Also you have to manually set which version of the IPhone SDK
> you want in the CMakeLists file (once it's found XCode allows you to switch
> to other versions)

You might get more traction from the CMake list. Though, at least from
the mailing list, most of the people using CMake/Xcode are still
primarily doing Mac development so iOS needs some leadership. Maybe
you are willing to fill that void?

Also take note that Xcode 4 is on the horizon and we may see (yet
again) drastic changes in Xcode which also may need to be dealt with.

-Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to