Setting up OGRE for Linux


These instructions were built using Ubuntu 14.04. Other distibutions of Linux may have different commands that accomplish the same things.

Getting the software

  1. Get the dependencies. You can do this all at once, but I broke it up into three commands.

    sudo apt-get -y install cmake libboost-dev libboost-dbg libois-1.3.0 libois-dev
    sudo apt-get -y install nvidia-cg-toolkit doxygen graphviz libcppunit-dev mercurial libtinyxml-dev
    sudo apt-get -y install libtinyxml-doc libtinyxml2-dev libxrandr2 libpoco-dev libtbb2 libxrandr-dev libexpat1-dev libxml2-dev

  2. Download OGRE's source code from Mercurial. This will create an ogre subdirectory in your current directory.

    hg clone https://bitbucket.org/sinbad/ogre/ -u v1-9

  3. Build OGRE. CMake will tell you if you are missing any dependencies. If so, get them with apt-get. The make step will take awhile.

    cd ogre
    mkdir build
    cd build
    cmake ..
    make
    

  4. Install OGRE to /usr/local

    make install
      

  5. I had some issues where the install did not set the permissions correctly on some of the directories, so I had to fix that.

    sudo chmod 755 /usr/local/share/OGRE/
    sudo chmod 755 /usr/local/include/OGRE
    sudo chmod 755 /usr/local/lib/OGRE/
    sudo chmod 755 /usr/local/lib/OGRE/Samples
    

Setting up an eclipse project

  1. Create a new empty C++ project in Eclipse. Give it a name and hit the "Next" button.

  2. Click the "Advanced Settings..."

  3. Click the "C/C++ Build" drop-down on the left.

  4. Click "Settings"

  5. At the top of the "Tool Settings" tab, select "[All Configurations]" in :Configuration:". You may need to scroll up, to see it.

  6. In the "Tool Settings" tab, click "Includes" under "GCC C++ Compiler"

  7. Click the Add button icon (a document with a green plus sign on the right).

  8. You will need to add the directories where the include files are for OGRE, CEGUI and OIS. On our systems they are

    /usr/local/include/OGRE
    /usr/include/OIS
    

  9. Click "Libraries" under "GCC C++ Linker". In the section "Libraries (-l)" add the following names:

    OgreMain
    OIS
    OgreOverlay
    OgreRTShaderSystem
    

  10. On our systems the libraries are in locations known to the compiler. If they are somewhere else on yours add those paths in the "Library search path (-L)" area. For example: the file for OgreMain is libOgreMain.so. Find that file and add the path to it in this section.

  11. Click "Ok".

  12. Click "Finish".

  13. Create a src directory inside your project directory.

  14. Copy resources.cfg plugins.cfg files into the top level of your project.

  15. Copy the .cpp and .h files form http://cs.gettysburg.edu/~cpresser/cs391/software/linuxFiles to your project directory. You may need to edit the paths in the configuration files for your computer.

  16. In eclipse, right click on Tutorial1 and select "Refresh". You are now ready to edit your OGRE project.