From e265d0bc2b34e4f91b08c1ec2a536beba99db677 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Fri, 19 Feb 2021 18:59:25 +0000 Subject: [PATCH] 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. --- CMakeLists.txt | 8 -------- cmake/FindOSGPlugins.cmake | 11 +++++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b02ec055d..401167af1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -316,14 +316,6 @@ endif() if(OPENMW_USE_SYSTEM_OSG) find_package(OpenSceneGraph 3.3.4 REQUIRED ${USED_OSG_COMPONENTS}) 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}) endif() endif() diff --git a/cmake/FindOSGPlugins.cmake b/cmake/FindOSGPlugins.cmake index 457abf665..f7ebb0fa0 100644 --- a/cmake/FindOSGPlugins.cmake +++ b/cmake/FindOSGPlugins.cmake @@ -15,6 +15,17 @@ include(LibFindMacros) 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) set(_mode WARNING) if (OSGPlugins_FIND_REQUIRED)