History: PyOgreBuildingOnWindows
Source of version: 2 (current)
Copy to clipboard
''Article originally written by Srekel''
Here's how to build PyOgre from CVS (using Microsoft Visual Studio 2003/7.1 and Python 2.4).
{maketoc}
!!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: [https://developer.berlios.de/svn/?group_id=3464] by installing Subversion and running this command:
{CODE(wrap="1", colors="python")} # Checkout this branch to get the current development branch
svn checkout http://svn.berlios.de/svnroot/repos/pyogre/branches/dev-1.2.0
# Checkout the trunk if you intend to use Ogre 1.0.6
svn checkout http://svn.berlios.de/svnroot/repos/pyogre/trunk
{CODE}
!!!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 [http://1.3.24|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
{CODE(wrap="1", colors="python")} C:\temp\SWIG-1.3.24\swig.exe -modern -python -c++ -IC:\temp\ogre-win32-v1-0-5\ogrenew\OgreMain\include ogre.i{CODE}
-> 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:
{CODE(wrap="1", colors="python")} python setup_win32.py install{CODE}
!!!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 "__init__.py", "_ogre.pyd", and "plugins.cfg" to C:\Python24\Lib\site-packages\pyogre
* Go to C:\temp\pyogre\pyogre\ogre and copy "ogre.py" 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 [http://www.ogre3d.org/phpBB2addons/viewforum.php?f=3&sid=2c5d6af8ed0f3e6a9ba7542f37925690|PyOgre forums].