debio264
10-11-2009 04:05:21
After reading the topic at viewtopic.php?f=12&t=9202 which describes an issue I also had where OgreBullet needs libConvexDecomposition and ConvexBuilder.h, I went for what I like think is a more elegant solution and edited bullet-2.75/Extras/ConvexDecomposition/CMakeLists.txt so it would install ConvexBuilder.h and its dependencies as well as libConvexDecomposition.so. There's probably something wrong here, but it makes OgreBullet build without any craziness.
Here it is:
You can see that I had to add ConvexDecomposition.h and vlookup.h because they're included by ConvexBuilder.h, but dropping this in, generating Makefiles, and building/installing Bullet allowed OgreBullet to build without any crazy include or library paths.
Here it is:
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/Extras/ConvexDecomposition ${BULLET_PHYSICS_SOURCE_DIR}/src
)
ADD_LIBRARY(ConvexDecomposition
ConvexDecomposition.h bestfitobb.cpp cd_vector.h concavity.h float_math.h planetri.h splitplane.h
ConvexBuilder.cpp bestfitobb.h cd_wavefront.cpp fitsphere.cpp meshvolume.cpp raytri.cpp vlookup.cpp
ConvexBuilder.h bestfit.cpp cd_hull.cpp cd_wavefront.h fitsphere.h meshvolume.h raytri.h vlookup.h
ConvexDecomposition.cpp bestfit.h cd_hull.h concavity.cpp float_math.cpp planetri.cpp splitplane.cpp
)
IF (BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(ConvexDecomposition BulletCollision LinearMath)
ENDIF (BUILD_SHARED_LIBS)
#INSTALL of other files requires CMake 2.6
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS ConvexDecomposition DESTINATION .)
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
INSTALL(TARGETS ConvexDecomposition DESTINATION lib)
INSTALL(FILES ConvexBuilder.h ConvexDecomposition.h vlookup.h DESTINATION include)
ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
You can see that I had to add ConvexDecomposition.h and vlookup.h because they're included by ConvexBuilder.h, but dropping this in, generating Makefiles, and building/installing Bullet allowed OgreBullet to build without any crazy include or library paths.