mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 12:35:46 +00:00
Fix build with system static OpenSceneGraph
* Add dependency to libraries required by OSG but missing when linking with OSG system library. * Use find_package for already defined dependencies.
This commit is contained in:
parent
e4648cec48
commit
b9825afb8a
@ -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…
x
Reference in New Issue
Block a user