Imported Upstream version 2.81
[platform/upstream/libbullet.git] / docs / building.tex
1 \chapter{Building the Bullet SDK and demos}
2 Windows developers can download the zipped sources of Bullet from \url{http://bullet.googlecode.com}. Mac OS X, Linux and other developers should download the gzipped tar archive.
3 Bullet provides several build systems.
4
5 \section{Microsoft Visual Studio}
6 After unzipping the source code you can open the \path{Bullet/build/vs2010/0BulletSolution.sln}, hit F5 and your first Bullet demo will run. Note that by default Visual Studio uses an unoptimized Debug configuration that is very slow. It is best to enable the Release configuration.
7
8 \section{Using Premake}
9 \index{premake}\href{http://industriousone.com/premake}{Premake} is a meta build system based on the Lua scripting language that can generate project files for Microsoft Visual Studio, Apple Xcode as well as Makefiles for GNU make and other build systems. Bullet comes with Premake executables for Windows, Mac OSX and Linux.
10 \subsection{Premake Visual Studio project generation}
11 You can double-click on \path{Bullet/build/vs2010.bat} to generate Visual Studio 2010 project files and solution. This batch file calls Premake. Just open \path{Bullet/build/vs2010/0BulletSolution.sln}
12 \subsection{Premake Mac OSX Xcode project generation}
13 On Mac OSX it is easiest to open a Terminal window and switch current directory to Bullet/build and use the following command to generate XCode projects:
14  \begin{lstlisting}[caption=Premake for Mac OSX, label=premake_osx]
15 cd Bullet/build
16 ./premake_osx xcode4
17 open xcode4/0BulletSolution.xcworkspace
18 \end{lstlisting}
19
20 \subsection{Premake iOS Xcode project generation}
21 XCode project generation for iOS, such as iPhone and iPad, is similar to Mac OSX. Just provide the --ios option to premake and premake will automatically customize the project and append ios to the directory:
22  \begin{lstlisting}[caption=Premake for iOS, label=premake_ios]
23 cd Bullet/build
24 ./premake_osx --ios xcode4
25 open xcode4ios/0BulletSolution.xcworkspace
26 \end{lstlisting}
27 Note that Bullet comes with a modified version of \path{premake_osx} that enables the iOS specific customizations that are required by XCode.
28 \subsection{Premake GNU Makefile generation}
29 You can also generate GNU Makefiles for Mac OSX or Linux using premake:
30 \begin{lstlisting}[caption=Premake to GNU Makefile, label=premake_make]
31 cd Bullet/build
32 ./premake_osx gmake
33 cd gmake
34 make config=release64
35 \end{lstlisting}
36 \section{Using cmake}
37 Similar to premake, CMake adds support for many other build environments and platforms, including Microsoft Visual Studio, XCode for Mac OSX, KDevelop for Linux and Unix Makefiles. Download and install \index{CMake}CMake from \url{http://cmake.org} and use the CMake cmake-gui tool.
38 \section{Using autotools}
39 Open a shell terminal and go to the Bullet root directory. Then execute
40 \begin{lstlisting}[caption=autotools to Makefile, label=autotools_make]
41 ./autogen.sh
42 ./configure
43 make
44 \end{lstlisting}
45 The \path{autogen.sh} step is optional and not needed for downloaded packages.\r