Changes between Initial Version and Version 1 of GameDevelopment/Ogre/BuildingOgreOnMinGw


Ignore:
Timestamp:
Feb 18, 2016, 7:15:41 PM (9 years ago)
Author:
Vijay Varadan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GameDevelopment/Ogre/BuildingOgreOnMinGw

    v1 v1  
     1= Building Ogre3D 1.81 on MinGW =
     2Oct 31 2012
     3
     4[[Image(htdocs:images/ogre3d/logo-img-only-halfsize.png, alt="Ogre 3D", align=center)]]
     5
     6'''Assumptions:''' You're familiar with Windows & Unix utilities, shell scripting ( bash & cmd ),
     7have knowledge of command line compilation and are generally fearless, like a lion.
     8
     9I put all third party code in ~/external, build them to ~/build/output and install them to
     10~/build/install. I eschew system wide installs and prefer to use local installation where possible,
     11but I don't fight it too much - take the case of python. I'd prefer a simple unzip of python,
     12but that doesn't work for a bunch of stuff ( like mercurial, !NumPy, pygame ) that looks for
     13registry entries in Windows for successful installation.
     14So, I just use the installer from the python.org site.
     15
     16== Building Ogre ==
     17Here's my development setup:
     18
     19||Platform||Windows 7 x64||
     20||Toolchain||mingw gcc on msys which you can get [http://www.mingw.org/ here].||
     21||gcc version||4.7.0 - get this with mingw||
     22||python version||2.7.3 for x86 from [http://python.org python.org]||
     23||mercurial version||2.3.2 for x86, I use the '''python package'''. From the [http://mercurial.selenic.com/ official site].||
     24||Ogre version||1.8.1 from the [https://bitbucket.org/sinbad/ogre/src/461061ec4d470547fdcd8a73ded6aee29df20505/?at=v1-8 bitbucket repo]||
     25||Ogre dependencies||default branch from the [https://bitbucket.org/cabalistic/ogredeps bitbucket repo]||
     26||Boost version||1.51||
     27||DirectX SDK version||[http://www.microsoft.com/en-us/download/details.aspx?id=6812 June 2010]||
     28
     29If you run into issues, see [http://stackoverflow.com/questions/4102259/directx-sdk-june-2010-installation-problems-error-code-s1023 this Stack Overflow question]||
     30
     31=== Step 1: Boost ===
     32This step is completely optional, as boost is not a required dependency. I'm planning on using multi-threading and a whole host of boost libraries.
     33See the post [http://vijay.axham.com/blog/478/building-boost-binaries-on-mingw Building boost Binaries on MinGW].
     34'''Note:''' I build '''everything''' in boost, rather than just the bare minimum required for multi-threading.
     35
     36=== Step 2: Ogre Dependencies ===
     371. Get a bitbucket account if you don't already have one. Add your ssh pub key to the account - there are instructions on the bitbucket site, if you don't already know how to do this. You can use https instead of ssh, but modify the URL passed to hg clone accordingly.
     381. Fetch the source code.
     39{{{#!bash
     40export OGRE_SOURCE_DIR=~/external/ogre/v1-8
     41mkdir -p $OGRE_SOURCE_DIR
     42cd $OGRE_SOURCE_DIR
     43hg clone ssh://hg@bitbucket.org/cabalistic/ogredeps
     44export OGREDEPS_SOURCE_DIR=$OGRE_SOURCE_DIR/ogredeps
     45}}}
     461. Set up some environment vars and build the deps:
     47{{{#!bash
     48export BUILD_OUTPUT_DIR=~/build/output
     49export OGRE_OUTPUT_DIR=$BUILD_OUTPUT_DIR/ogre/v1-8
     50export OGREDEPS_OUTPUT_DIR=$OGRE_OUTPUT_DIR/ogredeps
     51export BUILD_INSTALL_DIR=~/build/install
     52export OGREDEPS_INSTALL_DIR=$BUILD_INSTALL_DIR/ogredeps
     53mkdir -p $OGREDEPS_OUTPUT_DIR
     54cd $OGREDEPS_OUTPUT_DIR
     55}}}
     561. If you're using MinGW under MSYS:
     57
     58   `cmake $OGREDEPS_SOURCE_DIR -G "MSYS Makefiles"`
     59
     60   '''or''' if you're using MinGW without MSYS:
     61
     62   `cmake $OGREDEPS_SOURCE_DIR -G "MinGW Makefiles"`
     63
     64{{{#!bash
     65make
     66mkdir $BUILD_INSTALL_DIR
     67make install
     68mv ogredeps $OGREDEPS_INSTALL_DIR
     69}}}
     70
     71=== Step 3: Ogre SDK ===
     72
     73This is rather similar to building the dependencies.
     74
     751. Fetch the source code.
     76{{{#!bash
     77export OGRE_SOURCE_DIR=~/external/ogre/v1-8
     78mkdir -p $OGRE_SOURCE_DIR
     79cd $OGRE_SOURCE_DIR
     80hg clone ssh://hg@bitbucket.org/sinbad/ogre
     81export OGRESDK_SOURCE_DIR=$OGRE_SOURCE_DIR/ogre
     82}}}
     831. We need to tell Ogre where boost is:
     84{{{#!bash
     85export BOOST_ROOT=~/build/install/boost_1_51_0
     86export BOOST_INCLUDEDIR=$BOOST_ROOT/include/boost-1_51
     87export BOOST_LIBRARYDIR=$BOOST_ROOT/library
     88}}}
     89   On posix systems, you don't need to set BOOST_INCLUDEDIR or BOOST_LIBRARYDIR,
     90   but if you do set them, BOOST_INCLUDEDIR should be set as follows:
     91   `export BOOST_INCLUDEDIR=$BOOST_ROOT/include`
     921. And where the dependencies are:
     93   `export OGRE_DEPENDENCIES_DIR=~/build/install/ogredeps`
     941. Set up some environment vars for build and install locations:
     95{{{#!bash
     96export BUILD_OUTPUT_DIR=~/build/output
     97export OGRE_OUTPUT_DIR=$BUILD_OUTPUT_DIR/ogre/v1-8
     98export OGRESDK_OUTPUT_DIR=$OGRE_OUTPUT_DIR/ogre
     99export BUILD_INSTALL_DIR=~/build/install
     100export OGRESDK_INSTALL_DIR=$BUILD_INSTALL_DIR/ogre
     101mkdir -p $OGRESDK_OUTPUT_DIR
     102cd $OGRESDK_OUTPUT_DIR
     103}}}
     1041. If you're using MinGW under MSYS:
     105
     106   `cmake $OGRESDK_SOURCE_DIR -G "MSYS Makefiles"`
     107
     108   '''or '''if you're using MinGW without MSYS:
     109
     110   `cmake $OGRESDK_SOURCE_DIR -G "MinGW Makefiles"`
     111{{{#!bash
     112make
     113mkdir $BUILD_INSTALL_DIR
     114make install
     115mv sdk $OGRESDK_INSTALL_DIR
     116}}}
     117
     118At this point, you should have your boost stuff in {{{#!bash ~/build/install/boost_1_51_0 }}},
     119ogre dependencies in {{{#!bash ~/build/install/ogredeps }}} and the ogre sdk in
     120{{{#!bash ~/build/install/ogre }}}.
     121To build applications, simply add the relevant include and library paths to the compiler and
     122linker options. On posix systems, add the bin directories to LD_LIBRARY_PATH environment variable.
     123On Windows and MinGW, add the bin directories to the PATH environment variable.
     124