mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Merge pull request #2078 from AnyOldName3/cmake-13.1-osg-lib-fix
Adapt to CMake 3.13's new meaning of OSGDB_LIBRARY
This commit is contained in:
commit
066b74eb43
2 changed files with 31 additions and 13 deletions
|
@ -269,8 +269,14 @@ set(USED_OSG_PLUGINS
|
||||||
osgdb_tga
|
osgdb_tga
|
||||||
)
|
)
|
||||||
|
|
||||||
get_filename_component(OSG_LIB_DIR ${OSGDB_LIBRARY} DIRECTORY)
|
set(OSGPlugins_LIB_DIR "")
|
||||||
set(OSGPlugins_LIB_DIR "${OSG_LIB_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}")
|
foreach(OSGDB_LIB ${OSGDB_LIBRARY})
|
||||||
|
# Skip library type names
|
||||||
|
if(EXISTS ${OSGDB_LIB} AND NOT IS_DIRECTORY ${OSGDB_LIB})
|
||||||
|
get_filename_component(OSG_LIB_DIR ${OSGDB_LIB} DIRECTORY)
|
||||||
|
list(APPEND OSGPlugins_LIB_DIR "${OSG_LIB_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}")
|
||||||
|
endif()
|
||||||
|
endforeach(OSGDB_LIB)
|
||||||
|
|
||||||
if(OSG_STATIC)
|
if(OSG_STATIC)
|
||||||
add_definitions(-DOSG_LIBRARY_STATIC)
|
add_definitions(-DOSG_LIBRARY_STATIC)
|
||||||
|
@ -823,15 +829,24 @@ if (OPENMW_OSX_DEPLOYMENT AND APPLE AND DESIRED_QT_VERSION MATCHES 5)
|
||||||
|
|
||||||
set(ABSOLUTE_PLUGINS "")
|
set(ABSOLUTE_PLUGINS "")
|
||||||
|
|
||||||
|
set(OSGPlugins_DONT_FIND_DEPENDENCIES 1)
|
||||||
|
find_package(OSGPlugins REQUIRED COMPONENTS ${USED_OSG_PLUGINS})
|
||||||
|
|
||||||
foreach (PLUGIN_NAME ${USED_OSG_PLUGINS})
|
foreach (PLUGIN_NAME ${USED_OSG_PLUGINS})
|
||||||
set(PLUGIN_ABS "${OSGPlugins_LIB_DIR}/${PLUGIN_NAME}.so")
|
string(TOUPPER ${PLUGIN_NAME} PLUGIN_NAME_UC)
|
||||||
set(ABSOLUTE_PLUGINS ${PLUGIN_ABS} ${ABSOLUTE_PLUGINS})
|
if(${PLUGIN_NAME_UC}_LIBRARY_RELEASE)
|
||||||
|
set(PLUGIN_ABS ${${PLUGIN_NAME_UC}_LIBRARY_RELEASE})
|
||||||
|
elseif(${PLUGIN_NAME_UC}_LIBRARY)
|
||||||
|
set(PLUGIN_ABS ${${PLUGIN_NAME_UC}_LIBRARY})
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Can't find library file for ${PLUGIN_NAME}")
|
||||||
|
# We used to construct the path manually from OSGPlugins_LIB_DIR and the plugin name.
|
||||||
|
# Maybe that could be restored as a fallback?
|
||||||
|
endif()
|
||||||
|
set(ABSOLUTE_PLUGINS ${PLUGIN_ABS} ${ABSOLUTE_PLUGINS})
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
get_filename_component(OSG_PLUGIN_PREFIX_DIR "${OSGPlugins_LIB_DIR}" NAME)
|
set(OSG_PLUGIN_PREFIX_DIR "osgPlugins-${OPENSCENEGRAPH_VERSION}")
|
||||||
if (NOT OSG_PLUGIN_PREFIX_DIR)
|
|
||||||
message(FATAL_ERROR "Can't get directory name for OSG plugins from '${OSGPlugins_LIB_DIR}'")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# installs used plugins in bundle at given path (bundle_path must be relative to ${CMAKE_INSTALL_PREFIX})
|
# installs used plugins in bundle at given path (bundle_path must be relative to ${CMAKE_INSTALL_PREFIX})
|
||||||
# and returns list of install paths for all installed plugins
|
# and returns list of install paths for all installed plugins
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# This module accepts the following env variable
|
# This module accepts the following env variable
|
||||||
# OSGPlugins_LIB_DIR - <OpenSceneGraph>/lib/osgPlugins-<X.X.X> , path to search plugins
|
# OSGPlugins_LIB_DIR - <OpenSceneGraph>/lib/osgPlugins-<X.X.X> , path to search plugins
|
||||||
|
# OSGPlugins_DONT_FIND_DEPENDENCIES - Set to skip also finding png, zlib and jpeg
|
||||||
#
|
#
|
||||||
# Once done this will define
|
# Once done this will define
|
||||||
# OSGPlugins_FOUND - System has the all required components.
|
# OSGPlugins_FOUND - System has the all required components.
|
||||||
|
@ -41,10 +42,12 @@ foreach(_library ${OSGPlugins_FIND_COMPONENTS})
|
||||||
list(APPEND OSGPlugins_PROCESS_LIBS ${_component}_LIBRARY)
|
list(APPEND OSGPlugins_PROCESS_LIBS ${_component}_LIBRARY)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
foreach(_dependency PNG ZLIB JPEG) # needed by osgdb_png or osgdb_jpeg
|
if(NOT DEFINED OSGPlugins_DONT_FIND_DEPENDENCIES)
|
||||||
libfind_package(OSGPlugins ${_dependency})
|
foreach(_dependency PNG ZLIB JPEG) # needed by osgdb_png or osgdb_jpeg
|
||||||
set(${_dependency}_LIBRARY_OPTS ${_dependency}_LIBRARY)
|
libfind_package(OSGPlugins ${_dependency})
|
||||||
#list(APPEND OSGPlugins_PROCESS_LIBS ${_dependency}_LIBRARY)
|
set(${_dependency}_LIBRARY_OPTS ${_dependency}_LIBRARY)
|
||||||
endforeach()
|
#list(APPEND OSGPlugins_PROCESS_LIBS ${_dependency}_LIBRARY)
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
libfind_process(OSGPlugins)
|
libfind_process(OSGPlugins)
|
||||||
|
|
Loading…
Reference in a new issue