I'm new at this and I'm having a little trouble integrating the bullet libraries into my cmake project. I know it can compile with just Ogre and OIS, but I don't know how to setup the CMakeLists.txt file to add the bullet library.
I installed the findBullet.cmake file I found here:
http://www.cmake.org/pipermail/cmake-co ... 06967.html
then I tried to do cmake with this:
Code: Select all
cmake_minimum_required(VERSION 2.6)
PROJECT(ogre3dTest)
set(CMAKE_MODULE_PATH
/usr/local/lib/OGRE/cmake
)
FIND_PACKAGE(OpenGL)
FIND_PACKAGE(OGRE)
FIND_PACKAGE(OIS)
FIND_PACKAGE(BULLET)
INCLUDE_DIRECTORIES(
${OpenGL_INCLUDE_DIR}
${OGRE_INCLUDE_DIRS}
${OIS_INCLUDE_DIRS}
${BULLET_INCLUDE_DIRS}
)
# add_subdirectory(${PROJECT_SOURCE_DIR}/../../../../../usr/local/lib)
FILE(GLOB SRCS src/*.cpp)
FILE(GLOB HDRS include/*.h)
ADD_EXECUTABLE(ogre3dTest
${SRCS}
${HDRS}
)
TARGET_LINK_LIBRARIES(ogre3dTest
${OpenGL_LIBRARIES}
${OIS_LIBRARIES}
${OGRE_LIBRARIES}
${BULLET_LIBRARIES}
)
Code: Select all
-- Looking for OGRE...
-- Found Ogre Cthugha (1.7.0)
-- Found OGRE: optimized;/usr/local/lib/libOgreMain.so;debug;/usr/local/lib/libOgreMain.so
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/local/lib/libOgrePaging.so;debug;/usr/local/lib/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/local/lib/libOgreTerrain.so;debug;/usr/local/lib/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Could not locate OGRE_Property
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;/usr/local/lib/libOgreRTShaderSystem.so;debug;/usr/local/lib/libOgreRTShaderSystem.so
-- Looking for OIS...
-- Found OIS: optimized;/usr/lib/libOIS.so;debug;/usr/lib/libOIS.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hewhosurvives/c++/EBE/ogreApp
Code: Select all
[100%] Building CXX object CMakeFiles/ogre3dTest.dir/src/programSkeletonWithBullet.cpp.o
Linking CXX executable ogre3dTest
CMakeFiles/ogre3dTest.dir/src/programSkeletonWithBullet.cpp.o: In function `Application::setupScene()':
programSkeletonWithBullet.cpp:(.text._ZN11Application10setupSceneEv[Application::setupScene()]+0x340): undefined reference to `btStaticPlaneShape::btStaticPlaneShape(btVector3 const&, float)'
programSkeletonWithBullet.cpp:(.text._ZN11Application10setupSceneEv[Application::setupScene()]+0x354): undefined reference to `btAlignedAllocInternal(unsigned int, int)'
programSkeletonWithBullet.cpp:(.text._ZN11Application10setupSceneEv[Application::setupScene()]+0x35e): undefined reference to `btConvexInternalShape::btConvexInternalShape()'
programSkeletonWithBullet.cpp:(.text._ZN11Application10setupSceneEv[Application::setupScene()]+0x364): undefined reference to `vtable for btSphereShape'
programSkeletonWithBullet.cpp:(.text._ZN11Application10setupSceneEv[Application::setupScene()]+0x6a2): undefined reference to `btAlignedAllocInternal(unsigned int, int)'
programSkeletonWithBullet.cpp:(.text._ZN11Application10setupSceneEv[Application::setupScene()]+0x6b6): undefined reference to `btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)'
programSkeletonWithBullet.cpp:(.text._ZN11Application10setupSceneEv[Application::setupScene()]+0xa2a): undefined reference to `btAlignedAllocInternal(unsigned int, int)'
programSkeletonWithBullet.cpp:(.text._ZN11Application10setupSceneEv[Application::setupScene()]+0xa3e): undefined reference to `btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)'
programSkeletonWithBullet.cpp:(.text._ZN11Application10setupSceneEv[Application::setupScene()]+0x11aa): undefined reference to `btAlignedFreeInternal(void*)'
programSkeletonWithBullet.cpp:(.text._ZN11Application10setupSceneEv[Application::setupScene()]+0x1271): undefined reference to `btAlignedFreeInternal(void*)'
CMakeFiles/ogre3dTest.dir/src/programSkeletonWithBullet.cpp.o: In function `Application::go()':
programSkeletonWithBullet.cpp:(.text._ZN11Application2goEv[Application::go()]+0x28b): undefined reference to `btDbvtBroadphase::btDbvtBroadphase(btOverlappingPairCache*)'
programSkeletonWithBullet.cpp:(.text._ZN11Application2goEv[Application::go()]+0x2e0): undefined reference to `btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(btDefaultCollisionConstructionInfo const&)'
programSkeletonWithBullet.cpp:(.text._ZN11Application2goEv[Application::go()]+0x2fb): undefined reference to `btCollisionDispatcher::btCollisionDispatcher(btCollisionConfiguration*)'
programSkeletonWithBullet.cpp:(.text._ZN11Application2goEv[Application::go()]+0x315): undefined reference to `btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver()'
programSkeletonWithBullet.cpp:(.text._ZN11Application2goEv[Application::go()]+0x347): undefined reference to `btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher*, btBroadphaseInterface*, btConstraintSolver*, btCollisionConfiguration*)'
collect2: ld returned 1 exit status
make[2]: *** [ogre3dTest] Error 1
make[1]: *** [CMakeFiles/ogre3dTest.dir/all] Error 2
make: *** [all] Error 2