Article originally written by Srekel

Here's how to build PyOgre from CVS (using Microsoft Visual Studio 2003/7.1 and Python 2.4).

Setting up OGRE

Step 1 - Get OGRE

  • Download "OGRE 1.0.x Source for Windows".
  • Save it to C:\temp, and unpack it to C:\temp\ogre-win32-v1-0-5 (that's the version I'm building right now when writing this).
  • Checkout the PyOgre trunk from here: by installing Subversion and running this command:

# Checkout this branch to get the current development branch
  svn checkout
  # Checkout the trunk if you intend to use Ogre 1.0.6
  svn checkout

Step 2 - Compile OGRE

  • Read the docs (readme.html) in C:\temp\ogre-win32-v1-0-5\ogrenew\Docs. This includes getting the dependencies you need.
  • When compiling, be sure to enable RTTI. In VS 2003, this is done by selecting all the projects in the solution, open the properties window, and in C/C++ -> Linker, make sure "Enable Run-Time Type Info" is set to "Yes".
  • HBuild (in the menu) and then Batch Build.
  • Compiling takes about 30-60 minutes depending on your computer.

Setting up PyOgre

Step 1 - Download PyOgre from the CVS

  • Easily done with TortoiseCVS
  • Place it in C:\pyogre

Step 2 - Compile SWIG files

  • Download SWIG 1.3.24 and unpack it to C:\temp\SWIG-1.3.24
  • Open a command prompt and go to C:\temp\pyogre\pyogre\ogre and type

C:\temp\SWIG-1.3.24\swig.exe -modern -python -c++ -IC:\temp\ogre-win32-v1-0-5\ogrenew\OgreMain\include ogre.i

-> this should create a ogre_wrap.cxx file (and possibly something else) you need.

Step 3 - Compile PyOgre

  • Open up the solution file (pyogre.sln) in C:\temp\pyogre\scripts\vc71
  • Open up the properties window for the pyogre project (sorry, I haven't tried compiling with cegui support yet!)
    • Change "Configuration" to "Release Py24"
    • Under C/C++ -> General, change include dir to this (provided you have Python installed under C:\Python24): C:\temp\ogre-win32-v1-0-5\ogrenew\OgreMain\include;C:\Python24\include
    • Under Linker -> General, change library dir to this (provided you have Python installed under C:\Python24): C:\temp\ogre-win32-v1-0-5\ogrenew\OgreMain\lib\Release;C:\Python24\libs

  • Change so you'll be builing "Release Py24"
  • Hit Build -> Build pyogre
  • Compiling takes 1-5 minutes or so.

Installing PyOgre

Automatic Installation

  • After you have built the system, you should be able to install it by running this command from the trunk directory:

python install

Manual Installation

If the automatic setup fails, please report this in the forums. Here are instructions for manual installation in case you need it.

Backup any previous installation of PyOgre

  • Make a backup of your pyogre folder under C:\Python24\Lib\site-packages

Copy OGRE files

  • Go to C:\temp\ogre-win32-v1-0-5\ogrenew\Samples\Common\bin\Release and copy all the dll files and the .cfg files to C:\Python24\Lib\site-packages\pyogre

Copy PyOgre files

  • Go to C:\temp\pyogre\pyogre and copy "", "_ogre.pyd", and "plugins.cfg" to C:\Python24\Lib\site-packages\pyogre
  • Go to C:\temp\pyogre\pyogre\ogre and copy "" to C:\Python24\Lib\site-packages\pyogre
  • Optionally, copy the PyOgre demos from C:\temp\pyogre\demos

That's it! Or should be at least. If you have any problems, post in the PyOgre forums.