mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 16:36:42 +00:00
Merge remote branch 'corristo/osx-packaging' into config
This commit is contained in:
commit
d9c1ed3d5e
3 changed files with 32 additions and 24 deletions
|
@ -415,9 +415,6 @@ endif()
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(INSTALL_SUBDIR OpenMW)
|
set(INSTALL_SUBDIR OpenMW)
|
||||||
|
|
||||||
#install(FILES ${MISC_FILES} DESTINATION ../MacOS)
|
|
||||||
#install(DIRECTORY "${APP_BUNDLE_DIR}/Contents/Plugins" DESTINATION ..)
|
|
||||||
#install(DIRECTORY "${APP_BUNDLE_DIR}/Contents/Resources/resources" DESTINATION ../Resources)
|
|
||||||
install(DIRECTORY "${APP_BUNDLE_DIR}" USE_SOURCE_PERMISSIONS DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
|
install(DIRECTORY "${APP_BUNDLE_DIR}" USE_SOURCE_PERMISSIONS DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
|
||||||
install(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
|
install(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
|
||||||
install(FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" RENAME "openmw.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
|
install(FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" RENAME "openmw.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
|
||||||
|
@ -425,9 +422,6 @@ if (APPLE)
|
||||||
install(FILES "${OpenMW_BINARY_DIR}/plugins.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
|
install(FILES "${OpenMW_BINARY_DIR}/plugins.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
|
||||||
install(FILES "${OpenMW_BINARY_DIR}/launcher.qss" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
|
install(FILES "${OpenMW_BINARY_DIR}/launcher.qss" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
|
||||||
set(CPACK_GENERATOR "DragNDrop")
|
set(CPACK_GENERATOR "DragNDrop")
|
||||||
# set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/files/mac/Info.plist")
|
|
||||||
# set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/files/mac/openmw.icns")
|
|
||||||
# set(CPACK_BUNDLE_NAME "OpenMW")
|
|
||||||
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_MINO})
|
||||||
|
@ -437,11 +431,13 @@ if (APPLE)
|
||||||
set(PLUGINS "")
|
set(PLUGINS "")
|
||||||
|
|
||||||
# Scan Plugins dir for *.dylibs
|
# Scan Plugins dir for *.dylibs
|
||||||
file(GLOB ALL_PLUGINS "${APP_BUNDLE_DIR}/Contents/Plugins/*.dylib")
|
set(PLUGIN_SEARCH_ROOT "${APP_BUNDLE_DIR}/Contents/Plugins")
|
||||||
|
file(GLOB_RECURSE ALL_PLUGINS "${PLUGIN_SEARCH_ROOT}/*.dylib")
|
||||||
|
|
||||||
|
set(PLUGIN_INSTALL_BASE "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}/Contents/Plugins")
|
||||||
foreach(PLUGIN ${ALL_PLUGINS})
|
foreach(PLUGIN ${ALL_PLUGINS})
|
||||||
get_filename_component(PLUGIN_FILENAME ${PLUGIN} NAME)
|
string(REPLACE "${PLUGIN_SEARCH_ROOT}/" "" PLUGIN_RELATIVE "${PLUGIN}")
|
||||||
set(PLUGINS ${PLUGINS} "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}/Contents/Plugins/${PLUGIN_FILENAME}")
|
set(PLUGINS ${PLUGINS} "${PLUGIN_INSTALL_BASE}/${PLUGIN_RELATIVE}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
#For now, search unresolved dependencies only in default system paths, so if you put unresolveable (i.e. with @executable_path in id name) lib or framework somewhere else, it would fail
|
#For now, search unresolved dependencies only in default system paths, so if you put unresolveable (i.e. with @executable_path in id name) lib or framework somewhere else, it would fail
|
||||||
|
|
|
@ -41,8 +41,10 @@ source_group(launcher FILES ${LAUNCHER} ${LAUNCHER_HEADER} ${LAUNCHER_HEADER_MOC
|
||||||
find_package(Qt4 REQUIRED)
|
find_package(Qt4 REQUIRED)
|
||||||
set(QT_USE_QTGUI 1)
|
set(QT_USE_QTGUI 1)
|
||||||
|
|
||||||
#find_package(PNG REQUIRED)
|
if (NOT APPLE) # this dependency can be completely removed, but now it only tested on OS X
|
||||||
#include_directories(${PNG_INCLUDE_DIR})
|
find_package(PNG REQUIRED)
|
||||||
|
include_directories(${PNG_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
QT4_ADD_RESOURCES(RCC_SRCS resources.qrc)
|
QT4_ADD_RESOURCES(RCC_SRCS resources.qrc)
|
||||||
QT4_WRAP_CPP(MOC_SRCS ${LAUNCHER_HEADER_MOC})
|
QT4_WRAP_CPP(MOC_SRCS ${LAUNCHER_HEADER_MOC})
|
||||||
|
@ -51,14 +53,14 @@ include(${QT_USE_FILE})
|
||||||
|
|
||||||
# list here plugins that can't be detected statically, but loaded in runtime
|
# list here plugins that can't be detected statically, but loaded in runtime
|
||||||
# it needed for packaging automatisation
|
# it needed for packaging automatisation
|
||||||
#set(USED_QT_PLUGINS imageformats/libqgif
|
set(USED_QT_PLUGINS imageformats/libqgif
|
||||||
# imageformats/libqico
|
imageformats/libqico
|
||||||
# imageformats/libqjpeg
|
imageformats/libqjpeg
|
||||||
# imageformats/libqmng
|
imageformats/libqmng
|
||||||
# imageformats/libqsvg
|
imageformats/libqsvg
|
||||||
# imageformats/libqtga
|
imageformats/libqtga
|
||||||
# imageformats/libqtiff)
|
imageformats/libqtiff)
|
||||||
# It seems that launcher works without this plugins, but it loads them into memory if they exists
|
# It seems that launcher works without this plugins, but it loads them if they exists
|
||||||
|
|
||||||
# Main executable
|
# Main executable
|
||||||
add_executable(omwlauncher
|
add_executable(omwlauncher
|
||||||
|
@ -71,7 +73,7 @@ target_link_libraries(omwlauncher
|
||||||
${Boost_LIBRARIES}
|
${Boost_LIBRARIES}
|
||||||
${OGRE_LIBRARIES}
|
${OGRE_LIBRARIES}
|
||||||
${QT_LIBRARIES}
|
${QT_LIBRARIES}
|
||||||
# ${PNG_LIBRARY}
|
${PNG_LIBRARY}
|
||||||
components
|
components
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -86,10 +88,10 @@ if (APPLE)
|
||||||
"${APP_BUNDLE_DIR}/../launcher.cfg")
|
"${APP_BUNDLE_DIR}/../launcher.cfg")
|
||||||
|
|
||||||
# copy used QT plugins into ${APP_BUNDLE_DIR}/Contents/Plugins
|
# copy used QT plugins into ${APP_BUNDLE_DIR}/Contents/Plugins
|
||||||
#foreach(PLUGIN ${USED_QT_PLUGINS})
|
foreach(PLUGIN ${USED_QT_PLUGINS})
|
||||||
# get_filename_component(PLUGIN_FILENAME ${PLUGIN} NAME)
|
get_filename_component(PLUGIN_FILENAME ${PLUGIN} NAME)
|
||||||
# configure_file("${QT_PLUGINS_DIR}/${PLUGIN}.dylib" "${APP_BUNDLE_DIR}/Contents/Plugins/${PLUGIN_FILENAME}.dylib" COPYONLY)
|
configure_file("${QT_PLUGINS_DIR}/${PLUGIN}.dylib" "${APP_BUNDLE_DIR}/Contents/Plugins/${PLUGIN}.dylib" COPYONLY)
|
||||||
#endforeach()
|
endforeach()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/files/launcher.qss
|
configure_file(${CMAKE_SOURCE_DIR}/files/launcher.qss
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QtDebug>
|
||||||
|
|
||||||
#include "maindialog.hpp"
|
#include "maindialog.hpp"
|
||||||
|
|
||||||
|
@ -17,6 +18,15 @@ int main(int argc, char *argv[])
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// force Qt to load only LOCAL plugins, don't touch system Qt installation
|
||||||
|
QDir pluginsPath(QCoreApplication::applicationDirPath());
|
||||||
|
pluginsPath.cdUp();
|
||||||
|
pluginsPath.cd("Plugins");
|
||||||
|
|
||||||
|
QStringList libraryPaths;
|
||||||
|
libraryPaths << pluginsPath.path() << QCoreApplication::applicationDirPath();
|
||||||
|
app.setLibraryPaths(libraryPaths);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QDir::setCurrent(dir.absolutePath());
|
QDir::setCurrent(dir.absolutePath());
|
||||||
|
|
Loading…
Reference in a new issue