Building and packaging on OSX
This page will explain how to build and packaged SuperTuxKart on mac OS X.
Please note that this is meant for developers and not casual users.
Also see Source control to obtain the source code from git.
- Install developer tools, either from the OS X Install DVD or from Apple's website
- symlink include folder of OpenGL framework to /usr/local/include/GL (Unix programs have an easier time finding it this way)
sudo ln -s /System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/ /usr/local/include/GL
(you might need to create /usr/local/include/ first if you never built and installed anything from source! sudo mkdir -p /usr/local/include/)
On OSX 10.9.5 I had to use (FIXME):
$ xcrun --show-sdk-path
$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/ /usr/include
$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Headers/ /usr/local/include/OpenGL
The first link in order to find libcurl, the second to find opengl.
- Download pre-built dependencies from here
- Put the frameworks in [hard disk root]/Library/Frameworks
You can use the CMake build system to build STK. At this time CMake will not make a binary that is ready for distribution.
You'll have to run these commands inside your stk-code directory. The stk-assets directory has to be in the parent directory of stk-code
With GCC :
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_C_COMPILER=/usr/bin/gcc
Building on 10.10 with 10.9 compat
cmake .. -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
1. Place an additional copy of the dependencies into Users/<YOUR_USERNAME>/Library/Frameworks
2. In terminal, use cd to navigate to your cloned stk-code directory
3. Execute the following commands:
mkdir xcode_build && cd xcode_build
cmake .. -GXcode
4. Use Finder to navigate to your stk-code/xcode_build folder and open the newly generated Xcode project (SuperTuxKart.xcodeproj)
5. Build the project in Xcode: Product -> Build
Note: Xcode is much less well tested than makefiles, so there may be issues when trying to use Xcode.