The attached CMakeLists.txt adds the variable:
COLLADA_USE_STATIC
...which is OFF by default, only shows up under the "Advanced" ccmake
menu, and which enables static usage of libcollada on Linux.
Furthermore, this new version fixes a bug where the most recent SVN of
Collada would not build with OSG, since it was looking for -lcollada,
instead of -lcollada_shared. (Please see my thread from Monday, Dec 2nd
at 4:40PM for more info).
Weeeee!
INCLUDE_DIRECTORIES( ${COLLADA_INCLUDE_DIR} ${COLLADA_INCLUDE_DIR}/1.4)
SET(TARGET_SRC
daeReader.cpp
daeRGeometry.cpp
daeRMaterials.cpp
daeRSceneObjects.cpp
daeRTransforms.cpp
daeWGeometry.cpp
daeWMaterials.cpp
daeWriter.cpp
daeWSceneObjects.cpp
daeWTransforms.cpp
domSourceReader.cpp
ReaderWriterDAE.cpp
)
SET(TARGET_H
daeReader.h
daeWriter.h
domSourceReader.h
)
OPTION(COLLADA_USE_STATIC "Set to ON to build OpenSceneGraph with static
Collada support." OFF)
MARK_AS_ADVANCED(COLLADA_USE_STATIC)
IF(WIN32)
SET(TARGET_EXTERNAL_LIBRARIES libcollada_dom libcollada_dae
libcollada_STLDatabase libcollada_LIBXMLPlugin libcollada_stdErrPlugin libxml2 )
ELSE(WIN32)
# SET(TARGET_EXTERNAL_LIBRARIES collada_dom collada_dae collada_STLDatabase
collada_LIBXMLPlugin collada_stdErrPlugin xml2 )
# JC hack STLDatabase and XMLPlugin are statically linked on Linux
#
# This works in "shared" mode
# SET(TARGET_EXTERNAL_LIBRARIES collada_dom_shared collada_dae_shared xml2 )
#
# This works in "static" mode
# SET(TARGET_EXTERNAL_LIBRARIES collada_dom collada_dae xml2 pcrecpp)
#
# ...so what we need is a conditional way to properly SET() the right one.
IF(COLLADA_USE_STATIC)
SET(TARGET_EXTERNAL_LIBRARIES collada_dom collada_dae xml2 pcrecpp)
ELSE(COLLADA_USE_STATIC)
SET(TARGET_EXTERNAL_LIBRARIES collada_dom_shared collada_dae_shared
xml2)
ENDIF(COLLADA_USE_STATIC)
ENDIF(WIN32)
SET(TARGET_LIBRARIES_VARS COLLADA_LIBRARY)
#### end var setup ###
SETUP_PLUGIN(dae)
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org