I use Fedora 11 and I have been able to compile and install Box2D 2.1.2 without changing the sources or the makefiles.
I do this to build:
Code:
cd Box2D/Build
cmake -DBOX2D_VERSION=2.1.2 \
-DBOX2D_INSTALL=ON \
-DBOX2D_INSTALL_DOC=ON \
-DBOX2D_BUILD_SHARED=ON \
-DBOX2D_BUILD_STATIC=OFF \
-DBOX2D_BUILD_EXAMPLES=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE=ON \
..
make
Then I do this to install to /usr/local:
Code:
make preinstall
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -P cmake_install.cmake
I have used a similar procedure to make my own RPM package (which installs under /usr).
In my game code, I use this: #include <Box2D/Box2D.h>
If the library is installed under /usr/local, the compiler would need to receive "-I/usr/local/include" for the includes and "-L/usr/local/lib -lBox2D" for linking.
My RPM package installs a .pc file that allows the pkg-config command to provide these compiler and linker switches.