You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
176 lines
6.2 KiB
176 lines
6.2 KiB
***********************************
|
|
* Build info for bulletjme *
|
|
* (c) 2011 Normen Hansen *
|
|
***********************************
|
|
|
|
This document outlines the process of building bullet-jme on different platforms.
|
|
Since bulletjme is a native java library and bullet gets included statically,
|
|
building requires downloading and building the bullet sources.
|
|
|
|
Note that you do need to have CMake and a GCC compiler installed as well as
|
|
the Android NDK in case you want to build for android too.
|
|
|
|
-----------------------------------
|
|
Requirements
|
|
-----------------------------------
|
|
ALL PLATFORMS
|
|
- Java SDK 1.5+: http://java.sun.com
|
|
- Apache ANT: http://ant.apache.org (included in most Java IDEs)
|
|
- Android NDK (optional): http://developer.android.com/sdk/ndk/index.html
|
|
|
|
WINDOWS
|
|
- Install mingw GNU C++ Compiler: http://www.mingw.org/
|
|
- Install CMake: http://www.cmake.org/
|
|
|
|
Mac OSX
|
|
- Install XCode: http://developer.apple.com/ (or via the App Store)
|
|
- Install the "Command Line Tools" from inside XCode
|
|
- Install http://www.macports.org
|
|
- Install cmake via macports, in the Terminal type:
|
|
> sudo port install cmake
|
|
|
|
LINUX
|
|
- Install cmake (and gcc if not available) via your package manager of choice, e.g.
|
|
> sudo apt-get install cmake
|
|
|
|
-----------------------------------
|
|
Building
|
|
-----------------------------------
|
|
The build script in this directory does everything needed to download and compile
|
|
bullet and the jme-bullet library, you only need to call the appropriate ant target,
|
|
via your IDE or command line:
|
|
|
|
> ant build-bullet-natives
|
|
|
|
..and all of the steps below are executed automatically, including the download.
|
|
|
|
You can alter options in the "nbproject/bullet.properties" file, such as the used
|
|
bullet version, native compilation options (see below), path to Android NDK etc.
|
|
|
|
-----------------------------------
|
|
Running
|
|
-----------------------------------
|
|
The resulting jMonkeyEngine3.jar containing the tests will automatically use the
|
|
jME3-jbullet.jar or jME3-bullet.jar, depending on which is available in the libs directory.
|
|
|
|
A convenience target exists to run the engine tests using the native bullet library:
|
|
|
|
> ant run-bullet-native
|
|
|
|
-----------------------------------
|
|
Altering the native build process
|
|
-----------------------------------
|
|
bullet-jme uses cpptasks to compile native code as well as the Android NDK.
|
|
|
|
If you get compilation errors, try setting "native.java.include" in the build.properties file to your
|
|
JDK include directory, e.g. /opt/java/include or "c:\Program Files\Java\jdk1.6.0_20\include".
|
|
|
|
To change the used compiler, edit the "native.platform.compiler" entry in the
|
|
"build.properties" file. The following c++ compilers work with cpptasks:
|
|
|
|
gcc GCC C++ compiler
|
|
g++ GCC C++ compiler
|
|
c++ GCC C++ compiler
|
|
msvc Microsoft Visual C++
|
|
bcc Borland C++ Compiler
|
|
icl Intel C++ compiler for Windows (IA-32)
|
|
ecl Intel C++ compiler for Windows (IA-64)
|
|
icc Intel C++ compiler for Linux (IA-32)
|
|
ecc Intel C++ compiler for Linux (IA-64)
|
|
CC Sun ONE C++ compiler
|
|
aCC HP aC++ C++ Compiler
|
|
wcl OpenWatcom C/C++ compiler
|
|
|
|
In the "nbproject" folder you can find "build-native-platform.xml" files containing the commands
|
|
to compile bullet-jme on different platforms. If you want to alter the process,
|
|
you can copy and modify one of the files and import it in the "build.xml" file instead
|
|
of the old one.
|
|
|
|
-----------------------------------
|
|
Netbeans Project
|
|
-----------------------------------
|
|
The engine NetBeans project also includes the native sources and a build configuration
|
|
entry to build the binary and run the tests with it.
|
|
|
|
To have correct syntax highlighting in .cpp/.h files:
|
|
|
|
- in Netbeans Settings -> C/C++ -> Code Assistance -> C++
|
|
- add bullet-2.79/src as include directories for C++
|
|
- add JAVA_HOME/include as include directories for C
|
|
|
|
|
|
|
|
***********************************
|
|
* Building bullet (optional) *
|
|
***********************************
|
|
|
|
-----------------------------------
|
|
General info
|
|
-----------------------------------
|
|
Note that the compilation of bullet should not produce dll / so / dylib files
|
|
but static *.a libraries which can later be compiled into the binary of bullet-jme.
|
|
|
|
-----------------------------------
|
|
Downloading and extracting bullet
|
|
-----------------------------------
|
|
Requirements:
|
|
- Bullet source: http://bullet.googlecode.com/
|
|
|
|
Extract bullet source and build bullet (see below)
|
|
|
|
-----------------------------------
|
|
Building on Mac OSX
|
|
-----------------------------------
|
|
Requirements:
|
|
- Apple Developer tools: http://developer.apple.com/
|
|
- CMake: http://www.cmake.org/ (or via http://www.macports.org)
|
|
|
|
Commands:
|
|
> cd bullet-trunk
|
|
> cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON \
|
|
-DCMAKE_OSX_ARCHITECTURES='ppc;i386;x86_64' \
|
|
-DBUILD_EXTRAS=off -DBUILD_DEMOS=off -DCMAKE_BUILD_TYPE=Release
|
|
> make
|
|
|
|
-----------------------------------
|
|
Building on WINDOWS (MinGW/GCC, Recommended)
|
|
-----------------------------------
|
|
Requirements:
|
|
- GNU C++ Compiler: http://www.mingw.org/
|
|
http://mingw-w64.sourceforge.net/
|
|
- CMake: http://www.cmake.org/
|
|
|
|
Commands:
|
|
> cd bullet-trunk
|
|
> cmake . -DBUILD_SHARED_LIBS=OFF -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release . -G "MinGW Makefiles"
|
|
> mingw32-make
|
|
|
|
-----------------------------------
|
|
Building on WINDOWS (VisualStudio, untested)
|
|
-----------------------------------
|
|
Requirements:
|
|
- Microsoft Visual Studio http://msdn.microsoft.com/
|
|
|
|
Bullet comes with autogenerated Project Files for Microsoft Visual Studio 6, 7, 7.1 and 8.
|
|
The main Workspace/Solution is located in Bullet/msvc/8/wksbullet.sln (replace 8 with your version).
|
|
|
|
Build the project to create static libraries.
|
|
|
|
|
|
-----------------------------------
|
|
Building bullet on LINUX
|
|
-----------------------------------
|
|
Requirements:
|
|
- Gnu C++ Compiler: http://gcc.gnu.org/
|
|
- CMake: http://www.cmake.org/ (or via your package manager of choice)
|
|
|
|
Commands:
|
|
> cd bullet-trunk
|
|
> cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC"\
|
|
-DBUILD_EXTRAS=off -DBUILD_DEMOS=off -DCMAKE_BUILD_TYPE=Release
|
|
> make
|
|
|
|
-----------------------------------
|
|
More info on building bullet
|
|
-----------------------------------
|
|
http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Installation
|
|
|