Ugh. Been fighting with this for at least an hour now, but I think I've finally found a solution.
First install cmake and grab the latest version of Box2D. Then create a file called CMakeLists.txt in box2d-read-only/Box2D/Box2D. Then cd in there and cmake .;make
Took me forever to figure out how to do recursive globs, but then cmake generates a few of its own .cpp files for some reason, which get included in the glob unless you choose the folders specifically... so I don't know how to do this with a single glob.
Anywho, this should generate libBox2D.a, which you can theoretically use in your own projects, except I haven't got that far yet.
Edit: Yeah, it works great.
First install cmake and grab the latest version of Box2D. Then create a file called CMakeLists.txt in box2d-read-only/Box2D/Box2D. Then cd in there and cmake .;make
Code:
cmake_minimum_required(VERSION 2.6)
project(Box2D)
file(GLOB_RECURSE COLLISION ./Collision/*.cpp)
file(GLOB_RECURSE COMMON ./Common/*.cpp)
file(GLOB_RECURSE DYNAMICS ./Dynamics/*.cpp)
include_directories(../)
add_library(Box2D STATIC ${COLLISION} ${COMMON} ${DYNAMICS})
project(Box2D)
file(GLOB_RECURSE COLLISION ./Collision/*.cpp)
file(GLOB_RECURSE COMMON ./Common/*.cpp)
file(GLOB_RECURSE DYNAMICS ./Dynamics/*.cpp)
include_directories(../)
add_library(Box2D STATIC ${COLLISION} ${COMMON} ${DYNAMICS})
Took me forever to figure out how to do recursive globs, but then cmake generates a few of its own .cpp files for some reason, which get included in the glob unless you choose the folders specifically... so I don't know how to do this with a single glob.
Anywho, this should generate libBox2D.a, which you can theoretically use in your own projects, except I haven't got that far yet.
Edit: Yeah, it works great.