mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 10:53:51 +00:00
Merge remote-tracking branch 'corristo/osx-ogre-19'
This commit is contained in:
commit
44f6f79bf5
3 changed files with 18 additions and 18 deletions
|
@ -252,7 +252,6 @@ link_directories(${SDL2_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR} ${MY
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# List used Ogre plugins
|
# List used Ogre plugins
|
||||||
SET(USED_OGRE_PLUGINS ${OGRE_RenderSystem_GL_LIBRARY_REL}
|
SET(USED_OGRE_PLUGINS ${OGRE_RenderSystem_GL_LIBRARY_REL}
|
||||||
${OGRE_Plugin_OctreeSceneManager_LIBRARY_REL}
|
|
||||||
${OGRE_Plugin_ParticleFX_LIBRARY_REL})
|
${OGRE_Plugin_ParticleFX_LIBRARY_REL})
|
||||||
|
|
||||||
# Actually we must use OGRE_Plugin_CgProgramManager_FOUND but it's
|
# Actually we must use OGRE_Plugin_CgProgramManager_FOUND but it's
|
||||||
|
@ -276,8 +275,6 @@ if (APPLE)
|
||||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_DBG})
|
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_DBG})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
#set(OGRE_PLUGIN_DIR "${OGRE_PLUGIN_DIR}/")
|
|
||||||
|
|
||||||
configure_file(${OpenMW_SOURCE_DIR}/files/mac/Info.plist
|
configure_file(${OpenMW_SOURCE_DIR}/files/mac/Info.plist
|
||||||
"${APP_BUNDLE_DIR}/Contents/Info.plist")
|
"${APP_BUNDLE_DIR}/Contents/Info.plist")
|
||||||
|
|
||||||
|
@ -656,7 +653,7 @@ if (APPLE)
|
||||||
set(CPACK_GENERATOR "DragNDrop")
|
set(CPACK_GENERATOR "DragNDrop")
|
||||||
set(CPACK_PACKAGE_VERSION ${OPENMW_VERSION})
|
set(CPACK_PACKAGE_VERSION ${OPENMW_VERSION})
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR ${OPENMW_VERSION_MAJOR})
|
set(CPACK_PACKAGE_VERSION_MAJOR ${OPENMW_VERSION_MAJOR})
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINO})
|
set(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINOR})
|
||||||
set(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE})
|
set(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE})
|
||||||
|
|
||||||
set(OPENMW_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}")
|
set(OPENMW_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}")
|
||||||
|
@ -671,18 +668,29 @@ if (APPLE)
|
||||||
set(ABSOLUTE_PLUGINS ${PLUGIN_ABS} ${ABSOLUTE_PLUGINS})
|
set(ABSOLUTE_PLUGINS ${PLUGIN_ABS} ${ABSOLUTE_PLUGINS})
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
|
install(CODE "
|
||||||
|
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||||
|
include(BundleUtilities)
|
||||||
|
" COMPONENT Runtime)
|
||||||
|
|
||||||
# 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
|
||||||
function (install_plugins_for_bundle bundle_path plugins_var)
|
function (install_plugins_for_bundle bundle_path plugins_var)
|
||||||
set(RELATIVE_PLUGIN_INSTALL_BASE "${bundle_path}/Contents/Plugins")
|
set(RELATIVE_PLUGIN_INSTALL_BASE "${bundle_path}/Contents/Frameworks")
|
||||||
install(FILES ${ABSOLUTE_PLUGINS} DESTINATION ${RELATIVE_PLUGIN_INSTALL_BASE} COMPONENT Runtime)
|
|
||||||
|
|
||||||
set(PLUGINS "")
|
set(PLUGINS "")
|
||||||
set(PLUGIN_INSTALL_BASE "\${CMAKE_INSTALL_PREFIX}/${RELATIVE_PLUGIN_INSTALL_BASE}")
|
set(PLUGIN_INSTALL_BASE "\${CMAKE_INSTALL_PREFIX}/${RELATIVE_PLUGIN_INSTALL_BASE}")
|
||||||
|
|
||||||
foreach (PLUGIN ${ABSOLUTE_PLUGINS})
|
foreach (PLUGIN ${ABSOLUTE_PLUGINS})
|
||||||
get_filename_component(PLUGIN_RELATIVE ${PLUGIN} NAME)
|
get_filename_component(PLUGIN_RELATIVE ${PLUGIN} NAME)
|
||||||
set(PLUGINS ${PLUGINS} "${PLUGIN_INSTALL_BASE}/${PLUGIN_RELATIVE}")
|
get_filename_component(PLUGIN_RELATIVE_WE ${PLUGIN} NAME_WE)
|
||||||
|
|
||||||
|
set(PLUGIN_DYLIB_IN_BUNDLE "${PLUGIN_INSTALL_BASE}/${PLUGIN_RELATIVE}/${PLUGIN_RELATIVE_WE}")
|
||||||
|
set(PLUGINS ${PLUGINS} "${PLUGIN_DYLIB_IN_BUNDLE}")
|
||||||
|
|
||||||
|
install(CODE "
|
||||||
|
copy_resolved_framework_into_bundle(\"${PLUGIN}/${PLUGIN_RELATIVE_WE}\" \"${PLUGIN_DYLIB_IN_BUNDLE}\")
|
||||||
|
" COMPONENT Runtime)
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
set(${plugins_var} ${PLUGINS} PARENT_SCOPE)
|
set(${plugins_var} ${PLUGINS} PARENT_SCOPE)
|
||||||
|
@ -702,6 +710,7 @@ if (APPLE)
|
||||||
# Current limitations:
|
# Current limitations:
|
||||||
# 1. Handles only frameworks, not simple libs
|
# 1. Handles only frameworks, not simple libs
|
||||||
INSTALL(CODE "
|
INSTALL(CODE "
|
||||||
|
cmake_policy(SET CMP0009 OLD)
|
||||||
set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
|
set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
|
||||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
set(CMAKE_SYSTEM_FRAMEWORK_PATH ${CMAKE_SYSTEM_FRAMEWORK_PATH})
|
set(CMAKE_SYSTEM_FRAMEWORK_PATH ${CMAKE_SYSTEM_FRAMEWORK_PATH})
|
||||||
|
@ -733,9 +742,6 @@ if (APPLE)
|
||||||
endif()
|
endif()
|
||||||
endfunction(gp_resolve_item_override)
|
endfunction(gp_resolve_item_override)
|
||||||
|
|
||||||
cmake_policy(SET CMP0009 OLD)
|
|
||||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
|
||||||
include(BundleUtilities)
|
|
||||||
fixup_bundle(\"${OPENMW_APP}\" \"${PLUGINS}\" \"${DIRS}\")
|
fixup_bundle(\"${OPENMW_APP}\" \"${PLUGINS}\" \"${DIRS}\")
|
||||||
fixup_bundle(\"${OPENCS_APP}\" \"${OPENCS_PLUGINS}\" \"${DIRS}\")
|
fixup_bundle(\"${OPENCS_APP}\" \"${OPENCS_PLUGINS}\" \"${DIRS}\")
|
||||||
" COMPONENT Runtime)
|
" COMPONENT Runtime)
|
||||||
|
|
|
@ -133,7 +133,7 @@ namespace OgreInit
|
||||||
pluginDir = OGRE_PLUGIN_DIR;
|
pluginDir = OGRE_PLUGIN_DIR;
|
||||||
// if path is not specified try to find plugins inside the app bundle
|
// if path is not specified try to find plugins inside the app bundle
|
||||||
if (pluginDir.empty())
|
if (pluginDir.empty())
|
||||||
pluginDir = Ogre::macPluginPath();
|
pluginDir = Ogre::macFrameworksPath();
|
||||||
#endif
|
#endif
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
|
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
|
||||||
pluginDir = OGRE_PLUGIN_DIR_REL;
|
pluginDir = OGRE_PLUGIN_DIR_REL;
|
||||||
|
|
|
@ -6,18 +6,12 @@
|
||||||
namespace Files {
|
namespace Files {
|
||||||
|
|
||||||
bool loadOgrePlugin(const std::string &pluginDir, std::string pluginName, Ogre::Root &ogreRoot) {
|
bool loadOgrePlugin(const std::string &pluginDir, std::string pluginName, Ogre::Root &ogreRoot) {
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
|
||||||
std::ostringstream verStream;
|
|
||||||
verStream << "." << OGRE_VERSION_MAJOR << "." << OGRE_VERSION_MINOR << "." << OGRE_VERSION_PATCH;
|
|
||||||
pluginName = pluginName + verStream.str();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::string pluginExt;
|
std::string pluginExt;
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
|
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
|
||||||
pluginExt = ".dll";
|
pluginExt = ".dll";
|
||||||
#endif
|
#endif
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
||||||
pluginExt = ".dylib";
|
pluginExt = ".framework";
|
||||||
#endif
|
#endif
|
||||||
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
|
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
|
||||||
pluginExt = ".so";
|
pluginExt = ".so";
|
||||||
|
|
Loading…
Reference in a new issue