Tuesday, June 30, 2009

Crosstown Traffic

Youre just like crosstown traffic
So hard to get through to you
Crosstown traffic
I dont need to run over you
Crosstown traffic
All you do is slow me down
And Im tryin to get on the other side of town
-Jimi Hendrix (The Master)

Actually, I'm no longer slowed down. I just got the cross-project building working. Hold on, here it comes...WHOOOHOOOO! Okay, it was pretty simple, and actually better than how I've done it on the PC/Visual Studio.

The cross project settings in XCode make it so that you can build static library projects, and link them to your main App project. The great thing is that you don't have to worry about the flavor of the build, i.e., iPhone debug/release Simulator, iPhone debug/release Device, iPhone debug/release 2.0, 3.0, 3.1, etc... You don't have to worry about getting the proper build libraries building with the proper App build settings.

The cross project settings handle it all for you. I read through the XCode Build Management documentation like I said I would, and it wasn't very clear, but I did find this tutorial that got me setup and running, so instead of regurgitating what I read, here's the link I followed...

http://blog.csdn.net/dotphoenix/archive/2009/05/16/4191455.aspx

However, in my journey of reading the docs I did run across a feature of XCode, "snapshotting," that works like a mini repository backup. So, if you don't have a SCM (source control manager) setup, or TimeMachine running, you should probably take a look at "snapshots."

Now, to the LuaBind build steps I promised in my last posting. Some asked, "how did you do it?" Now, without further ado, the steps...

1) Download Luabind 0.8.1 from here: http://mac.softpedia.com/progDownload/Luabind-Download-52705.html

2) Download Lua 5.1.2 from www.lua.org (LuaBind 0.8.1 currently only works with Lua 5.1.2).

3) Download Boost 1.39.0 from www.boost.org

4) Extract the above downloads to your desktop or some other area.

5) Create a Mac OS static library XCode project named "Lua...the following is from an earlier posting of mine that detailed how to build Lua. I will italicize so that the step numbers do not become confusing.

a) Get lua-5.1.2(Xcode).zip


b) Unzip it


c) It will unzip to the folder lua-5.1.2



d) Open it and double click on the lua.xcodeproj



e) Build the project (just to make sure it builds) ...it will generate a library file.



6) Now, create a Mac OS static library XCode project named "LuaBindLib."

7) From the extracted LuaBind download folder copy the LuaBind folder to the project's folder.

8) From the extracted LuaBind download folder copy the Src folder to the project's folder.

9) From the extracted Boost download folder copy the Boost folder to the project's folder.

10) In the LuaBindLib project folder create a folder name "Lua."

11) In the just created Lua folder, create a folder name, "Include."

12) From your earlier built Lua project find the following header files,

luaxlib.h
lau.h
lauconf.h
lualib.h

Copy them to the LuaBind\Lua\Include folder.

13) Your LuaBindLib folder should look like this...

LuaBindLib\
\LuaBind
\Src
\Boost
\Lua\Include

14) Add the Src folder to the project.

15) Bring up the "info," project window and go to the "Search Paths," section. On the "Header Search Paths," set the paths to the LuaBind, Boost, and Lua\Include folders.

16) Build and good luck. Leave a comment if you have any problems and would like some help.

To wrap up. Now, that I have the cross project library stuff working, I can get on with building my components as static libraries now. One more time...WHOOOHOOOO!!

No comments: