I've compiled OpenSceneGraph 3.4.0 on Linux (32-bit) setting OFF DYNAMIC_OPENSCENEGRAPH and DYNAMIC_OPENTHREADS flags and enabling apps and examples on CMake.
Build was successful and I have static libraries and also the example osgstaticviewer working correctly.
Then I have tried compiling osgconv using only static libraries using a CMakeLists.txt copied from osgstaticviewer and modified adding obj support and osgconv original source files. Compilation works and resulting executable works but I'm not able to convert an obj file to an osg file. In particular, if I try the command:
./osgconv myModel.obj myModel.osg
I obtain the following warning:
Warning: Could not find plugin to read objects from file "myModel.obj".
Error no data loaded.
What's the procedure for linking statically osg plugins?
Below the CMakeLists.txt used to compile osgconv:
#this file is automatically generated
SET(TARGET_ADDED_LIBRARIES osgdb_obj osgdb_ive osgdb_openflight osgdb_osg osgdb_rgb osgdb_osg )
SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES}
osgdb_deprecated_osg osgdb_deprecated_osgparticle osgdb_deprecated_osganimation
osgdb_deprecated_osgfx osgdb_deprecated_osgsim osgdb_deprecated_osgtext
osgdb_deprecated_osgviewer osgdb_deprecated_osgshadow osgdb_deprecated_osgterrain
osgdb_deprecated_osgvolume osgdb_deprecated_osgwidget
)
SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES}
osgdb_serializers_osg osgdb_serializers_osgparticle osgdb_serializers_osgtext
osgdb_serializers_osgterrain osgdb_serializers_osganimation osgdb_serializers_osgfx
osgdb_serializers_osgshadow osgdb_serializers_osgmanipulator osgdb_serializers_osgsim
osgdb_serializers_osgvolume
)
IF(FREETYPE_FOUND)
ADD_DEFINITIONS(-DUSE_FREETYPE)
SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_freetype)
ENDIF(FREETYPE_FOUND)
SET(TARGET_SRC
OrientationConverter.cpp
osgconv.cpp
)
SET(TARGET_H
OrientationConverter.h
)
SETUP_APPLICATION(osgconv)