Difference between revisions of "Building from source"

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Jump to: navigation, search
(Dependencies: CMake auto-detection)
(Building)
Line 35: Line 35:
 
The following instructions assume you have a ''cegui'' directory somewhere on your system so that all CEGUI related projects reside in it.
 
The following instructions assume you have a ''cegui'' directory somewhere on your system so that all CEGUI related projects reside in it.
 
  cegui              (root working directory)
 
  cegui              (root working directory)
  cegui/cegui-source (core CEGUI)
+
  cegui/cegui_mk2    (core CEGUI)
 
  cegui/CEED        (editor)
 
  cegui/CEED        (editor)
 
  cegui/...          (something else)
 
  cegui/...          (something else)
Line 82: Line 82:
 
{{Todo|Does the above ^ work on Windows and Mac?}}
 
{{Todo|Does the above ^ work on Windows and Mac?}}
 
{{Note|You can turn off individual CEGUI modules from building (even if you have the required libraries installed) by changing the default [[Building from source#Build Options|Build Options]].}}
 
{{Note|You can turn off individual CEGUI modules from building (even if you have the required libraries installed) by changing the default [[Building from source#Build Options|Build Options]].}}
 +
 +
===Directories===
 +
If you're following the directory structure outlined above, you should have something like:
 +
cegui                          (root working directory)
 +
cegui/cegui_mk2                (core CEGUI)
 +
Create the directory ''cegui/cegui_mk2/build'' and clone the ''cegui_mk2'' repository inside cegui/cegui_mk2 with the name ''source''. Example:
 +
[~/cegui]$ mkdir cegui_mk2/build
 +
[~/cegui]$ hg clone http://crayzedsgui.hg.sourceforge.net/hgroot/crayzedsgui/cegui_mk2 cegui_mk2/source
 +
The result should be:
 +
cegui/cegui_mk2                (core CEGUI)
 +
cegui/cegui_mk2/build          (will build here)
 +
cegui/cegui_mk2/source        (the mercurial repository copy)
  
 
===Build Options===
 
===Build Options===

Revision as of 15:15, 16 December 2011

Written for CEGUI 0.8


Works with versions 0.8.x (stable)

Works with latest CEGUI stable!

This article is a work in progress and thus incomplete


Obtaining the source

Note: If you'd rather use precompiled SDKs, please follow Downloads.

Stable Releases

Source code from the stable mercurial branches is released at various points in time and made available as source code packages. These packages can be found on the Downloads page.

Mercurial

The source code is kept in mercurial repositories at sourceforge.net. There are code repositories for the main CEGUI libraries as well as for other related items.

A mercurial client (GUI or CLI) is required to access the mercurial repositories and download code. The command necessary to obtain a copy of the code is 'clone':

hg clone SOURCE DESTINATION

where source is the URL of the repository to clone and destination is the local directory. To download a copy of CEGUI and place it in the cegui-source directory, you might use the following command:

hg clone http://crayzedsgui.hg.sourceforge.net/hgroot/crayzedsgui/cegui_mk2 cegui-source

Once you have this, the cloned repository is updated to the default (latest, unstable) code, so you most likely will want to switch to a stable branch instead, like this:

hg update -C v0-8
Warning: Be aware that the -C option here will discard any local file changes without additional warning

Repositories

The available repositories can be found here where you can also browse their code from your web browser. A couple of examples:

hg clone http://crayzedsgui.hg.sourceforge.net/hgroot/crayzedsgui/cegui_mk2 cegui-source
  • CEED unified editor - CEED
hg clone http://crayzedsgui.hg.sourceforge.net/hgroot/crayzedsgui/CEED
Note: The difference between the hg clone URLs and the web-interface URLs is hgroot vs hgweb

Building

CEGUI uses CMake as a build system. CMake is cross-platform and open source so it's available on many platforms. There are binaries available for Windows, Mac and Linux, although on Linux your distribution will most probably have a CMake package ready. Make sure you install it before continuing.

Note: CMake does not build the code directly, it generates native makefiles and workspaces that can be used in the compiler environment of your choice.

Thanks to CMake and CEGUI's modular design, configuring and building CEGUI is a breeze.

The following instructions assume you have a cegui directory somewhere on your system so that all CEGUI related projects reside in it.

cegui              (root working directory)
cegui/cegui_mk2    (core CEGUI)
cegui/CEED         (editor)
cegui/...          (something else)
Todo: Check directory structure so that CEED (which depends on CEGUI) works

CEGUI

This section will focus on building the core CEGUI libraries, which is all you need to use CEGUI in a project. Most people will also want CEED, the unified editor for CEGUI, but it is not required.

Dependencies

CEGUI can be built without any dependencies to outside libraries. However, typical configurations require FreeType, a rendering module, an XML parser, and an image codec. CEGUI already provides support for several external libraries thanks to its modular design:

Feature Supported Libraries
Bi-Directional Language MiniBIDI, FriBIDI
Font FreeType
Image Codec DevIL, FreeImage, OGRE, SILLY
Memory Management OGRE, nedmalloc
Regular Expression PCRE
Rendering Direct3D, Irrlicht, OGRE, OpenGL
Resource Providers Default (standard cross-platform file-access), minizip, OGRE
Scripting Lua, Python
XML Expat, LibXML2, RapidXml, TinyXML, Xerces-C++

CMake will automatically detect which external libraries exist on your system and will build CEGUI accordingly so make sure you install any external libraries you want to use before proceeding.

Todo: Does the above ^ work on Windows and Mac?
Note: You can turn off individual CEGUI modules from building (even if you have the required libraries installed) by changing the default Build Options.

Directories

If you're following the directory structure outlined above, you should have something like:

cegui                          (root working directory)
cegui/cegui_mk2                (core CEGUI)

Create the directory cegui/cegui_mk2/build and clone the cegui_mk2 repository inside cegui/cegui_mk2 with the name source. Example:

[~/cegui]$ mkdir cegui_mk2/build
[~/cegui]$ hg clone http://crayzedsgui.hg.sourceforge.net/hgroot/crayzedsgui/cegui_mk2 cegui_mk2/source

The result should be:

cegui/cegui_mk2                (core CEGUI)
cegui/cegui_mk2/build          (will build here)
cegui/cegui_mk2/source         (the mercurial repository copy)

Build Options

Todo: CMake options

Building

Todo: Build general

Windows

Todo: Windows notes

Mac

Todo: Mac notes

Linux

Todo: Linux notes
Distro1
Todo: Distro specific notes

Documentation

Note: The documentation for stable releases can be found online here
Todo: Doxygen howto

CEED

Todo: Short description
Todo: Note and link to prebuilt binary downloads

Dependencies

Todo: Dependencies general

Windows

Todo: Windows deps & notes

Mac

Todo: Mac deps & notes

Linux

Todo: Linux deps & notes
Distro1
Todo: Distro specific deps & notes

Running

Todo: Running

Troubleshooting

Todo: Problems? -> Forum!

Related Articles