@ -256,8 +256,14 @@ set(USED_OSG_PLUGINS
o s g d b _ t g a
)
get_filename_component ( OSG_LIB_DIR ${ OSGDB_LIBRARY } DIRECTORY )
set ( OSGPlugins_LIB_DIR "${OSG_LIB_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}" )
set ( OSGPlugins_LIB_DIR "" )
foreach ( OSGDB_LIB ${ OSGDB_LIBRARY } )
# S k i p l i b r a r y t y p e n a m e s
if ( EXISTS ${ OSGDB_LIB } )
get_filename_component ( OSG_LIB_DIR ${ OSGDB_LIB } DIRECTORY )
list ( APPEND OSGPlugins_LIB_DIR "${OSG_LIB_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}" )
endif ( )
endforeach ( OSGDB_LIB )
if ( OSG_STATIC )
add_definitions ( -DOSG_LIBRARY_STATIC )
@ -807,15 +813,24 @@ if (OPENMW_OSX_DEPLOYMENT AND APPLE AND DESIRED_QT_VERSION MATCHES 5)
set ( ABSOLUTE_PLUGINS "" )
set ( OSGPlugins_DONT_FIND_DEPENDENCIES 1 )
find_package ( OSGPlugins REQUIRED COMPONENTS ${ USED_OSG_PLUGINS } )
foreach ( PLUGIN_NAME ${ USED_OSG_PLUGINS } )
set ( PLUGIN_ABS "${OSGPlugins_LIB_DIR}/${PLUGIN_NAME}.so" )
string ( TOUPPER ${ PLUGIN_NAME } PLUGIN_NAME_UC )
if ( ${ PLUGIN_NAME_UC } _LIBRARY_RELEASE )
set ( PLUGIN_ABS ${ ${PLUGIN_NAME_UC } _LIBRARY_RELEASE} )
elseif ( ${ PLUGIN_NAME_UC } _LIBRARY )
set ( PLUGIN_ABS ${ ${PLUGIN_NAME_UC } _LIBRARY} )
else ( )
message ( FATAL_ERROR "Can't find library file for ${PLUGIN_NAME}" )
# W e u s e d t o c o n s t r u c t t h e p a t h m a n u a l l y f r o m O S G P l u g i n s _ L I B _ D I R a n d t h e p l u g i n n a m e .
# M a y b e t h a t c o u l d b e r e s t o r e d a s a f a l l b a c k ?
endif ( )
set ( ABSOLUTE_PLUGINS ${ PLUGIN_ABS } ${ ABSOLUTE_PLUGINS } )
endforeach ( )
get_filename_component ( OSG_PLUGIN_PREFIX_DIR "${OSGPlugins_LIB_DIR}" NAME )
if ( NOT OSG_PLUGIN_PREFIX_DIR )
message ( FATAL_ERROR "Can't get directory name for OSG plugins from '${OSGPlugins_LIB_DIR}'" )
endif ( )
set ( OSG_PLUGIN_PREFIX_DIR "osgPlugins-${OPENSCENEGRAPH_VERSION}" )
# i n s t a l l s u s e d p l u g i n s i n b u n d l e a t g i v e n path ( bundle_path must be relative to ${ CMAKE_INSTALL_PREFIX } )
# a n d r e t u r n s l i s t o f i n s t a l l p a t h s f o r a l l i n s t a l l e d p l u g i n s