forked from mirror/openmw-tes3mp
bug #348: works again on OS X
This commit is contained in:
parent
2d080ce4ef
commit
94ce95c679
3 changed files with 44 additions and 35 deletions
|
@ -227,13 +227,41 @@ if (APPLE)
|
|||
${OGRE_Plugin_OctreeSceneManager_LIBRARY_REL}
|
||||
${OGRE_Plugin_CgProgramManager_LIBRARY_REL}
|
||||
${OGRE_Plugin_ParticleFX_LIBRARY_REL})
|
||||
|
||||
if (${OGRE_PLUGIN_DIR_REL}})
|
||||
set(OGRE_PLUGINS_REL_FOUND TRUE)
|
||||
endif ()
|
||||
|
||||
if (${OGRE_PLUGIN_DIR_DBG})
|
||||
set(OGRE_PLUGINS_DBG_FOUND TRUE)
|
||||
endif ()
|
||||
|
||||
if (${OGRE_PLUGINS_REL_FOUND})
|
||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_REL})
|
||||
else ()
|
||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_DBG})
|
||||
endif ()
|
||||
|
||||
set(OGRE_PLUGIN_DIR "${OGRE_PLUGIN_DIR}/")
|
||||
|
||||
# set(OGRE_PLUGIN_DIR_2 ${OGRE_PLUGIN_DIR})
|
||||
# set(OGRE_PLUGIN_DIR "")
|
||||
# set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_2})
|
||||
|
||||
configure_file(${OpenMW_SOURCE_DIR}/files/mac/Info.plist
|
||||
"${APP_BUNDLE_DIR}/Contents/Info.plist")
|
||||
|
||||
configure_file(${OpenMW_SOURCE_DIR}/files/mac/openmw.icns
|
||||
"${APP_BUNDLE_DIR}/Contents/Resources/OpenMW.icns" COPYONLY)
|
||||
endif (APPLE)
|
||||
|
||||
|
||||
# Set up Ogre plugin folder & debug suffix
|
||||
set(DEBUG_SUFFIX "")
|
||||
add_definitions(-DOGRE_PLUGIN_DEBUG_SUFFIX="")
|
||||
if (DEFINED CMAKE_BUILD_TYPE)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
# Ogre on OS X doesn't use "_d" suffix (see Ogre's CMakeLists.txt)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT APPLE)
|
||||
set(DEBUG_SUFFIX "_d")
|
||||
add_definitions(-DOGRE_PLUGIN_DEBUG_SUFFIX="_d")
|
||||
else()
|
||||
|
@ -275,35 +303,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||
"${OpenMW_BINARY_DIR}/openmw.desktop")
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
if (${OGRE_PLUGIN_DIR_REL}})
|
||||
set(OGRE_PLUGINS_REL_FOUND TRUE)
|
||||
endif ()
|
||||
|
||||
if (${OGRE_PLUGIN_DIR_DBG})
|
||||
set(OGRE_PLUGINS_DBG_FOUND TRUE)
|
||||
endif ()
|
||||
|
||||
if (${OGRE_PLUGINS_REL_FOUND})
|
||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_REL})
|
||||
else ()
|
||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_DBG})
|
||||
endif ()
|
||||
|
||||
set(OGRE_PLUGIN_DIR "${OGRE_PLUGIN_DIR}/")
|
||||
|
||||
set(OGRE_PLUGIN_DIR_2 ${OGRE_PLUGIN_DIR})
|
||||
set(OGRE_PLUGIN_DIR "")
|
||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_2})
|
||||
|
||||
configure_file(${OpenMW_SOURCE_DIR}/files/mac/Info.plist
|
||||
"${APP_BUNDLE_DIR}/Contents/Info.plist")
|
||||
|
||||
configure_file(${OpenMW_SOURCE_DIR}/files/mac/openmw.icns
|
||||
"${APP_BUNDLE_DIR}/Contents/Resources/OpenMW.icns" COPYONLY)
|
||||
endif (APPLE)
|
||||
|
||||
|
||||
# Compiler settings
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
add_definitions (-Wall -Wextra -Wno-unused-parameter -Wno-reorder)
|
||||
|
|
|
@ -116,11 +116,15 @@ bool GraphicsPage::setupOgre()
|
|||
}
|
||||
|
||||
std::string glPlugin = std::string(pluginDir) + "/RenderSystem_GL" + OGRE_PLUGIN_DEBUG_SUFFIX;
|
||||
if (boost::filesystem::exists(glPlugin + ".so") || boost::filesystem::exists(glPlugin + ".dll"))
|
||||
if (boost::filesystem::exists(glPlugin + ".so") ||
|
||||
boost::filesystem::exists(glPlugin + ".dll") ||
|
||||
boost::filesystem::exists(glPlugin + ".dylib"))
|
||||
mOgre->loadPlugin (glPlugin);
|
||||
|
||||
std::string dxPlugin = std::string(pluginDir) + "/RenderSystem_Direct3D9" + OGRE_PLUGIN_DEBUG_SUFFIX;
|
||||
if (boost::filesystem::exists(dxPlugin + ".so") || boost::filesystem::exists(dxPlugin + ".dll"))
|
||||
if (boost::filesystem::exists(dxPlugin + ".so") ||
|
||||
boost::filesystem::exists(dxPlugin + ".dll") ||
|
||||
boost::filesystem::exists(dxPlugin + ".dylib"))
|
||||
mOgre->loadPlugin (dxPlugin);
|
||||
|
||||
#ifdef ENABLE_PLUGIN_GL
|
||||
|
|
|
@ -112,15 +112,21 @@ void OgreRenderer::configure(const std::string &logPath,
|
|||
}
|
||||
|
||||
std::string glPlugin = std::string(pluginDir) + "/RenderSystem_GL" + OGRE_PLUGIN_DEBUG_SUFFIX;
|
||||
if (boost::filesystem::exists(glPlugin + ".so") || boost::filesystem::exists(glPlugin + ".dll"))
|
||||
if (boost::filesystem::exists(glPlugin + ".so") ||
|
||||
boost::filesystem::exists(glPlugin + ".dll") ||
|
||||
boost::filesystem::exists(glPlugin + ".dylib"))
|
||||
mRoot->loadPlugin (glPlugin);
|
||||
|
||||
std::string dxPlugin = std::string(pluginDir) + "/RenderSystem_Direct3D9" + OGRE_PLUGIN_DEBUG_SUFFIX;
|
||||
if (boost::filesystem::exists(dxPlugin + ".so") || boost::filesystem::exists(dxPlugin + ".dll"))
|
||||
if (boost::filesystem::exists(dxPlugin + ".so") ||
|
||||
boost::filesystem::exists(dxPlugin + ".dll") ||
|
||||
boost::filesystem::exists(dxPlugin + ".dylib"))
|
||||
mRoot->loadPlugin (dxPlugin);
|
||||
|
||||
std::string cgPlugin = std::string(pluginDir) + "/Plugin_CgProgramManager" + OGRE_PLUGIN_DEBUG_SUFFIX;
|
||||
if (boost::filesystem::exists(cgPlugin + ".so") || boost::filesystem::exists(cgPlugin + ".dll"))
|
||||
if (boost::filesystem::exists(cgPlugin + ".so") ||
|
||||
boost::filesystem::exists(cgPlugin + ".dll") ||
|
||||
boost::filesystem::exists(cgPlugin + ".dylib"))
|
||||
mRoot->loadPlugin (cgPlugin);
|
||||
|
||||
RenderSystem* rs = mRoot->getRenderSystemByName(renderSystem);
|
||||
|
|
Loading…
Reference in a new issue