Revision: 8358
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8358&view=rev
Author:   natepak
Date:     2009-11-03 19:06:06 +0000 (Tue, 03 Nov 2009)

Log Message:
-----------
Added configure checks for bullet

Modified Paths:
--------------
    code/gazebo/trunk/cmake/FindOde.cmake
    code/gazebo/trunk/cmake/SearchForStuff.cmake
    code/gazebo/trunk/config.h.in
    code/gazebo/trunk/server/CMakeLists.txt
    code/gazebo/trunk/server/World.cc
    code/gazebo/trunk/server/physics/CMakeLists.txt
    code/gazebo/trunk/server/physics/PhysicsFactory.cc
    code/gazebo/trunk/worlds/simpleshapes.world

Modified: code/gazebo/trunk/cmake/FindOde.cmake
===================================================================
--- code/gazebo/trunk/cmake/FindOde.cmake       2009-11-03 18:05:44 UTC (rev 
8357)
+++ code/gazebo/trunk/cmake/FindOde.cmake       2009-11-03 19:06:06 UTC (rev 
8358)
@@ -39,11 +39,9 @@
 
 IF (NOT ODE_FOUND)
   BUILD_ERROR ("ODE and development files not found. See the following 
website: http://www.ode.org";)
+  SET (INCLUDE_ODE FALSE CACHE BOOL "Include support for ODE")
 ELSE (NOT ODE_FOUND)
-  #SET (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ODE_CFLAGS_OTHER}" 
CACHE INTERNAL "added dSINGLE" FORCE)
-  #SET (CMAKE_C_FLAGS_DEBUG   "${CMAKE_C_FLAGS_DEBUG}   ${ODE_CFLAGS_OTHER}" 
CACHE INTERNAL "added dSINGLE" FORCE)
-  #SET (CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${ODE_CFLAGS_OTHER}" 
CACHE INTERNAL "added dSINGLE" FORCE)
-  #MESSAGE (STATUS "\n\ndebug\n" ${CMAKE_C_FLAGS_DEBUG} "\n\n")
+  SET (INCLUDE_ODE TRUE CACHE BOOL "Include support for ODE")
 
   APPEND_TO_CACHED_LIST(gazeboserver_cflags
                         ${gazeboserver_cflags_desc}

Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake
===================================================================
--- code/gazebo/trunk/cmake/SearchForStuff.cmake        2009-11-03 18:05:44 UTC 
(rev 8357)
+++ code/gazebo/trunk/cmake/SearchForStuff.cmake        2009-11-03 19:06:06 UTC 
(rev 8358)
@@ -363,6 +363,7 @@
     bullet_softbody_library  AND 
     bullet_math_library AND
     bullet_include_dir)
