building.tex 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. \section{Using Premake}
  5. \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.
  6. \subsection{Premake Visual Studio project generation}
  7. 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}. Newer versions of Visual Studio should automatically convert from the 2010 solution.
  8. \subsection{Premake Mac OSX Xcode project generation}
  9. 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:
  10. \begin{lstlisting}[caption=Premake for Mac OSX, label=premake_osx]
  11. cd Bullet/build
  12. ./premake_osx xcode4
  13. open xcode4/0BulletSolution.xcworkspace
  14. \end{lstlisting}
  15. \subsection{Premake GNU Makefile generation}
  16. You can also generate GNU Makefiles for Mac OSX or Linux using premake:
  17. \begin{lstlisting}[caption=Premake to GNU Makefile, label=premake_make]
  18. cd Bullet/build
  19. ./premake_osx gmake
  20. cd gmake
  21. make config=release64
  22. \end{lstlisting}
  23. \section{Using cmake}
  24. 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. Alternatively use a terminal, change to the Bullet root directory and use for example the following commands:
  25. \begin{lstlisting}[caption=CMake to GNU Makefile, label=cmake_make]
  26. cmake .
  27. make
  28. \end{lstlisting}
  29. An example to create an XCode project on Mac OSX using CMake:
  30. \begin{lstlisting}[caption=CMake to Xcode, label=cmake_xcode]
  31. mkdir xcode
  32. cd xcode
  33. cmake .. -G Xcode
  34. open BULLET_PHYSICS.xcodeproj
  35. \end{lstlisting}
  36. \section{Executing the Example Browser}
  37. After building the SDK, there are some binary executables in the bin folder. You can execute the $bin/App_ExampleBrowser_*$ to experiment with the Bullet Physics SDK.