1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-31 07:06:45 +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:
psi29a 2021-09-18 15:09:44 +00:00
commit 3419d5ab32
2 changed files with 18 additions and 1 deletions

View file

@ -13,6 +13,11 @@ if(POLICY CMP0083)
cmake_policy(SET CMP0083 NEW) cmake_policy(SET CMP0083 NEW)
endif() 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) 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) if(OPENMW_GL4ES_MANUAL_INIT)
add_definitions(-DOPENMW_GL4ES_MANUAL_INIT) add_definitions(-DOPENMW_GL4ES_MANUAL_INIT)

View file

@ -288,6 +288,15 @@ if (GIT_CHECKOUT)
add_dependencies (components git-version) add_dependencies (components git-version)
endif (GIT_CHECKOUT) 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) if (WIN32)
target_link_libraries(components shlwapi) target_link_libraries(components shlwapi)
endif() endif()
@ -329,7 +338,10 @@ if(OSG_STATIC)
if(OPENMW_USE_SYSTEM_OSG) if(OPENMW_USE_SYSTEM_OSG)
# OSG plugin pkgconfig files are missing these dependencies. # OSG plugin pkgconfig files are missing these dependencies.
# https://github.com/openscenegraph/OpenSceneGraph/issues/1052 # 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()
endif(OSG_STATIC) endif(OSG_STATIC)