Development Environment Setup

This page will describe how to set a dev env for several OSes. Please note that it is a work in progress and that it will be reliable only once each platform is marked as [TESTED].

You might also want to read the GitHub FAQ first.

=Third-Party Libraries and Tools=


 * OpenMW currently uses the following libraries:
 * OGRE 1.7.x - the main graphic engine
 * OIS - a cross-platform C++ input handling library
 * MyGUI - the in-game windows and menus
 * Audiere and OpenAL - for sound support
 * Bullet - the physics engine


 * OpenMw additionally uses the following tools:
 * CMake - used to manage the build process
 * Git - used as the source control management system

For those unfamiliar with Git, the Sphere RPG Engine group has a fairly useful short wiki page entitled "Git for the lazy". Make sure to also check out the GitHub FAQ.

=Windows=

Tools

 * Visual Studio 2008/2010 - normal or free express versions.
 * Cmake: CMake v2.8
 * Git - Our version control software: The file you want is Git-1.7.1-preview20100612.exe found HERE.

Libraries

 * Ogre: Choose OGRE v1.7.1 SDK for Visual Studio 2008 or 2010]
 * Boost: Boost lib used by OGRE but perhaps you should set it manually, in OGRE, boost system, file_system, and program_options are missing, you should download the mt and mt-gd for vc90 and putt libs and dll in your OgreSDK_vc9_v1-7-1\boost_1_42\lib dir, they are in the boost-binaries\1.42.0 section in sourceforge download page. The boost source included in OGRE is missing filesystem and program_option, you should download them from boost sources and copy the directories in Ogre3D\boost_1_42\boost dir.
 * Freetype: Freetype2 and set the environment variable FREETYPE_DIR to the 
 * OIS
 * OpenAL
 * Audiere
 * GNU C compiler Library
 * libsndfile

Once this is done, you're ready to get the source code.


 * Get the OpenMW Source code using GIT or Tortoise Git

Download and install all of these and make sure the environment (the system and Cmake) knows where they are. (Coming soon) Once everything is installed properly, run the following command in the directory that you installed OpenMW's source to:

Running and using CMake
First, before opening Cmake, create a sibling directory called "OpenMW - build" next to the root "openmw" so that an out-of-source build can be done.

Then you should update include dirs of project to add OGRE (\include and \include\OGRE).

Then you should include the correct path to needed libs (OgreSDK\lib & boost\lib) if not done by the CMake script. This may require first setting the OGRE_HOME environment, e.g..

At this point, you've got an exe generated, it needed OGRE dll to be run, the lazy way is to copy the OpenMW in OgreSDK\bin\debug that contains all needed files (dll en .cfg). In the same directory than the .exe, you should have the data directory of the Morrowind game - or alternatively, on Windows Vista or Windows 7, you can create a symbolic link to the data directory:

via Cygwin
Git is available on Windows via cygwin. Git can be used directly on Windows instead of grabbing source zip files from Github. The cygwin environment will allow you to use the same git command line commands as are recommended for the Linux environment. Note however that the cygwin version of CMake does not appear to support VS2008 as a valid target; therefore, cygwin can only be used for Git commands and a standard Windows command prompt should be used for invoking CMake.

via msysGit
There is also a stand-alone compiled package called msysgit. This will give you a Cygwin-like console with the git command, which you may find easier than via Cygwin.

via TortoiseGit
There is also a GUI git client for the one used to TortoiseSVN or TortoiseCVS which is called TortoiseGIT. It will give you a nice GUI inside the Windows explorer. This is the easy way.

via eclipse
First of all, you need the egit plugin. Install it, restart eclipse, "file -> import -> git -> clone"

=Linux=

Arch Dependencies
There are two AUR packages available for OpenMW, a stable and a development version. They can be found at https://aur.archlinux.org.

Information about building packages from the Arch User Repository (AUR) can be found at the Arch wiki.

Key requirement
In order to install Ogre, you need to add ubuntu's packager for Ogre (Andrew Fenn) as trusted:

note: "6F7E2F0B" is the id of Andrew Fenn.

In synaptic, go to settings -> Repositories -> add copy this into the field and click add source.

within synaptic search for ogre and mark 1.7.1 for installation. click apply.

Packages
You will also need g++ in order to compile OpenMW.

To install all dependencies type:

Boost libraries not included within the libogre-dev custom package.
Note: libboost-system-dev will be autoincluded in at least the filesystem package.

Install the development files for libogre-dev 1.7.1

Check
Do you have the 1.7.1 version?

More information is available here on the custom libogre-dev package. https://launchpad.net/~andrewfenn/+archive/ogredev

Bullet
You will also need to install bullet package. You can install from source which can be found at http://www.bulletphysics.com or you can get the gotdeb version at http://www.playdeb.net.

It also uses the cmake build system and can be installed like:

Or gotdeb version:

With make
Note that this is an out-of-source build. Generally, this is the preferred method when working with cmake. This creates a regular makefile.

Normally you can just run 'make' but if you have multiple cores, you can increase your compile time by doing this:

With codeblocks
If you want to create a Code::Blocks project instead, use these lines:

Please note, that the Code::Blocks generator only generates a makefile with a Code::Blocks wrapper.

=Mac OS X=

Dependencies
Make sure you set the following variables

MacPort
To download many of the required packages for building Open Morrowind you can use the MacPorts utility for the Mac OSX

http://www.macports.org/

Generic libraries required
You may have these installed but just incase run this to install a lot of generic libraries required for the build

Cmake
Using MacPort, install cmake. Cmake is what will be used to compile all the source files

Boost
Boost is a collection of c++ libraries that is required for Open Morrowind

OIS
OIS is required to control input form the keyboard and mouse in the game

Download the latest code from

http://sourceforge.net/projects/wgois

Download and install the latest version

Go to the install directory

Load the project file in XCODE Build the project and copy the files, this assumes you are in the root directory of the OIS project

Copy OIS.dylib and libOIS.a to /opt/local/lib/ Copy the folder OIS.framework to /Library/Frameworks

Ogre
Download the SDK from http://www.ogre3d.org/download/sdk

In the OgreSDK directory of the download, copy the /lib and /include directory to /opt/local/lib/ and /opt/local/include (respectively) Copy the folder /lib/release/OGRE.framework to /Library/Frameworks

Mpg123
Download the source from http://sourceforge.net/projects/mpg123/files/mpg123/

SND
Download the source from http://www.mega-nerd.com/libsndfile/#Download

Building
Note that this is an out-of-source build. Generally this is the preferred method when working with cmake.

This creates a regular makefile.

Test
Set up the environment. From the OpenMW directory

Copy Ogre plugins from Ogre SDK to Plugins subdir:

Create symlink to resources subdirectory:

Create symlinks for *.cfg files:

Create symbolic links to the executable

Link the data from the morrowind installation

Edit the file

/Build/openmw.cfg Contents/MacOS/openmw.cfg

with data and resource location

Run the game

=Data= You can use unshield to extract data from your Morrowind CD.

Datafiles are inside data1.cab and data2.cab. You just need to copy thoses files to you data folder : * Sound * Music * Video * Splash * Morrowind.esm * Morrowind.bsa

Edit your openmw.cfg file, and you are ready !