mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 20:53:50 +00:00
Merge branch 'openmw-27'
Conflicts: apps/opencs/CMakeLists.txt apps/opencs/main.cpp
This commit is contained in:
commit
04b1657d98
7 changed files with 84 additions and 17 deletions
|
@ -689,7 +689,10 @@ if (APPLE)
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINO})
|
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}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}")
|
set(OPENMW_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}")
|
||||||
|
|
||||||
|
set(OPENCS_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/OpenCS.app")
|
||||||
|
|
||||||
set(PLUGINS "")
|
set(PLUGINS "")
|
||||||
set(ABSOLUTE_PLUGINS "")
|
set(ABSOLUTE_PLUGINS "")
|
||||||
|
|
||||||
|
@ -750,7 +753,8 @@ if (APPLE)
|
||||||
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}\" \"${PLUGINS}\" \"${DIRS}\")
|
fixup_bundle(\"${OPENMW_APP}\" \"${PLUGINS}\" \"${DIRS}\")
|
||||||
|
fixup_bundle(\"${OPENCS_APP}\" \"\" \"${DIRS}\")
|
||||||
" COMPONENT Runtime)
|
" COMPONENT Runtime)
|
||||||
include(CPack)
|
include(CPack)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
|
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
// We need to do this because of Qt: https://bugreports.qt-project.org/browse/QTBUG-22154
|
// We need to do this because of Qt: https://bugreports.qt-project.org/browse/QTBUG-22154
|
||||||
#define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
#define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
||||||
#endif
|
#endif // MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
#include <boost/math/common_factor.hpp>
|
#include <boost/math/common_factor.hpp>
|
||||||
|
|
|
@ -3,10 +3,12 @@
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
|
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
// We need to do this because of Qt: https://bugreports.qt-project.org/browse/QTBUG-22154
|
// We need to do this because of Qt: https://bugreports.qt-project.org/browse/QTBUG-22154
|
||||||
#define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
#define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
||||||
#endif
|
#endif // MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
#include "maindialog.hpp"
|
#include "maindialog.hpp"
|
||||||
|
|
|
@ -152,13 +152,36 @@ qt4_add_resources(OPENCS_RES_SRC ${OPENCS_RES})
|
||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
set (OPENCS_MAC_ICON ${CMAKE_SOURCE_DIR}/files/mac/opencs.icns)
|
||||||
|
else()
|
||||||
|
set (OPENCS_MAC_ICON "")
|
||||||
|
endif(APPLE)
|
||||||
|
|
||||||
add_executable(opencs
|
add_executable(opencs
|
||||||
|
MACOSX_BUNDLE
|
||||||
${OPENCS_SRC}
|
${OPENCS_SRC}
|
||||||
${OPENCS_UI_HDR}
|
${OPENCS_UI_HDR}
|
||||||
${OPENCS_MOC_SRC}
|
${OPENCS_MOC_SRC}
|
||||||
${OPENCS_RES_SRC}
|
${OPENCS_RES_SRC}
|
||||||
|
${OPENCS_MAC_ICON}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
set_target_properties(opencs PROPERTIES
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${OpenMW_BINARY_DIR}"
|
||||||
|
OUTPUT_NAME "OpenCS"
|
||||||
|
MACOSX_BUNDLE_ICON_FILE "opencs.icns"
|
||||||
|
MACOSX_BUNDLE_BUNDLE_NAME "OpenCS"
|
||||||
|
MACOSX_BUNDLE_GUI_IDENTIFIER "org.openmw.opencs"
|
||||||
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${OPENMW_VERSION}
|
||||||
|
MACOSX_BUNDLE_BUNDLE_VERSION ${OPENMW_VERSION}
|
||||||
|
)
|
||||||
|
|
||||||
|
set_source_files_properties(${OPENCS_MAC_ICON} PROPERTIES
|
||||||
|
MACOSX_PACKAGE_LOCATION Resources)
|
||||||
|
endif(APPLE)
|
||||||
|
|
||||||
target_link_libraries(opencs
|
target_link_libraries(opencs
|
||||||
${Boost_LIBRARIES}
|
${Boost_LIBRARIES}
|
||||||
${QT_LIBRARIES}
|
${QT_LIBRARIES}
|
||||||
|
@ -169,3 +192,6 @@ if(DPKG_PROGRAM)
|
||||||
INSTALL(TARGETS opencs RUNTIME DESTINATION games COMPONENT opencs)
|
INSTALL(TARGETS opencs RUNTIME DESTINATION games COMPONENT opencs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
INSTALL(TARGETS opencs BUNDLE DESTINATION OpenMW COMPONENT BUNDLE)
|
||||||
|
endif()
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
|
|
||||||
#include <components/ogreinit/ogreinit.hpp>
|
#include <components/ogreinit/ogreinit.hpp>
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
#include <QDir>
|
||||||
|
#endif
|
||||||
|
|
||||||
class Application : public QApplication
|
class Application : public QApplication
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
@ -43,6 +47,25 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
Application mApplication (argc, argv);
|
Application mApplication (argc, argv);
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
QDir dir(QCoreApplication::applicationDirPath());
|
||||||
|
if (dir.dirName() == "MacOS") {
|
||||||
|
dir.cdUp();
|
||||||
|
dir.cdUp();
|
||||||
|
dir.cdUp();
|
||||||
|
}
|
||||||
|
QDir::setCurrent(dir.absolutePath());
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
mApplication.setLibraryPaths(libraryPaths);
|
||||||
|
#endif
|
||||||
|
|
||||||
mApplication.setWindowIcon (QIcon (":./opencs.png"));
|
mApplication.setWindowIcon (QIcon (":./opencs.png"));
|
||||||
|
|
||||||
CS::Editor editor;
|
CS::Editor editor;
|
||||||
|
|
|
@ -2245,28 +2245,38 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, co
|
||||||
mData.setDescription ("");
|
mData.setDescription ("");
|
||||||
mData.setAuthor ("");
|
mData.setAuthor ("");
|
||||||
}
|
}
|
||||||
/// \todo un-outcomment the else, once loading an existing content file works properly again.
|
|
||||||
else
|
bool filtersFound = false;
|
||||||
{
|
|
||||||
if (boost::filesystem::exists (mProjectPath))
|
if (boost::filesystem::exists (mProjectPath))
|
||||||
{
|
{
|
||||||
getData().loadFile (mProjectPath, false, true);
|
filtersFound = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
boost::filesystem::path locCustomFiltersPath (configuration.getUserPath());
|
boost::filesystem::path locCustomFiltersPath (configuration.getUserPath());
|
||||||
locCustomFiltersPath /= "defaultfilters";
|
locCustomFiltersPath /= "defaultfilters";
|
||||||
|
|
||||||
if (boost::filesystem::exists(locCustomFiltersPath))
|
if (boost::filesystem::exists(locCustomFiltersPath))
|
||||||
{
|
{
|
||||||
boost::filesystem::copy_file (locCustomFiltersPath, mProjectPath);
|
boost::filesystem::copy_file (locCustomFiltersPath, mProjectPath);
|
||||||
} else {
|
filtersFound = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
boost::filesystem::path filters(mResDir);
|
boost::filesystem::path filters(mResDir);
|
||||||
filters /= "defaultfilters";
|
filters /= "defaultfilters";
|
||||||
|
|
||||||
|
if (boost::filesystem::exists(filters))
|
||||||
|
{
|
||||||
boost::filesystem::copy_file(filters, mProjectPath);
|
boost::filesystem::copy_file(filters, mProjectPath);
|
||||||
|
filtersFound = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filtersFound)
|
||||||
getData().loadFile (mProjectPath, false, true);
|
getData().loadFile (mProjectPath, false, true);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
addOptionalGmsts();
|
addOptionalGmsts();
|
||||||
addOptionalGlobals();
|
addOptionalGlobals();
|
||||||
|
|
BIN
files/mac/opencs.icns
Normal file
BIN
files/mac/opencs.icns
Normal file
Binary file not shown.
Loading…
Reference in a new issue