@ -288,6 +288,15 @@ if (GIT_CHECKOUT)
add_dependencies ( components git-version )
endif ( GIT_CHECKOUT )
if ( OSG_STATIC AND CMAKE_SYSTEM_NAME MATCHES "Linux" )
find_package ( X11 REQUIRED COMPONENTS Xinerama Xrandr )
target_link_libraries ( components ${ CMAKE_DL_LIBS } X11::X11 X11::Xinerama X11::Xrandr )
find_package ( Fontconfig MODULE )
if ( Fontconfig_FOUND )
target_link_libraries ( components Fontconfig::Fontconfig )
endif ( )
endif ( )
if ( WIN32 )
target_link_libraries ( components shlwapi )
endif ( )
@ -329,7 +338,10 @@ if(OSG_STATIC)
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 )
find_package ( Freetype REQUIRED )
find_package ( JPEG REQUIRED )
find_package ( PNG REQUIRED )
target_link_libraries ( components Freetype::Freetype JPEG::JPEG PNG::PNG )
endif ( )
endif ( OSG_STATIC )