1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 21:45:32 +00:00

Builds on OS X now

This commit is contained in:
Nikolay Kasyanov 2011-03-07 05:09:29 +03:00
parent 3b47eb4a69
commit 4028600768
7 changed files with 33 additions and 18 deletions

View file

@ -273,7 +273,7 @@ configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg
if (APPLE)
set(APPLE_BUNDLE_RESOURCES
${CMAKE_SOURCE_DIR}/files/openmw.cfg
${CMAKE_SOURCE_DIR}/files/mac/plugins.cfg
${CMAKE_SOURCE_DIR}/files/plugins.cfg.mac
)
endif (APPLE)
@ -287,12 +287,7 @@ endif (CMAKE_COMPILER_IS_GNUCC)
if (APPLE)
set(MISC_FILES
${CMAKE_SOURCE_DIR}/files/openmw.cfg
${CMAKE_SOURCE_DIR}/files/mac/plugins.cfg
${CMAKE_SOURCE_DIR}/files/mac/ogre.cfg)
install(TARGETS openmw
BUNDLE DESTINATION .
RUNTIME DESTINATION ../MacOS
COMPONENT Runtime)
${CMAKE_SOURCE_DIR}/files/plugins.cfg.mac)
install(FILES ${MISC_FILES} DESTINATION ../MacOS)
set(CPACK_GENERATOR "Bundle")
set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/files/mac/Info.plist")

View file

@ -242,6 +242,10 @@ target_link_libraries(openmw
if (APPLE)
find_library(CARBON_FRAMEWORK Carbon)
target_link_libraries(openmw ${CARBON_FRAMEWORK})
install(TARGETS openmw
BUNDLE DESTINATION .
RUNTIME DESTINATION ../MacOS
COMPONENT Runtime)
endif (APPLE)
if(DPKG_PROGRAM)

View file

@ -13,7 +13,7 @@ std::string OMW::Path::getPath(PathTypeEnum parType, const std::string parApp, c
if(parType == GLOBAL_CFG_PATH)
{
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
theBasePath = macBundlePath() + "/Contents/MacOS/"; //FIXME do we have global/local with OSX?
theBasePath = Ogre::macBundlePath() + "/Contents/MacOS/"; //FIXME do we have global/local with OSX?
#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
theBasePath = "/etc/"+parApp+"/";
#else
@ -24,7 +24,7 @@ std::string OMW::Path::getPath(PathTypeEnum parType, const std::string parApp, c
else
{
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
theBasePath = macBundlePath() + "/Contents/MacOS/"; //FIXME do we have global/local with OSX?
theBasePath = Ogre::macBundlePath() + "/Contents/MacOS/"; //FIXME do we have global/local with OSX?
#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
const char* theDir;
if ((theDir = getenv("OPENMW_HOME")) != NULL)

View file

@ -4,6 +4,10 @@
#include <OgrePlatform.h>
#include <string>
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
#include <OSX/macUtils.h>
#endif
namespace OMW
{
class Path

View file

@ -259,11 +259,11 @@ namespace ESMS
int getSize() { return count; }
// List of interior cells. Indexed by cell name.
typedef std::map<std::string,Cell*, ciLessBoost> IntCells;
typedef std::map<std::string,ESM::Cell*, ciLessBoost> IntCells;
IntCells intCells;
// List of exterior cells. Indexed as extCells[gridX][gridY].
typedef std::map<int, Cell*> ExtCellsCol;
typedef std::map<int, ESM::Cell*> ExtCellsCol;
typedef std::map<int, ExtCellsCol> ExtCells;
ExtCells extCells;
@ -283,7 +283,7 @@ namespace ESMS
}
const Cell* findInt(const std::string &id) const
const ESM::Cell* findInt(const std::string &id) const
{
IntCells::const_iterator it = intCells.find(id);
@ -293,7 +293,7 @@ namespace ESMS
return it->second;
}
const Cell *searchExt (int x, int y) const
const ESM::Cell *searchExt (int x, int y) const
{
ExtCells::const_iterator it = extCells.find (x);
@ -308,7 +308,7 @@ namespace ESMS
return it2->second;
}
const Cell *searchExtByName (const std::string& id) const
const ESM::Cell *searchExtByName (const std::string& id) const
{
for (ExtCells::const_iterator iter = extCells.begin(); iter!=extCells.end(); ++iter)
{
@ -323,7 +323,7 @@ namespace ESMS
return 0;
}
const Cell *searchExtByRegion (const std::string& id) const
const ESM::Cell *searchExtByRegion (const std::string& id) const
{
std::string id2 = toLower (id);
@ -345,13 +345,13 @@ namespace ESMS
count++;
// All cells have a name record, even nameless exterior cells.
Cell *cell = new Cell;
ESM::Cell *cell = new ESM::Cell;
cell->name = id;
// The cell itself takes care of all the hairy details
cell->load(esm);
if(cell->data.flags & Cell::Interior)
if(cell->data.flags & ESM::Cell::Interior)
{
// Store interior cell by name
intCells[id] = cell;

View file

@ -8,7 +8,7 @@ bool isFile(const char *name)
return boost::filesystem::exists(cfg_file_path);
}
#ifdef __MACOSX__
#ifdef OGRE_PLATFORM == OGRE_PLATFORM_APPLE
#include <CoreFoundation/CoreFoundation.h>
std::string macBundlePath()

12
files/plugins.cfg.mac Normal file
View file

@ -0,0 +1,12 @@
# Defines plugins to load
# Define plugin folder
PluginFolder=${OGRE_PLUGIN_DIR}
# Define plugins
Plugin=RenderSystem_GL
Plugin=Plugin_ParticleFX
Plugin=Plugin_OctreeSceneManager
# Plugin=Plugin_CgProgramManager