Feature #162 - Need to create app bundle using CMake, not by hand.

In progress, working towards plugins support.
pull/21/head
Nikolay Kasyanov 13 years ago
parent a301fc355e
commit 705b2955a0

@ -7,31 +7,6 @@ if (APPLE)
# using 10.6 sdk # using 10.6 sdk
set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk") set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk")
# This override needed to handle cases where some dependencies already fixed up,
# so BundleUtilities cannot find them
#function(gp_resolve_item_override context item exepath dirs resolved_item resolved)
# message(STATUS "gp_resolve_item_override for ${item} with ${exepath} and ${dirs}")
# if(item MATCHES "@executable_path" AND resolved)
# if (item MATCHES "Frameworks") # if it is a framework
# # get last segment of path
# get_filename_component(fname "${item}" NAME_WE)
# # now cycle through dirs
# find_library(ri NAMES ${fname} PATHS ${exepath} ${dirs})
# if (ri)
# message(STATUS "found ${ri} for ${item}")
# set(${resolved_item_var} ri)
# endif()
# endif()
# endif()
#endfunction(gp_resolve_item_override)
#gp_resolve_item_override("" "@executable_path/../Frameworks/Ogre.framework"
# /Users/corristo/Projects/OpenMW/build/OpenMW.app/Contents/MacOS
# ""
# ""
# "")
endif (APPLE) endif (APPLE)
# Macros # Macros
@ -227,6 +202,13 @@ include_directories("."
link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR}) link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR})
if(APPLE)
# List used Ogre plugins
SET(USED_OGRE_PLUGINS "RenderSystem_GL"
"Plugin_OctreeSceneManager"
"Plugin_ParticleFX")
endif(APPLE)
add_subdirectory( extern/caelum ) add_subdirectory( extern/caelum )
add_subdirectory( extern/mygui_3.0.1 ) add_subdirectory( extern/mygui_3.0.1 )
@ -270,22 +252,17 @@ if (APPLE)
"${OpenMW_BINARY_DIR}/plugins.cfg") "${OpenMW_BINARY_DIR}/plugins.cfg")
configure_file(${OpenMW_SOURCE_DIR}/files/mac/Info.plist configure_file(${OpenMW_SOURCE_DIR}/files/mac/Info.plist
"${APP_BUNDLE_DIR}/Contents/Info.plist" COPYONLY) "${APP_BUNDLE_DIR}/Contents/Info.plist")
configure_file(${OpenMW_SOURCE_DIR}/files/mac/openmw.icns configure_file(${OpenMW_SOURCE_DIR}/files/mac/openmw.icns
"${APP_BUNDLE_DIR}/Contents/Resources/OpenMW.icns" COPYONLY) "${APP_BUNDLE_DIR}/Contents/Resources/OpenMW.icns" COPYONLY)
# prepare plugins # prepare plugins
configure_file(${OGRE_PLUGIN_DIR}/RenderSystem_GL.dylib foreach(plugin ${USED_OGRE_PLUGINS})
"${APP_BUNDLE_DIR}/Contents/Plugins/RenderSystem_GL.dylib" COPYONLY) configure_file("${OGRE_PLUGIN_DIR}/${plugin}.dylib"
"${APP_BUNDLE_DIR}/Contents/Plugins/${plugin}.dylib"
configure_file(${OGRE_PLUGIN_DIR}/Plugin_OctreeSceneManager.dylib COPYONLY)
"${APP_BUNDLE_DIR}/Contents/Plugins/Plugin_OctreeSceneManager.dylib" COPYONLY) endforeach()
configure_file(${OGRE_PLUGIN_DIR}/Plugin_ParticleFX.dylib
"${APP_BUNDLE_DIR}/Contents/Plugins/Plugin_ParticleFX.dylib" COPYONLY)
endif (APPLE) endif (APPLE)
@ -427,6 +404,12 @@ set(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINO})
set(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE}) set(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE})
set(APPS "\${CMAKE_INSTALL_PREFIX}/${APP_BUNDLE_NAME}") set(APPS "\${CMAKE_INSTALL_PREFIX}/${APP_BUNDLE_NAME}")
set(PLUGINS "")
foreach(plugin ${USED_OGRE_PLUGINS})
set(PLUGINS ${PLUGINS} "\${CMAKE_INSTALL_PREFIX}/${APP_BUNDLE_NAME}/Contents/Plugins/${plugin}.dylib")
endforeach()
set(DIRS "") set(DIRS "")
INSTALL(CODE " INSTALL(CODE "
@ -459,7 +442,7 @@ INSTALL(CODE "
cmake_policy(SET CMP0009 OLD) cmake_policy(SET CMP0009 OLD)
set(BU_CHMOD_BUNDLE_ITEMS ON) set(BU_CHMOD_BUNDLE_ITEMS ON)
include(BundleUtilities) include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"\" \"${DIRS}\") fixup_bundle(\"${APPS}\" \"${PLUGINS}\" \"${DIRS}\")
" COMPONENT Runtime) " COMPONENT Runtime)
include(CPack) include(CPack)

@ -19,7 +19,7 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>0.10</string> <string>${OPENMW_VERSION}</string>
<key>CSResourcesFileMapped</key> <key>CSResourcesFileMapped</key>
<true/> <true/>
<key>LSRequiresCarbon</key> <key>LSRequiresCarbon</key>

Loading…
Cancel
Save