Revision: 8499 http://playerstage.svn.sourceforge.net/playerstage/?rev=8499&view=rev Author: natepak Date: 2010-01-13 16:26:39 +0000 (Wed, 13 Jan 2010)
Log Message: ----------- Modified build to use either the internal version of assimp, or an externally built version Modified Paths: -------------- code/gazebo/trunk/3rd_party/assimp/include/CMakeLists.txt code/gazebo/trunk/CMakeLists.txt code/gazebo/trunk/cmake/SearchForStuff.cmake code/gazebo/trunk/config.h.in code/gazebo/trunk/server/CMakeLists.txt code/gazebo/trunk/server/rendering/OgreAdaptor.cc code/gazebo/trunk/server/sensors/camera/StereoCameraSensor.cc Modified: code/gazebo/trunk/3rd_party/assimp/include/CMakeLists.txt =================================================================== --- code/gazebo/trunk/3rd_party/assimp/include/CMakeLists.txt 2010-01-13 05:04:28 UTC (rev 8498) +++ code/gazebo/trunk/3rd_party/assimp/include/CMakeLists.txt 2010-01-13 16:26:39 UTC (rev 8499) @@ -1,4 +1,4 @@ -INCLUDE (${gazebo_cmake_dir}/GazeboUtils.cmake) +include (${gazebo_cmake_dir}/GazeboUtils.cmake) add_subdirectory(assimp) Modified: code/gazebo/trunk/CMakeLists.txt =================================================================== --- code/gazebo/trunk/CMakeLists.txt 2010-01-13 05:04:28 UTC (rev 8498) +++ code/gazebo/trunk/CMakeLists.txt 2010-01-13 16:26:39 UTC (rev 8499) @@ -11,39 +11,39 @@ SET (GAZEBO_VERSION 0.9.0) MESSAGE (STATUS "${PROJECT_NAME} version ${GAZEBO_VERSION}") -SET (BUILD_GAZEBO ON CACHE INTERNAL "Build Gazebo" FORCE) +set (BUILD_GAZEBO ON CACHE INTERNAL "Build Gazebo" FORCE) -SET (gazeboserver_sources_desc "List of server sources" +set (gazeboserver_sources_desc "List of server sources" CACHE INTERNAL "Gazebo server sources list description" FORCE) -SET (gazeboserver_headers_desc "List of server headers" +set (gazeboserver_headers_desc "List of server headers" CACHE INTERNAL "Gazebo server headers list description" FORCE) -SET (gazeboserver_include_dirs_desc "List of server include directories" +set (gazeboserver_include_dirs_desc "List of server include directories" CACHE INTERNAL "Include dirs description") -SET (gazeboserver_link_dirs_desc "List of server link directories" +set (gazeboserver_link_dirs_desc "List of server link directories" CACHE INTERNAL "Link dirs description" FORCE) -SET (gazeboserver_link_libs_desc "List of server link libraries" +set (gazeboserver_link_libs_desc "List of server link libraries" CACHE INTERNAL "Link libs description" FORCE) -SET (gazeboserver_cflags_desc "List of server cflags" +set (gazeboserver_cflags_desc "List of server cflags" CACHE INTERNAL "Server cflags description" FORCE) -SET (gazebosensor_sources_desc "List of sensor sources" +set (gazebosensor_sources_desc "List of sensor sources" CACHE INTERNAL "Gazebo sensor sources list description" FORCE) -SET (gazebocontroller_sources_desc "List of controller sources" +set (gazebocontroller_sources_desc "List of controller sources" CACHE INTERNAL "Gazebo controller sources list description" FORCE) -SET (bullet_link_libs_desc "List of bullet link libraries" +set (bullet_link_libs_desc "List of bullet link libraries" CACHE INTERNAL "Bullet link libs description" FORCE) -SET (OGRE_VERSION 1.6.3 CACHE INTERNAL "Ogre version requirement" FORCE) +set (MIN_OGRE_VERSION 1.6.3 CACHE INTERNAL "Ogre version requirement" FORCE) -SET (FREEIMAGE_MAJOR_VERSION 3 CACHE INTERNAL "FreeImage major version requirement" FORCE) -SET (FREEIMAGE_MINOR_VERSION 9 CACHE INTERNAL "FreeImage minor version requirement" FORCE) -SET (FREEIMAGE_VERSION ${FREEIMAGE_MAJOR_VERSION}.${FREEIMAGE_MINOR_VERSION}.0 CACHE INTERNAL "FreeImage version requirement" FORCE) -SET (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE version requirement" FORCE) -SET (MIN_BOOST_VERSION 1.35.0 CACHE INTERNAL "Boost min version requirement" FORCE) +set (FREEIMAGE_MAJOR_VERSION 3 CACHE INTERNAL "FreeImage major version requirement" FORCE) +set (FREEIMAGE_MINOR_VERSION 9 CACHE INTERNAL "FreeImage minor version requirement" FORCE) +set (FREEIMAGE_VERSION ${FREEIMAGE_MAJOR_VERSION}.${FREEIMAGE_MINOR_VERSION}.0 CACHE INTERNAL "FreeImage version requirement" FORCE) +set (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE version requirement" FORCE) +set (MIN_BOOST_VERSION 1.35.0 CACHE INTERNAL "Boost min version requirement" FORCE) -SET (ENABLE_BINDINGS OFF CACHE BOOL "Enable libgazebo bindings") +set (ENABLE_BINDINGS OFF CACHE BOOL "Enable libgazebo bindings") -SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH +set (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") INCLUDE (${gazebo_cmake_dir}/DissectVersion.cmake) @@ -95,24 +95,28 @@ message (STATUS "Cmake C Flags:${CMAKE_C_FLAGS}") - IF (BUILD_GAZEBO) - #ADD_SUBDIRECTORY(3rd_party) - ADD_SUBDIRECTORY(libgazebo) - ADD_SUBDIRECTORY(server) - ADD_SUBDIRECTORY(worlds) - ADD_SUBDIRECTORY(Media) + if (BUILD_GAZEBO) + + if (use_internal_assimp) + add_subdirectory(3rd_party) + endif (use_internal_assimp) + + add_subdirectory(libgazebo) + add_subdirectory(server) + add_subdirectory(worlds) + add_subdirectory(Media) - IF (INCLUDE_PLAYER) - ADD_SUBDIRECTORY(player) - ENDIF (INCLUDE_PLAYER) + if (INCLUDE_PLAYER) + add_subdirectory(player) + endif (INCLUDE_PLAYER) - IF (INCLUDE_WEBGAZEBO) - Add_SUBDIRECTORY(webgazebo) - ENDIF (INCLUDE_WEBGAZEBO) + if (INCLUDE_WEBGAZEBO) + add_subdirectory(webgazebo) + endif (INCLUDE_WEBGAZEBO) - MESSAGE (STATUS "Build Type: ${CMAKE_BUILD_TYPE}") - MESSAGE (STATUS "Install path: ${CMAKE_INSTALL_PREFIX}") - ENDIF (BUILD_GAZEBO) + message (STATUS "Build Type: ${CMAKE_BUILD_TYPE}") + message (STATUS "Install path: ${CMAKE_INSTALL_PREFIX}") + endif (BUILD_GAZEBO) # Cpack stuff INCLUDE (InstallRequiredSystemLibraries) Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake =================================================================== --- code/gazebo/trunk/cmake/SearchForStuff.cmake 2010-01-13 05:04:28 UTC (rev 8498) +++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2010-01-13 16:26:39 UTC (rev 8499) @@ -12,33 +12,35 @@ #endif (NOT FLTK_FOUND) -SET (INCLUDE_WEBGAZEBO ON CACHE BOOL "Build webgazebo" FORCE) -SET (OGRE_LIBRARY_PATH "/usr/local/lib" CACHE INTERNAL "Ogre library path") +set (use_internal_assimp OFF CACHE BOOL "Use internal assimp" FORCE) -SET (assimp_include_dirs "" CACHE STRING "Assimp include paths. Use this to override automatic detection.") -SET (assimp_library_dirs "" CACHE STRING "Assimp library paths. Use this to override automatic detection.") -SET (assimp_libraries "" CACHE STRING "Assimp libraries Use this to override automatic detection.") +set (INCLUDE_WEBGAZEBO ON CACHE BOOL "Build webgazebo" FORCE) +set (OGRE_LIBRARY_PATH "/usr/local/lib" CACHE INTERNAL "Ogre library path") -SET (boost_include_dirs "" CACHE STRING "Boost include paths. Use this to override automatic detection.") -SET (boost_library_dirs "" CACHE STRING "Boost library paths. Use this to override automatic detection.") -SET (boost_libraries "" CACHE STRING "Boost libraries. Use this to override automatic detection.") -SET (bullet_dynamics_dirs "" CACHE STRING "Bullet Dynamics libraries. Use this to override automatic detection.") -SET (bullet_collision_dirs "" CACHE STRING "Bullet Collision libraries. Use this to override automatic detection.") -SET (bullet_softbody_dirs "" CACHE STRING "Bullet Softbody libraries. Use this to override automatic detection.") -SET (bullet_math_dirs "" CACHE STRING "Bullet LinearMath libraries. Use this to override automatic detection.") -SET (bullet_cflags "-DBT_USE_DOUBLE_PRECISION -DBT_EULER_DEFAULT_ZYX" CACHE STRING "Bullet Dynamics C compile flags exported by rospack.") -SET (threadpool_include_dirs "" CACHE STRING "Threadpool include paths. Use this to override automatic detection.") +set (assimp_include_dirs "" CACHE STRING "Assimp include paths. Use this to override automatic detection.") +set (assimp_library_dirs "" CACHE STRING "Assimp library paths. Use this to override automatic detection.") +set (assimp_libraries "" CACHE STRING "Assimp libraries Use this to override automatic detection.") +set (boost_include_dirs "" CACHE STRING "Boost include paths. Use this to override automatic detection.") +set (boost_library_dirs "" CACHE STRING "Boost library paths. Use this to override automatic detection.") +set (boost_libraries "" CACHE STRING "Boost libraries. Use this to override automatic detection.") +set (bullet_dynamics_dirs "" CACHE STRING "Bullet Dynamics libraries. Use this to override automatic detection.") +set (bullet_collision_dirs "" CACHE STRING "Bullet Collision libraries. Use this to override automatic detection.") +set (bullet_softbody_dirs "" CACHE STRING "Bullet Softbody libraries. Use this to override automatic detection.") +set (bullet_math_dirs "" CACHE STRING "Bullet LinearMath libraries. Use this to override automatic detection.") +set (bullet_cflags "-DBT_USE_DOUBLE_PRECISION -DBT_EULER_DEFAULT_ZYX" CACHE STRING "Bullet Dynamics C compile flags exported by rospack.") +set (threadpool_include_dirs "" CACHE STRING "Threadpool include paths. Use this to override automatic detection.") + ######################################## # Find packages -IF (PKG_CONFIG_FOUND) +if (PKG_CONFIG_FOUND) - pkg_check_modules(OGRE OGRE>=${OGRE_VERSION}) - IF (NOT OGRE_FOUND) - BUILD_ERROR("Ogre3d version >=${OGRE_VERSION} and development files not found. See the following website for installation instructions: http://www.orge3d.org") - ELSE (NOT OGRE_FOUND) + pkg_check_modules(OGRE OGRE>=${MIN_OGRE_VERSION}) + if (NOT OGRE_FOUND) + BUILD_ERROR("Ogre3d version >=${MIN_OGRE_VERSION} and development files not found. See the following website for installation instructions: http://www.orge3d.org") + else (NOT OGRE_FOUND) - SET (OGRE_LIBRARY_PATH ${OGRE_LIBRARY_DIRS} CACHE INTERNAL "Ogre library path") + set (OGRE_LIBRARY_PATH ${OGRE_LIBRARY_DIRS} CACHE INTERNAL "Ogre library path") APPEND_TO_CACHED_LIST(gazeboserver_include_dirs ${gazeboserver_include_dirs_desc} @@ -55,7 +57,7 @@ APPEND_TO_CACHED_LIST(gazeboserver_link_libs ${gazeboserver_link_libs_desc} ${OGRE_LDFLAGS}) - ENDIF (NOT OGRE_FOUND) + endif (NOT OGRE_FOUND) pkg_check_modules(XML libxml-2.0) IF (NOT XML_FOUND) @@ -343,35 +345,39 @@ ######################################## # Find assimp -IF (NOT assimp_include_dirs AND NOT assimp_library_dirs AND NOT assimp_libraries ) +if (NOT assimp_include_dirs AND NOT assimp_library_dirs AND NOT assimp_libraries ) - FIND_PATH(assimp_include_dir assimp.h ${assimp_include_dirs} ENV CPATH) + find_path(assimp_include_dir assimp.h ${assimp_include_dirs} ENV CPATH) - IF (NOT assimp_include_dir) - BUILD_ERROR("assimp not found. See the following website for installation instructions: http://assimp.sourceforge.net") - MESSAGE (STATUS "Looking for assimp.h - not found") - SET (assimp_include_dirs /usr/include CACHE STRING + if (NOT assimp_include_dir) + #BUILD_ERROR("assimp not found. See the following website for installation instructions: http://assimp.sourceforge.net") + message (STATUS "Looking for assimp.h - not found. Using built in version.") + set (assimp_include_dirs /usr/include CACHE STRING "Assimp include paths. Use this to override automatic detection.") - ELSE (NOT assimp_include_dir) - MESSAGE (STATUS "Looking for assimp.h - found") + else (NOT assimp_include_dir) + message (STATUS "Looking for assimp.h - found") set (assim_include_dirs ${assimp_include_dir} CACHE STRING "Assimp include paths. Use this to override automatic detection.") - ENDIF (NOT assimp_include_dir) + endif (NOT assimp_include_dir) - FIND_LIBRARY(assimp_library assimp ENV LD_LIBRARY_PATH) + find_library(assimp_library assimp ENV LD_LIBRARY_PATH) - IF (NOT assimp_library) - MESSAGE (STATUS "Looking for libassimp - not found") - BUILD_ERROR("libassimp not found. See the following website for installation instructions: http://assimp.sourceforge.net") - ELSE (NOT assimp_library) - MESSAGE (STATUS "Looking for libassimp - found") + if (NOT assimp_library) + message (STATUS "Looking for libassimp - not found. Using builtin version.") + #BUILD_ERROR("libassimp not found. See the following website for installation instructions: http://assimp.sourceforge.net") + else (NOT assimp_library) + message (STATUS "Looking for libassimp - found") APPEND_TO_CACHED_LIST(assimp_libraries "Assimp libraries Use this to override automatic detection." ${assimp_library}) - ENDIF (NOT assimp_library) - -ENDIF (NOT assimp_include_dirs AND NOT assimp_library_dirs AND NOT assimp_libraries ) + endif (NOT assimp_library) + + if (NOT assimp_include_dir AND NOT assimp_library) + set (use_internal_assimp ON CACHE BOOL "Use internal assimp" FORCE) + endif (NOT assimp_include_dir AND NOT assimp_library) +endif (NOT assimp_include_dirs AND NOT assimp_library_dirs AND NOT assimp_libraries ) + ######################################## # Find bullet FIND_PATH( bullet_include_dir btBulletDynamicsCommon.h ${bullet_include_dirs} ENV CPATH) Modified: code/gazebo/trunk/config.h.in =================================================================== --- code/gazebo/trunk/config.h.in 2010-01-13 05:04:28 UTC (rev 8498) +++ code/gazebo/trunk/config.h.in 2010-01-13 16:26:39 UTC (rev 8499) @@ -6,6 +6,6 @@ #cmakedefine HAVE_OPENAL 1 #cmakedefine HAVE_FFMPEG 1 #cmakedefine HAVE_LTDL 1 -#cmakedefine ENABLE_SHADOWS 0 +#cmakedefine ENABLE_SHADOWS 1 #cmakedefine INCLUDE_BULLET 0 #cmakedefine INCLUDE_ODE 1 Modified: code/gazebo/trunk/server/CMakeLists.txt =================================================================== --- code/gazebo/trunk/server/CMakeLists.txt 2010-01-13 05:04:28 UTC (rev 8498) +++ code/gazebo/trunk/server/CMakeLists.txt 2010-01-13 16:26:39 UTC (rev 8499) @@ -20,7 +20,6 @@ sensors/imu sensors/ir sensors/ray - #${CMAKE_SOURCE_DIR}/3rd_party/assimp/include ${LIBAVCODEC_PATH} ${LIBAVFORMAT_PATH} ${libtool_include_path} @@ -34,7 +33,6 @@ ) LINK_DIRECTORIES( - #${CMAKE_BINARY_DIR}/3rd_party/assimp ${CMAKE_BINARY_DIR}/libgazebo ${CMAKE_BINARY_DIR}/server/gui ${CMAKE_BINARY_DIR}/server/physics/bullet @@ -48,6 +46,12 @@ ${gazeboserver_link_dirs} ) +if (use_internal_assimp) + include_directories( ${CMAKE_SOURCE_DIR}/3rd_party/assimp/include/assimp) + link_directories( ${CMAKE_BINARY_DIR}/3rd_party/assimp ) +endif (use_internal_assimp) + + ######################################## # All the library search paths ADD_SUBDIRECTORY(rendering) Modified: code/gazebo/trunk/server/rendering/OgreAdaptor.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreAdaptor.cc 2010-01-13 05:04:28 UTC (rev 8498) +++ code/gazebo/trunk/server/rendering/OgreAdaptor.cc 2010-01-13 16:26:39 UTC (rev 8499) @@ -35,6 +35,8 @@ #include <iostream> #include <string.h> +#include "config.h" + #include "OgreVisual.hh" #include "UserCamera.hh" #include "OgreMovableText.hh" @@ -400,15 +402,23 @@ } } +#define OGRE_VERSION_MAJOR 1 +#define OGRE_VERSION_MINOR 7 //////////////////////////////////////////////////////////////////////////////// // Setup render system void OgreAdaptor::SetupRenderSystem() { Ogre::RenderSystem *renderSys; + const Ogre::RenderSystemList *rsList; // Set parameters of render system (window size, etc.) - Ogre::RenderSystemList *rsList = this->root->getAvailableRenderers(); +#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR == 6 + rsList = this->root->getAvailableRenderers(); +#else + rsList = &(this->root->getAvailableRenderers()); +#endif + int c = 0; renderSys = NULL; Modified: code/gazebo/trunk/server/sensors/camera/StereoCameraSensor.cc =================================================================== --- code/gazebo/trunk/server/sensors/camera/StereoCameraSensor.cc 2010-01-13 05:04:28 UTC (rev 8498) +++ code/gazebo/trunk/server/sensors/camera/StereoCameraSensor.cc 2010-01-13 16:26:39 UTC (rev 8499) @@ -259,7 +259,12 @@ autoParamDataSource.setCurrentRenderTarget(this->renderTargets[i]); autoParamDataSource.setCurrentSceneManager(sceneMgr); autoParamDataSource.setCurrentCamera(this->GetOgreCamera(), true); + +#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR == 6 pass->_updateAutoParamsNoLights(&autoParamDataSource); +#else + pass->_updateAutoParams(&autoParamDataSource,1); +#endif renderSys->setLightingEnabled(false); renderSys->_setFog(Ogre::FOG_NONE); @@ -271,16 +276,30 @@ // NOTE: We MUST bind parameters AFTER updating the autos if (pass->hasVertexProgram()) { - renderSys->bindGpuProgram( pass->getVertexProgram()->_getBindingDelegate() ); + renderSys->bindGpuProgram( + pass->getVertexProgram()->_getBindingDelegate() ); + +#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR == 6 renderSys->bindGpuProgramParameters(Ogre::GPT_VERTEX_PROGRAM, pass->getVertexProgramParameters()); +#else + renderSys->bindGpuProgramParameters(Ogre::GPT_VERTEX_PROGRAM, + pass->getVertexProgramParameters(), 1); +#endif } if (pass->hasFragmentProgram()) { - renderSys->bindGpuProgram( pass->getFragmentProgram()->_getBindingDelegate() ); + renderSys->bindGpuProgram( + pass->getFragmentProgram()->_getBindingDelegate() ); + +#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR == 6 renderSys->bindGpuProgramParameters(Ogre::GPT_FRAGMENT_PROGRAM, - pass->getFragmentProgramParameters()); + pass->getFragmentProgramParameters()); +#else + renderSys->bindGpuProgramParameters(Ogre::GPT_FRAGMENT_PROGRAM, + pass->getFragmentProgramParameters(), 1); +#endif } this->renderTargets[i]->update(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit