The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
iOS project setup
Jonny D


Joined: 12 Sep 2009
Posts: 932
Hey all,

The README-ios.txt says that the project setup instructions are outdated.  I'm new to Xcode and while I've managed to make a mess and get a simple demo running on the simulator, I do wonder how I'm actually supposed to do this...  Can anyone give me an idea of how to properly set up a new SDL project on iOS via Xcode?


Jonny D
iOS project setup
slvn


Joined: 06 Oct 2012
Posts: 88
Hi, 

My 2 cents advice ...


On the first hand, I build the SDL libs with this scripts :
 https://bugzilla.libsdl.org/show_bug.cgi?id=2302



Then, I have a CMake file that I use to create the xcode projects for my apps :
Some example on this website :
http://www.michaelborgmann.com/tutorials/build-sdl2-app-for-ios-using-cmake/



Cheers,


Sylvain







On Tue, Apr 22, 2014 at 3:39 PM, Jonathan Dearborn wrote:
Quote:
Hey all,

The README-ios.txt says that the project setup instructions are outdated.  I'm new to Xcode and while I've managed to make a mess and get a simple demo running on the simulator, I do wonder how I'm actually supposed to do this...  Can anyone give me an idea of how to properly set up a new SDL project on iOS via Xcode?


Jonny D


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
Sylvain Becker
iOS project setup
Eric Wing
Guest

On 4/22/14, Jonathan Dearborn wrote:
Quote:
Hey all,

The README-ios.txt says that the project setup instructions are outdated.
I'm new to Xcode and while I've managed to make a mess and get a simple
demo running on the simulator, I do wonder how I'm actually supposed to do
this... Can anyone give me an idea of how to properly set up a new SDL
project on iOS via Xcode?

Jonny D

I probably should make a screencast, but I'm knee deep in Android crap
right now. (As bad as this is in iOS, Android is way worse.)

The native iOS, way is to make a new project (we used to have Xcode
project templates but I think they are all broken now).

- Make a new project (probably an empty one)
- Delete the .m files
- Create or add your main.c
- Copy the SDL source tree into your new project directory
- In Xcode, use the contextual menu to "Add Files to Project" (I
usually do it in the Frameworks section). Find the Xcode iOS project
that builds SDL and select that one. (Alternatively, you can create a
new "Workspace" add your project and the iOS project to that.)
- Select your project in the Groups & Panels (click on the topmost
item in the left-most panel). This will bring up Project Settings in
your main window.
- Select your application in "Targets" (left column in main window)
- Select the Build Phases tab (top center of main window)
- In Target Dependencies, hit the + button and look for libSDL and add it.
- In Link Binary With Libraries, hit the + button and look for
libSDL.a and add it.
- Now go to the Build Settings tab (one to the left of Build Phases)
- Find Header Search Paths and add the SDL include path to it.
Example: "$(SRCROOT)/../../SDL2-2.0.3/include" (Tip: You can find it
in Finder and drag the folder into the box in Xcode and it will fill
it out for you.)

Assuming I didn't forget anything, you should now be able to hit the
Run button and it will build and run. This will automatically handle
switching between simulator and device architectures (you don't need
to lipo the different binaries or do funny setups because there are 2
separate .a files) as well as debug and release.


(P.S. I have no objection to CMake and plan to look at that in the
near future. I use CMake for Windows and Linux and sometimes Mac and
the external NDK side of Android. I just haven't spent the time
getting familiar with the iOS CMake toolchain because I've literally
spent months on the Android one because it is such hell (but it's
worse without CMake)).

-Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
iOS project setup
m3xican


Joined: 07 Oct 2010
Posts: 21
Location: London, UK
Some time ago I wrote a post about how to set up a SDL 2  project for OS X in Xcode 4:http://blog.davidecoppola.com/2013/08/22/how-to-set-up-a-sdl-2-project-for-os-x-in-xcode-4/



I guess you're using Xcode 5 now and an iOS project should differ in few bits anyway, but hopefully this will give you a starting point.




On 22 April 2014 14:39, Jonathan Dearborn wrote:
Quote:
Hey all,

The README-ios.txt says that the project setup instructions are outdated.  I'm new to Xcode and while I've managed to make a mess and get a simple demo running on the simulator, I do wonder how I'm actually supposed to do this...  Can anyone give me an idea of how to properly set up a new SDL project on iOS via Xcode?


Jonny D


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
Davide Coppola

email:
website: http://www.davidecoppola.com
iOS project setup
Jonny D


Joined: 12 Sep 2009
Posts: 932
Thanks guys.  Now I have a few things to try and a better feeling for how things should be. Smile

Jonny D