So I'm trying to put together a generally useful XCode project so that people using Mac OSX can use Box2d out of the box (so to speak). At the moment it seems overly complicated, but I'm an XCode (and OSX) newbie so I figured I'd explain what worked for me and see if anyone has advice for simplifying this procedure (right now there's a bit too much involved to just bundle it up into something that can be distributed as a project file).
For the moment, here's roughly how I got things running:
1) Set up CMake (http://www.cmake.org)
2) Download the Ruby script at http://www.eskilson.se/vcproj2cmake.rb (this converts Visual C++ project files to CMake ones)
3) Comment out the following lines in that script by adding a # in front of each line:
out.puts
%w(ENU JPN).each { |locale|
out.puts "add_locale( #{name} #{locale} <RESFILE> )"
}
4) For each Visual C++ project file:
4a) Run the Ruby script on the project to generate a CMake file
4b) Run CMake with the appropriate flags to generate an XCode project
[had trouble with HelloWorld at this point, for some reason I couldn't get the project to generate]
5) Load up XCode and start resolving errors in each project file
- malloc.h problem: replace #include <malloc.h> with #include <stdlib.h>
- GL linking problem: Add the OpenGL Framework to your project, at which point you may need to edit files so that 'GL' becomes 'OpenGL'
- GLUT linking problem: Add the GLUT Framework to your project
- GLUI linking problem: Couldn't resolve this one in any nice way, had to go to http://lukecyca.com/2007/02/14/glui-23- ... -mac-os-x/ and install the GLUI Framework from there, at which point things seemed to clear up. Can't vouch for the safety of that package (it's just something that some guy put together), but it didn't _seem_ to pwn my computer, so use at your own risk...I couldn't figure out how to get GLUI to compile from scratch, so...
6) Start building projects. One thing I had to do was, after building Box2D, import all the generated .o files into the TestBed project in order to get things linking correctly.
7) Cross your fingers, hope everything went well and I didn't forget a step. If I did, let me know. If you can get TestBed to build and run, you're in good shape (though a couple of the examples in that project don't run correctly on my machine)
I'm absolutely positive there must be a simpler way to do a lot of this, so please, let me know if you have some idea. If I get all of this squared away and working smoothly, I'd be happy to upload the XCode projects, but it still seems a little too complicated.
For the moment, here's roughly how I got things running:
1) Set up CMake (http://www.cmake.org)
2) Download the Ruby script at http://www.eskilson.se/vcproj2cmake.rb (this converts Visual C++ project files to CMake ones)
3) Comment out the following lines in that script by adding a # in front of each line:
out.puts
%w(ENU JPN).each { |locale|
out.puts "add_locale( #{name} #{locale} <RESFILE> )"
}
4) For each Visual C++ project file:
4a) Run the Ruby script on the project to generate a CMake file
4b) Run CMake with the appropriate flags to generate an XCode project
[had trouble with HelloWorld at this point, for some reason I couldn't get the project to generate]
5) Load up XCode and start resolving errors in each project file
- malloc.h problem: replace #include <malloc.h> with #include <stdlib.h>
- GL linking problem: Add the OpenGL Framework to your project, at which point you may need to edit files so that 'GL' becomes 'OpenGL'
- GLUT linking problem: Add the GLUT Framework to your project
- GLUI linking problem: Couldn't resolve this one in any nice way, had to go to http://lukecyca.com/2007/02/14/glui-23- ... -mac-os-x/ and install the GLUI Framework from there, at which point things seemed to clear up. Can't vouch for the safety of that package (it's just something that some guy put together), but it didn't _seem_ to pwn my computer, so use at your own risk...I couldn't figure out how to get GLUI to compile from scratch, so...
6) Start building projects. One thing I had to do was, after building Box2D, import all the generated .o files into the TestBed project in order to get things linking correctly.
7) Cross your fingers, hope everything went well and I didn't forget a step. If I did, let me know. If you can get TestBed to build and run, you're in good shape (though a couple of the examples in that project don't run correctly on my machine)
I'm absolutely positive there must be a simpler way to do a lot of this, so please, let me know if you have some idea. If I get all of this squared away and working smoothly, I'd be happy to upload the XCode projects, but it still seems a little too complicated.