Fix OSGPlugins_LIB_DIR on the MacOS build

Moves auto-detection of OSGPlugins_LIB_DIR into FindOSGPlugins.cmake.

This should hopefully fix the error in the MacOS build.
pull/593/head
Gleb Mazovetskiy 4 years ago
parent 5c0214142b
commit e265d0bc2b

@ -316,14 +316,6 @@ endif()
if(OPENMW_USE_SYSTEM_OSG) if(OPENMW_USE_SYSTEM_OSG)
find_package(OpenSceneGraph 3.3.4 REQUIRED ${USED_OSG_COMPONENTS}) find_package(OpenSceneGraph 3.3.4 REQUIRED ${USED_OSG_COMPONENTS})
if(OSG_STATIC) if(OSG_STATIC)
unset(OSGPlugins_LIB_DIR)
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)
find_package(OSGPlugins REQUIRED COMPONENTS ${USED_OSG_PLUGINS}) find_package(OSGPlugins REQUIRED COMPONENTS ${USED_OSG_PLUGINS})
endif() endif()
endif() endif()

@ -15,6 +15,17 @@
include(LibFindMacros) include(LibFindMacros)
include(Findosg_functions) include(Findosg_functions)
if (NOT OSGPlugins_LIB_DIR)
unset(OSGPlugins_LIB_DIR)
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)
endif()
if (NOT OSGPlugins_LIB_DIR) if (NOT OSGPlugins_LIB_DIR)
set(_mode WARNING) set(_mode WARNING)
if (OSGPlugins_FIND_REQUIRED) if (OSGPlugins_FIND_REQUIRED)

Loading…
Cancel
Save