From 3a27e8b1bf59f41c388e8ae61c25546495bdeb7a Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Wed, 9 Aug 2006 19:38:21 +0000 Subject: [PATCH] Added preliminary CMake buildsystem support, it can autogenerate projectfiles/makefiles etc. Including Mac OS X Xcode. This provides a better maintainable alternative to jam/msvcgen --- Bullet/BroadphaseCollision/AxisSweep3.cpp | 1 + Bullet/CMakeLists.txt | 58 +++++++++++++++++ BulletDynamics/CMakeLists.txt | 17 +++++ CMakeLists.txt | 3 + Demos/CMakeLists.txt | 2 + Demos/CcdPhysicsDemo/CMakeLists.txt | 62 +++++++++++++++++++ Extras/CMakeLists.txt | 1 + Extras/PhysicsInterface/CMakeLists.txt | 1 + .../CcdPhysics/CMakeLists.txt | 11 ++++ .../CcdPhysics/SimulationIsland.cpp | 8 +-- Extras/PhysicsInterface/Common/CMakeLists.txt | 10 +++ LinearMath/CMakeLists.txt | 10 +++ changes.txt | 5 ++ 13 files changed, 185 insertions(+), 4 deletions(-) create mode 100644 Bullet/CMakeLists.txt create mode 100644 BulletDynamics/CMakeLists.txt create mode 100644 CMakeLists.txt create mode 100644 Demos/CMakeLists.txt create mode 100644 Demos/CcdPhysicsDemo/CMakeLists.txt create mode 100644 Extras/CMakeLists.txt create mode 100644 Extras/PhysicsInterface/CMakeLists.txt create mode 100644 Extras/PhysicsInterface/CcdPhysics/CMakeLists.txt create mode 100644 Extras/PhysicsInterface/Common/CMakeLists.txt create mode 100644 LinearMath/CMakeLists.txt diff --git a/Bullet/BroadphaseCollision/AxisSweep3.cpp b/Bullet/BroadphaseCollision/AxisSweep3.cpp index 235afa1f9..371fc643d 100644 --- a/Bullet/BroadphaseCollision/AxisSweep3.cpp +++ b/Bullet/BroadphaseCollision/AxisSweep3.cpp @@ -3,6 +3,7 @@ //Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + // // AxisSweep3 // diff --git a/Bullet/CMakeLists.txt b/Bullet/CMakeLists.txt new file mode 100644 index 000000000..06909469f --- /dev/null +++ b/Bullet/CMakeLists.txt @@ -0,0 +1,58 @@ + +INCLUDE_DIRECTORIES( +${BULLET_PHYSICS_SOURCE_DIR}/LinearMath ${BULLET_PHYSICS_SOURCE_DIR}/Bullet } +) + +ADD_LIBRARY(BULLET_COLLISION + BroadphaseCollision/AxisSweep3.cpp + BroadphaseCollision/BroadphaseProxy.cpp + BroadphaseCollision/CollisionAlgorithm.cpp + BroadphaseCollision/Dispatcher.cpp + BroadphaseCollision/OverlappingPairCache.cpp + BroadphaseCollision/SimpleBroadphase.cpp + CollisionDispatch/CollisionDispatcher.cpp + CollisionDispatch/CollisionObject.cpp + CollisionDispatch/CollisionWorld.cpp + CollisionDispatch/CompoundCollisionAlgorithm.cpp + CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp + CollisionDispatch/ConvexConvexAlgorithm.cpp + CollisionDispatch/EmptyCollisionAlgorithm.cpp + CollisionDispatch/ManifoldResult.cpp + CollisionDispatch/SimulationIslandManager.cpp + CollisionDispatch/UnionFind.cpp + CollisionShapes/BoxShape.cpp + CollisionShapes/BvhTriangleMeshShape.cpp + CollisionShapes/CollisionShape.cpp + CollisionShapes/CompoundShape.cpp + CollisionShapes/ConcaveShape.cpp + CollisionShapes/ConeShape.cpp + CollisionShapes/ConvexHullShape.cpp + CollisionShapes/ConvexShape.cpp + CollisionShapes/ConvexTriangleMeshShape.cpp + CollisionShapes/CylinderShape.cpp + CollisionShapes/EmptyShape.cpp + CollisionShapes/MinkowskiSumShape.cpp + CollisionShapes/MultiSphereShape.cpp + CollisionShapes/OptimizedBvh.cpp + CollisionShapes/PolyhedralConvexShape.cpp + CollisionShapes/Simplex1to4Shape.cpp + CollisionShapes/SphereShape.cpp + CollisionShapes/StaticPlaneShape.cpp + CollisionShapes/StridingMeshInterface.cpp + CollisionShapes/TriangleCallback.cpp + CollisionShapes/TriangleIndexVertexArray.cpp + CollisionShapes/TriangleMesh.cpp + CollisionShapes/TriangleMeshShape.cpp + NarrowPhaseCollision/ContinuousConvexCollision.cpp + NarrowPhaseCollision/ConvexCast.cpp + NarrowPhaseCollision/GjkConvexCast.cpp + NarrowPhaseCollision/GjkPairDetector.cpp + NarrowPhaseCollision/Hull.cpp + NarrowPhaseCollision/ManifoldContactAddResult.cpp + NarrowPhaseCollision/MinkowskiPenetrationDepthSolver.cpp + NarrowPhaseCollision/PersistentManifold.cpp + NarrowPhaseCollision/RaycastCallback.cpp + NarrowPhaseCollision/Shape.cpp + NarrowPhaseCollision/SubSimplexConvexCast.cpp + NarrowPhaseCollision/VoronoiSimplexSolver.cpp +) diff --git a/BulletDynamics/CMakeLists.txt b/BulletDynamics/CMakeLists.txt new file mode 100644 index 000000000..36b314f98 --- /dev/null +++ b/BulletDynamics/CMakeLists.txt @@ -0,0 +1,17 @@ +INCLUDE_DIRECTORIES( +${BULLET_PHYSICS_SOURCE_DIR}/LinearMath ${BULLET_PHYSICS_SOURCE_DIR}/Bullet ${BULLET_PHYSICS_SOURCE_DIR}/BulletDynamics } +) + +ADD_LIBRARY(BULLET_DYNAMICS + + ConstraintSolver/ContactConstraint.cpp + ConstraintSolver/Generic6DofConstraint.cpp + ConstraintSolver/HingeConstraint.cpp + ConstraintSolver/Point2PointConstraint.cpp + ConstraintSolver/SequentialImpulseConstraintSolver.cpp + ConstraintSolver/Solve2LinearConstraint.cpp + ConstraintSolver/TypedConstraint.cpp + Dynamics/BU_Joint.cpp + Dynamics/ContactJoint.cpp + Dynamics/RigidBody.cpp +) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..937b5eecc --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,3 @@ +PROJECT(BULLET_PHYSICS) + +SUBDIRS(LinearMath Bullet BulletDynamics Demos Extras) diff --git a/Demos/CMakeLists.txt b/Demos/CMakeLists.txt new file mode 100644 index 000000000..808908eb9 --- /dev/null +++ b/Demos/CMakeLists.txt @@ -0,0 +1,2 @@ +SUBDIRS( OpenGL CcdPhysicsDemo ) + diff --git a/Demos/CcdPhysicsDemo/CMakeLists.txt b/Demos/CcdPhysicsDemo/CMakeLists.txt new file mode 100644 index 000000000..170b04b45 --- /dev/null +++ b/Demos/CcdPhysicsDemo/CMakeLists.txt @@ -0,0 +1,62 @@ +# This is basically the overall name of the project in Visual Studio this is the name of the Solution File + + +# For every executable you have with a main method you should have an add_executable line below. +# For every add executable line you should list every .cpp and .h file you have associated with that executable. + + +# This is the variable for Windows. I use this to define the root of my directory structure. +SET(GLUT_ROOT ${BULLET_PHYSICS_SOURCE_DIR}/Glut) + +# You shouldn't have to modify anything below this line +######################################################## + + +# This is the shortcut to finding GLU, GLUT and OpenGL if they are properly installed on your system +# This should be the case. +INCLUDE (${CMAKE_ROOT}/Modules/FindGLU.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/FindGLUT.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake) + + +IF (WIN32) + # This is the Windows code for which Opengl, and Glut are not properly installed + # since I can't install them I must cheat and copy libraries around + INCLUDE_DIRECTORIES(${GLUT_ROOT}) + # LINK_DIRECTORIES(${GLUT_ROOT}\\lib) + IF (${GLUT_glut_LIBRARY} MATCHES "GLUT_glut_LIBRARY-NOTFOUND") + SET(GLUT_glut_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/Glut/glut32.lib) + # LINK_LIBRARIES(${GLUT_ROOT}\\lib\\glut32 ${OPENGL_gl_LIBRARY} ${OPENGL_glU_LIBRARY}) + # TARGET_LINK_LIBRARIES(table ${GLUT_ROOT}\\lib\\glut32) +# +# ADD_CUSTOM_COMMAND(TARGET table POST_BUILD COMMAND copy ${GLUT_ROOT}\\lib\\glut32.dll ${GLUT_ROOT}\\bin\\vs2005\\Debug +# COMMAND copy ${GLUT_ROOT}\\lib\\glut32.dll ${GLUT_ROOT}\\bin\\vs2003\\Debug +# COMMAND copy ${GLUT_ROOT}\\lib\\glut32.dll ${GLUT_ROOT}\\bin\\vs6\\Debug) + ELSE (${GLUT_glut_LIBRARY} MATCHES "GLUT_glut_LIBRARY-NOTFOUND") +# LINK_LIBRARIES(${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glU_LIBRARY}) +# TARGET_LINK_LIBRARIES(table ${GLUT_glut_LIBRARY}) + ENDIF(${GLUT_glut_LIBRARY} MATCHES "GLUT_glut_LIBRARY-NOTFOUND") +# TARGET_LINK_LIBRARIES(table ${OPENGL_gl_LIBRARY}) +# TARGET_LINK_LIBRARIES(table ${OPENGL_glu_LIBRARY}) +ELSE (WIN32) + # This is the lines for linux. This should always work if everything is installed and working fine. +# SET(CMAKE_BUILD_TYPE Debug) +# SET(CMAKE_CXX_FLAGS_DEBUG "-g") + INCLUDE_DIRECTORIES(/usr/include /usr/local/include ${GLUT_INCLUDE_DIR}) +# TARGET_LINK_LIBRARIES(table ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glU_LIBRARY}) +# TARGET_LINK_LIBRARIES(checker ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glU_LIBRARY}) +ENDIF (WIN32) + +INCLUDE_DIRECTORIES( +${BULLET_PHYSICS_SOURCE_DIR}/LinearMath ${BULLET_PHYSICS_SOURCE_DIR}/Bullet ${BULLET_PHYSICS_SOURCE_DIR}/BulletDynamics ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL ${BULLET_PHYSICS_SOURCE_DIR}/Extras/PhysicsInterface/Common ${BULLET_PHYSICS_SOURCE_DIR}/Extras/PhysicsInterface/CcdPhysics } +) + +LINK_LIBRARIES( +CCD_PHYSICS_INTERFACE OPENGL_SUPPORT BULLET_DYNAMICS PHYSICS_COMMON_INTERFACE BULLET_COLLISION LINEAR_MATH ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glU_LIBRARY} +) + +ADD_EXECUTABLE(CCD_PHYSICS_DEMO + CcdPhysicsDemo.cpp + MyMotionState.cpp +) + diff --git a/Extras/CMakeLists.txt b/Extras/CMakeLists.txt new file mode 100644 index 000000000..b3703eed4 --- /dev/null +++ b/Extras/CMakeLists.txt @@ -0,0 +1 @@ +SUBDIRS( PhysicsInterface ) diff --git a/Extras/PhysicsInterface/CMakeLists.txt b/Extras/PhysicsInterface/CMakeLists.txt new file mode 100644 index 000000000..1702f9822 --- /dev/null +++ b/Extras/PhysicsInterface/CMakeLists.txt @@ -0,0 +1 @@ +SUBDIRS( CcdPhysics Common ) diff --git a/Extras/PhysicsInterface/CcdPhysics/CMakeLists.txt b/Extras/PhysicsInterface/CcdPhysics/CMakeLists.txt new file mode 100644 index 000000000..d0e610e43 --- /dev/null +++ b/Extras/PhysicsInterface/CcdPhysics/CMakeLists.txt @@ -0,0 +1,11 @@ +INCLUDE_DIRECTORIES( +${BULLET_PHYSICS_SOURCE_DIR}/LinearMath ${BULLET_PHYSICS_SOURCE_DIR}/Bullet ${BULLET_PHYSICS_SOURCE_DIR}/BulletDynamics ${BULLET_PHYSICS_SOURCE_DIR}/Extras/PhysicsInterface/Common ${BULLET_PHYSICS_SOURCE_DIR}/Extras/PhysicsInterface/CcdPhysics } +) + +ADD_LIBRARY(CCD_PHYSICS_INTERFACE + CcdPhysicsController.cpp + CcdPhysicsEnvironment.cpp + ParallelIslandDispatcher.cpp + ParallelPhysicsEnvironment.cpp + SimulationIsland.cpp +) \ No newline at end of file diff --git a/Extras/PhysicsInterface/CcdPhysics/SimulationIsland.cpp b/Extras/PhysicsInterface/CcdPhysics/SimulationIsland.cpp index 60a35e985..7cca9f503 100644 --- a/Extras/PhysicsInterface/CcdPhysics/SimulationIsland.cpp +++ b/Extras/PhysicsInterface/CcdPhysics/SimulationIsland.cpp @@ -455,10 +455,10 @@ void SimulationIsland::UpdateAabbs(IDebugDraw* debugDrawer,BroadphaseInterface* if (reportMe) { reportMe = false; - printf("Overflow in AABB, object removed from simulation \n"); - printf("If you can reproduce this, please email bugs@continuousphysics.com\n"); - printf("Please include above information, your Platform, version of OS.\n"); - printf("Thanks.\n"); + //printf("Overflow in AABB, object removed from simulation \n"); + //printf("If you can reproduce this, please email bugs@continuousphysics.com\n"); + //printf("Please include above information, your Platform, version of OS.\n"); + //printf("Thanks.\n"); } } diff --git a/Extras/PhysicsInterface/Common/CMakeLists.txt b/Extras/PhysicsInterface/Common/CMakeLists.txt new file mode 100644 index 000000000..f1ab867a2 --- /dev/null +++ b/Extras/PhysicsInterface/Common/CMakeLists.txt @@ -0,0 +1,10 @@ +INCLUDE_DIRECTORIES( +${BULLET_PHYSICS_SOURCE_DIR}/LinearMath ${BULLET_PHYSICS_SOURCE_DIR}/Extras/PhysicsInterface/Common } +) + +ADD_LIBRARY(PHYSICS_COMMON_INTERFACE + PHY_IMotionState.cpp + PHY_IPhysicsController.cpp + PHY_IPhysicsEnvironment.cpp + PHY_IVehicle.cpp +) \ No newline at end of file diff --git a/LinearMath/CMakeLists.txt b/LinearMath/CMakeLists.txt new file mode 100644 index 000000000..97e483b7e --- /dev/null +++ b/LinearMath/CMakeLists.txt @@ -0,0 +1,10 @@ +ADD_LIBRARY(LINEAR_MATH +Geometry.cpp +Quat.cpp +Vector.cpp +quickprof.cpp +Matrix.cpp +Scalar.cpp +VectorBase.cpp +) + diff --git a/changes.txt b/changes.txt index 2cfe6aec8..e73385ac7 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,11 @@ Bullet Continuous Collision Detection and Physics Library Erwin Coumans +2006 August 9 + Added CMake support (see http://cmake.org) + This can autogenerate makefiles, projectfiles cross platform (including MacOS X Xcode ) + Just run cmake . in the root folder and it will autogenerate build files + 2006 July 26 Erwin Coumans Upgraded to COLLADA-DOM 1.4.1, latest SVN version ColladaDemo can export snapshots to .dae