mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-28 11:36:41 +00:00
Merge branch 'fix_osg_static' into 'master'
Fix build with system static OpenSceneGraph See merge request OpenMW/openmw!1225
This commit is contained in:
commit
3419d5ab32
2 changed files with 18 additions and 1 deletions
|
@ -13,6 +13,11 @@ if(POLICY CMP0083)
|
|||
cmake_policy(SET CMP0083 NEW)
|
||||
endif()
|
||||
|
||||
# to link with freetype library
|
||||
if(POLICY CMP0079)
|
||||
cmake_policy(SET CMP0079 NEW)
|
||||
endif()
|
||||
|
||||
option(OPENMW_GL4ES_MANUAL_INIT "Manually initialize gl4es. This is more reliable on platforms without a windowing system. Requires gl4es to be configured with -DNOEGL=ON -DNO_LOADER=ON -DNO_INIT_CONSTRUCTOR=ON." OFF)
|
||||
if(OPENMW_GL4ES_MANUAL_INIT)
|
||||
add_definitions(-DOPENMW_GL4ES_MANUAL_INIT)
|
||||
|
|
|
@ -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)
|
||||
# OSG plugin pkgconfig files are missing these dependencies.
|
||||
# https://github.com/openscenegraph/OpenSceneGraph/issues/1052
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue