Build from source for Linux

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Jump to: navigation, search

Written for CEGUI 0.5

Works with versions 0.5.x (obsolete)

I happened to notice that this article needed to be written and I was about to install CEGUI from source right now, so I thought I'd document the steps I used, in hopes that they may be useful to somebody.

I'm on ubuntu 6.06 (Dapper)

You need:
- A C++ compiler (g++ in my case)
- Linux Makefile

First you need to download the latest source tarball. I think it's a good idea to keep all the libraries you install from source in a directory, so you can re-compile later with different options if you wish. /home/user/Installs in my case. Move the downloaded tar to your "installs directory" and extract it with:
tar xzf CEGUI-0.5.0b.tar.gz

Enter the CEGUI file:
cd CEGUI-0.5.0/
and type
./configure --help
Scroll up a bit and take a look at the available compile options. Pay special attention to the optional ones, so you can make sure that you get all the features you need. then type
If everything worked you should get a summary of the build you are going to make. If you don't get the summary, it's probably because you don't have the libraries CEGUI needs to compile. Make sure you have the _DEVELOPMENT_ libraries installed. If you are not happy with the summary, run configure again and use the options from the help section to tweak it.
Here is what I got.

* Crazy Eddie's GUI System - Configuration Results Summary
* Library Release Version:                              0.5.0
* Code options:
*         Building CEGUI in debug mode:                 no
* Renderer Modules:
*         Building OpenGL Renderer:                     yes
*         Building Irrlict Renderer:                    no
* Image Loading Codec Modules (currently for OpenGL Renderer only):
*         Building Corona Image Codec:                  no
*         Building DevIL Image Codec:                   no
*         Building FreeImage Image Codec:               no
*         Building SILLY Image Codec:                   no
*         Building TGA Image Codec:                     yes
*         Default Image Codec will be:                  TGAImageCodec
* XML Parser Modules:
*         Building TinyXMLParser:                       yes
*         Building ExpatParser:                         no
*         Building LibXMLParser:                        no
*         Building XercesParser:                        no
*         Default XML Parser is:                        TinyXMLParser
* Scripting:
*         Building Lua scripting module:                no
*         Building tolua++cegui generator:              no
* Samples Framework:
*         Building Samples:                             yes
*         GTK2 based dialog for renderer selection:     no
*         OpenGL Renderer available in samples:         yes
*         Irrlict Renderer available in samples:        no
*         Ogre3D Renderer available in samples:         no

the next part is easy, just type 'make' then 'make install'.
In practice you'll need root privileges to install the files, so with ubuntu:
sudo make install
or in gentoo for example:
make install
Hope this helps.

Note: If you're in Gentoo or Saboyan, configure might incorrectly detect your C++ preprocessor as "gcc -E", which will cause Irrlicht to fail. If you need Irrlicht, try: $ CC="g++" ./configure Enjoy!

Written for CEGUI 0.8

Works with versions 0.8.x (stable)

Works with latest CEGUI stable!

To compile with FreeType support, you may need to follow the instructions here first to fix FindFreetype.cmake: [1]

It is always recommended to install development libraries locally, so the next cmake command reflects that, but you are free to remove the -D flags if you want a global install. Then just execute the following commands from cegui-0.8.3/:

mkdir compile
mkdir build
cd compile
cmake -D CMAKE_INSTALL_PREFIX=<local install directory>/cegui-0.8.3/build -D OGRE_HOME=<ogre directory>/ogre1.9/ogre/build ..
make install