diff --git a/CMakeLists.txt b/CMakeLists.txt index f53d73813..04e75e94e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,7 +288,8 @@ endif() add_definitions(-DOGRE_PLUGIN_DIR_REL="${OGRE_PLUGIN_DIR_REL}") add_definitions(-DOGRE_PLUGIN_DIR_DBG="${OGRE_PLUGIN_DIR_DBG}") if (APPLE AND OPENMW_OSX_DEPLOYMENT) - add_definitions(-DOGRE_PLUGIN_DIR="${APP_BUNDLE_NAME}/Contents/Plugins") + # make it empty so plugin loading code can check this and try to find plugins inside app bundle + add_definitions(-DOGRE_PLUGIN_DIR="") else() add_definitions(-DOGRE_PLUGIN_DIR="${OGRE_PLUGIN_DIR}") endif() diff --git a/components/ogreinit/ogreinit.cpp b/components/ogreinit/ogreinit.cpp index c8fc621c7..46424a29a 100644 --- a/components/ogreinit/ogreinit.cpp +++ b/components/ogreinit/ogreinit.cpp @@ -6,6 +6,10 @@ #include #include +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE +#include +#endif + #include #include "ogreplugin.hpp" @@ -127,6 +131,9 @@ namespace OgreInit #endif #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE pluginDir = OGRE_PLUGIN_DIR; + // if path is not specified try to find plugins inside the app bundle + if (pluginDir.empty()) + pluginDir = Ogre::macPluginPath(); #endif #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX pluginDir = OGRE_PLUGIN_DIR_REL;