cmake osgWorks problem on Ubuntu 12.04

88 views
Skip to first unread message

David Cofer

unread,
Mar 23, 2014, 9:20:15 AM3/23/14
to osgbull...@googlegroups.com
I am trying to build osgBullet on an Ubuntu 12.04 64 bit machine. I have built all the other dependencies, including osgWorks, and I can run them. However, when I try and run cmake on osgBullet I always get the following error. Here is the cmake command I am running.

cmake ../../../osgBullet_03_00_00/ -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=off -DCMAKE_DEBUG_POSTFIX=_single_debug -DOPENGL_gl_LIBRARY=/usr/lib/fglrx/fglrx-libGL.so.1.2 -DosgWorks_DIR=/usr/local/lib -DOSGBULLET_USE_DOUBLE_PRECISION=off -DBULLET_INCLUDE_DIR=../../../bullet-2.82/src -DBULLET_COLLISION_LIBRARY=../../../bullet-2.82/libBulletCollision_single.a -DBULLET_COLLISION_LIBRARY_DEBUG=../../../bullet-2.82/libBulletCollision_single_debug.a -DBULLET_DYNAMICS_LIBRARY=../../../bullet-2.82/libBulletDynamics_single.a -DBULLET_DYNAMICS_LIBRARY_DEBUG=../../../bullet-2.82/libBulletDynamics_single_debug.a -DBULLET_MATH_LIBRARY=../../../bullet-2.82/libLinearMath_single.a -DBULLET_MATH_LIBRARY_DEBUG=../../../bullet-2.82/libLinearMath_single_debug.a -DBULLET_SOFTBODY_LIBRARY=../../../bullet-2.82/libBulletSoftBody_single.a -DBULLET_SOFTBODY_LIBRARY_DEBUG=../../../bullet-2.82/libBulletSoftBody_single_debug.a
CMake Error at CMakeModules/FindosgWorks.cmake:39 (MESSAGE):
  osgWorks not found.  Set the osgWorks_DIR cmake cache entry to the
  directory containing osgWorksConfig.cmake.  This is either the root of the
  build tree, or PREFIX/lib for an installation.
Call Stack (most recent call first):
  CMakeLists.txt:113 (FIND_PACKAGE)


I have tried this with every combination of -DosgWorks_DIR I can think of. osgWorksConfig.cmake is in the following folder on my system (osgWorks_30_00_00/build/release/lib/x86_64-linux-gnu). I have tried that directory, and then all directories above it. I have installed osgWorks to /usr/local and tried various directories there. I always get the error seen above. Any ideas on why this is not picking up the osgWorks package?

Thanks

David Cofer

unread,
Mar 23, 2014, 9:36:32 AM3/23/14
to osgbull...@googlegroups.com
Also, I just saw this link (http://code.google.com/p/osgbullet/wiki/BuildingOsgBullet#Finding_the_OSG_and_Bullet_Dependencies) from another post in the forum. However, I tried setting -DOSGWORKS_ROOT with several different combinations of directories, and then tried -DOSGWORKS_BUILD_DIR and -DOSGWORKS_SOURCE_DIR as well. Same error no matter what I attempted. I am building from source. I have the main osgWorks_30_00_00 folder, then I created a build folder, and then debug and release folders where I was running cmake on each of them. i am doing the same thing for osgBullet, so it is osgBullet_30_00_00/build/single_debug, etc. in that case I would assume that I would use the following settings:

-DOSGWORKS_BUILD_DIR=../../../osgWorks_03_00_00/build/debug
-DOSGWORKS_SOURCE_DIR=../../../osgWorks_03_00_00/src

Paul Martz

unread,
Mar 23, 2014, 7:14:22 PM3/23/14
to osgbull...@googlegroups.com
Hi David -- 

Does it make a difference if you specify the variable type as PATH?
  -DosgWorks_Dir:PATH="<directory>"
As long as <directory> contains the file osgWorksConfig.cmake, this should work, and you should end up with an entry like this in your CMakeCache.txt file:
osgWorks_DIR:PATH=<directory>

I noticed you're setting BUILD_SHARED_LIBS to OFF, and I haven't tried to do a static build of osgWorks and osgBullet. Do you encounter the same issue if you build shared?

FYI, I notice you're setting a lot of CMake variables on your CMake command line. I use the cmake -C option to specify a config file that prepopulates the cmake cache. Then you can have a file that contains normal CMake script to set variables, such as this:
    set( osgWorks_DIR "<osgWorks dir>" CACHE PATH "" )
    set( OSG_DIR "OSG dir>" CACHE PATH "" )
    set( BULLET_ROOT "<Bullet dir>" CACHE PATH "" )
Etc.

I hope that helps.
   -Paul


David Cofer

unread,
Mar 31, 2014, 12:59:34 PM3/31/14
to osgbull...@googlegroups.com
Thanks for you feedback. I did end up abandoning the static libs and going with shared. I also believe I ended up finding the problem. I wanted to make sure I was getting the right file, so I specified the path to the osgWorks_Dir using an absolute path and it worked. Any time I tried it with a relative path it failed. So for some reason that cmake param does not seem to like relative paths. I was able to get everything compiling and running on Ubuntu now. Thanks for all your great work on osgWorks and osgBullet.
Reply all
Reply to author
Forward
0 new messages