Browse Source

CMake: Build panda3d.ode.

Sam Edwards 12 years ago
parent
commit
3c240ae0cd
2 changed files with 84 additions and 1 deletions
  1. 8 1
      panda/CMakeLists.txt
  2. 76 0
      panda/src/ode/CMakeLists.txt

+ 8 - 1
panda/CMakeLists.txt

@@ -61,9 +61,12 @@ add_subdirectory(src/egg2pg)
 add_subdirectory(src/framework)
 add_subdirectory(src/testbed)
 
-# For other metalibs
+# For other components
+# physics
 add_subdirectory(src/physics)
 add_subdirectory(src/particlesystem)
+# ode
+add_subdirectory(src/ode)
 
 # Include panda metalibs
 add_subdirectory(metalibs/panda)
@@ -93,3 +96,7 @@ if(HAVE_EGG)
 endif()
 
 add_python_module(physics p3physics p3particlesystem)
+
+if(HAVE_ODE)
+  add_python_module(ode p3ode)
+endif()

+ 76 - 0
panda/src/ode/CMakeLists.txt

@@ -0,0 +1,76 @@
+if(HAVE_ODE)
+  set(P3ODE_HEADERS
+      ode_includes.h config_ode.h
+      odeWorld.I odeWorld.h
+      odeMass.I odeMass.h
+      odeBody.I odeBody.h
+      odeJointGroup.I odeJointGroup.h
+      odeJoint.I odeJoint.h
+      odeUtil.h
+      odeSpace.I odeSpace.h
+      odeGeom.I odeGeom.h
+      odeSurfaceParameters.I odeSurfaceParameters.h
+      odeContactGeom.I odeContactGeom.h
+      odeContact.I odeContact.h
+      odeAMotorJoint.I odeAMotorJoint.h
+      odeBallJoint.I odeBallJoint.h
+      odeContactJoint.I odeContactJoint.h
+      odeFixedJoint.I odeFixedJoint.h
+      odeHingeJoint.I odeHingeJoint.h
+      odeHinge2Joint.I odeHinge2Joint.h
+      odeLMotorJoint.I odeLMotorJoint.h
+      odeNullJoint.I odeNullJoint.h
+      odePlane2dJoint.I odePlane2dJoint.h
+      odeSliderJoint.I odeSliderJoint.h
+      odeUniversalJoint.I odeUniversalJoint.h
+      odeJointCollection.I odeJointCollection.h
+      odeSimpleSpace.I odeSimpleSpace.h
+      odeHashSpace.I odeHashSpace.h
+      odeQuadTreeSpace.I odeQuadTreeSpace.h
+      odeSphereGeom.I odeSphereGeom.h
+      odeBoxGeom.I odeBoxGeom.h
+      odePlaneGeom.I odePlaneGeom.h
+      odeCappedCylinderGeom.I odeCappedCylinderGeom.h
+      odeCylinderGeom.I odeCylinderGeom.h
+      odeRayGeom.I odeRayGeom.h
+      odeTriMeshData.I odeTriMeshData.h
+      odeTriMeshGeom.I odeTriMeshGeom.h
+      odeCollisionEntry.I odeCollisionEntry.h
+      odeHelperStructs.h)
+
+  set(P3ODE_SOURCES
+      config_ode.cxx
+      odeWorld.cxx odeMass.cxx odeBody.cxx
+      odeJointGroup.cxx odeJoint.cxx
+      odeUtil.cxx
+      odeSpace.cxx
+      odeGeom.cxx
+      odeSurfaceParameters.cxx
+      odeContactGeom.cxx odeContact.cxx
+      odeAMotorJoint.cxx odeBallJoint.cxx
+      odeContactJoint.cxx odeFixedJoint.cxx
+      odeHingeJoint.cxx odeHinge2Joint.cxx
+      odeLMotorJoint.cxx odeNullJoint.cxx
+      odePlane2dJoint.cxx odeSliderJoint.cxx
+      odeUniversalJoint.cxx odeJointCollection.cxx
+      odeSimpleSpace.cxx
+      odeHashSpace.cxx odeQuadTreeSpace.cxx
+      odeSphereGeom.cxx odeBoxGeom.cxx
+      odePlaneGeom.cxx odeCappedCylinderGeom.cxx
+      odeCylinderGeom.cxx odeRayGeom.cxx
+      odeTriMeshData.cxx  odeTriMeshGeom.cxx
+      odeCollisionEntry.cxx)
+
+  set(P3ODE_IGATE_SOURCES "${P3ODE_HEADERS};${P3ODE_SOURCES}")
+  list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeConvexGeom.h")
+  list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHeightFieldGeom.h")
+  list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h")
+
+  composite_sources(p3ode P3ODE_SOURCES)
+  add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS})
+  set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE)
+  target_link_libraries(p3ode p3pgraph p3physics ${ODE_LIBRARY})
+  target_interrogate(p3ode ${P3ODE_IGATE_SOURCES})
+
+  install(TARGETS p3ode DESTINATION lib)
+endif()