+  SET (INCLUDE_BULLET FALSE CACHE BOOL "Include support for Bullet")
   MESSAGE (STATUS "Warning: Unable to find bullet. The bullet physics engine 
will not be supported.")
 ENDIF (bullet_dynamics_library AND 
        bullet_collision_library AND 

Modified: code/gazebo/trunk/config.h.in
===================================================================
--- code/gazebo/trunk/config.h.in       2009-11-03 18:05:44 UTC (rev 8357)
+++ code/gazebo/trunk/config.h.in       2009-11-03 19:06:06 UTC (rev 8358)
@@ -7,3 +7,5 @@
 #cmakedefine HAVE_FFMPEG 1
 #cmakedefine HAVE_LTDL 1
 #cmakedefine ENABLE_SHADOWS 0
+#cmakedefine INCLUDE_BULLET 0
+#cmakedefine INCLUDE_ODE 1

Modified: code/gazebo/trunk/server/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/server/CMakeLists.txt     2009-11-03 18:05:44 UTC (rev 
8357)
+++ code/gazebo/trunk/server/CMakeLists.txt     2009-11-03 19:06:06 UTC (rev 
8358)
@@ -140,13 +140,20 @@
                                    ${freeimage_library} 
                                    gazebo_av-shared
                                    gazebo_gui-shared
-                                   gazebo_physics_ode
-                                   gazebo_physics_bullet
                                    gazebo 
 )
 
-TARGET_LINK_LIBRARIES( gazebo_server ${ODE_LIBRARIES} ${libtool_library} 
${freeimage_library} gazebo)
+if (INCLUDE_BULLET)
+  TARGET_LINK_LIBRARIES(gazebo-exec gazebo_physics_bullet)
+endif (INCLUDE_BULLET)
 
+if (INCLUDE_ODE)
+  TARGET_LINK_LIBRARIES(gazebo-exec gazebo_physics_ode)
+  TARGET_LINK_LIBRARIES( gazebo_server ${ODE_LIBRARIES})
+endif (INCLUDE_ODE)
+
+TARGET_LINK_LIBRARIES( gazebo_server ${libtool_library} ${freeimage_library} 
gazebo)
+
 INSTALL (TARGETS gazebo-exec DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
 INSTALL (TARGETS gazebo_server DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
 INSTALL (FILES ${gazeboserver_headers} DESTINATION 
${CMAKE_INSTALL_PREFIX}/include/gazebo COMPONENT headers)

Modified: code/gazebo/trunk/server/World.cc
===================================================================
--- code/gazebo/trunk/server/World.cc   2009-11-03 18:05:44 UTC (rev 8357)
+++ code/gazebo/trunk/server/World.cc   2009-11-03 19:06:06 UTC (rev 8358)
@@ -183,7 +183,11 @@
 
   XMLConfigNode *physicsNode = rootNode->GetChildByNSPrefix("physics");
   if (Simulator::Instance()->GetPhysicsEnabled() && physicsNode)
+  {
     this->physicsEngine = PhysicsFactory::NewPhysicsEngine( 
physicsNode->GetName());
+    if (this->physicsEngine == NULL)
+      gzthrow("Unable to create physics engine\n");
+  }
 
   this->LoadEntities(rootNode, NULL, false);
 

Modified: code/gazebo/trunk/server/physics/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/server/physics/CMakeLists.txt     2009-11-03 18:05:44 UTC 
(rev 8357)
+++ code/gazebo/trunk/server/physics/CMakeLists.txt     2009-11-03 19:06:06 UTC 
(rev 8358)
@@ -1,8 +1,13 @@
 include (${gazebo_cmake_dir}/GazeboUtils.cmake)
 
-add_subdirectory(ode)
-add_subdirectory(bullet)
+if (INCLUDE_ODE)
+  add_subdirectory(ode)
+endif (INCLUDE_ODE)
 
+if (INCLUDE_BULLET)
+  add_subdirectory(bullet)
+endif (INCLUDE_BULLET)
+
 set (sources Body.cc
              PhysicsFactory.cc
              PhysicsEngine.cc

Modified: code/gazebo/trunk/server/physics/PhysicsFactory.cc
===================================================================
--- code/gazebo/trunk/server/physics/PhysicsFactory.cc  2009-11-03 18:05:44 UTC 
(rev 8357)
+++ code/gazebo/trunk/server/physics/PhysicsFactory.cc  2009-11-03 19:06:06 UTC 
(rev 8358)
@@ -27,9 +27,15 @@
 
 #include "PhysicsEngine.hh"
 #include "PhysicsFactory.hh"
+#include "config.h"
 
+#ifdef INCLUDE_ODE
 void RegisterODEPhysics();
+#endif
+
+#ifdef INCLUDE_BULLET
 void RegisterBulletPhysics();
+#endif
 
 using namespace gazebo;
 
@@ -39,8 +45,13 @@
 /// Register everything
 void PhysicsFactory::RegisterAll()
 {
+#ifdef INCLUDE_ODE
   RegisterODEPhysics();
+#endif
+
+#ifdef INCLUDE_BULLET
   RegisterBulletPhysics();
+#endif
 }
 
 
////////////////////////////////////////////////////////////////////////////////

Modified: code/gazebo/trunk/worlds/simpleshapes.world
===================================================================
--- code/gazebo/trunk/worlds/simpleshapes.world 2009-11-03 18:05:44 UTC (rev 
8357)
+++ code/gazebo/trunk/worlds/simpleshapes.world 2009-11-03 19:06:06 UTC (rev 
8358)
@@ -14,7 +14,7 @@
 
   <verbosity>5</verbosity>
 
-  <physics:ode>
+  <physics:bullet>
     <stepTime>0.001</stepTime>
     <gravity>0 0 -9.8</gravity>
     <cfm>10e-2</cfm>
@@ -24,7 +24,7 @@
                       0 == No throttling
                      >0 == Frequency at which to throttle the sim --> 
     <updateRate>0</updateRate>
-  </physics:ode>
+  </physics:bullet>
 
   <rendering:gui>
     <type>fltk</type>


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to