@ -304,3 +304,28 @@ endif()
set ( COMPONENT_FILES ${ COMPONENT_FILES } PARENT_SCOPE )
target_compile_definitions ( components PUBLIC BT_USE_DOUBLE_PRECISION )
if ( OSG_STATIC )
unset ( _osg_plugins_static_files )
add_library ( components_osg_plugins INTERFACE )
foreach ( _plugin ${ USED_OSG_PLUGINS } )
string ( TOUPPER ${ _plugin } _plugin_uc )
if ( OPENMW_USE_SYSTEM_OSG )
list ( APPEND _osg_plugins_static_files ${ ${_plugin_uc } _LIBRARY} )
else ( )
list ( APPEND _osg_plugins_static_files $< TARGET_FILE:${${_plugin_uc}_LIBRARY} > )
target_link_libraries ( components_osg_plugins INTERFACE $< TARGET_PROPERTY:${${_plugin_uc}_LIBRARY},LINK_LIBRARIES > )
add_dependencies ( components_osg_plugins ${ ${_plugin_uc } _LIBRARY} )
endif ( )
endforeach ( )
# W e u s e - - w h o l e - a r c h i v e b e c a u s e O S G p l u g i n s u s e r e g i s t r a t i o n .
get_whole_archive_options ( _opts ${ _osg_plugins_static_files } )
target_link_options ( components_osg_plugins INTERFACE ${ _opts } )
target_link_libraries ( components components_osg_plugins )
if ( OPENMW_USE_SYSTEM_OSG )
# O S G p l u g i n p k g c o n f i g f i l e s a r e m i s s i n g t h e s e d e p e n d e n c i e s .
# h t t p s : / / g i t h u b . c o m / o p e n s c e n e g r a p h / O p e n S c e n e G r a p h / i s s u e s / 1 0 5 2
target_link_libraries ( components freetype jpeg png )
endif ( )
endif ( OSG_STATIC )