Index: code/branches/kicklib/cmake/tools/FindCEGUI.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/FindCEGUI.cmake	(revision 7959)
+++ code/branches/kicklib/cmake/tools/FindCEGUI.cmake	(revision 7960)
@@ -26,13 +26,19 @@
 #                 > www.orxonox.net <
 
+INCLUDE(CompareVersionStrings)
 INCLUDE(DetermineVersion)
 INCLUDE(FindPackageHandleAdvancedArgs)
 INCLUDE(HandleLibraryTypes)
 
-# Find CEGUI library
+# Find headers
 FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
   PATHS $ENV{CEGUIDIR}
   PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers
 )
+
+# Inspect CEGUIVersion.h for the version number
+DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
+
+# Find CEGUI library
 FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED
   NAMES CEGUIBase CEGUI
@@ -72,6 +78,22 @@
 )
 
-# Inspect CEGUIVersion.h for the version number
-DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
+# Newer versions of CEGUI have the renderer for OGRE shipped with them
+COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_compare TRUE)
+IF(_version_compare GREATER -1)
+  # Find CEGUI OGRE Renderer libraries
+  FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
+    NAMES CEGUIOgreRenderer
+    PATHS $ENV{CEGUIDIR}
+    PATH_SUFFIXES lib bin
+  )
+  FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_DEBUG
+    NAMES CEGUIOgreRendererd CEGUIOgreRenderer_d
+    PATHS $ENV{CEGUIDIR}
+    PATH_SUFFIXES lib bin
+  )
+  SET(CEGUI_OGRE_RENDERER_LIBRARY_NAME CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED)
+ELSE()
+  SET(CEGUI_OGRE_RENDERER_BUILD_REQUIRED TRUE)
+ENDIF()
 
 # Handle the REQUIRED argument and set CEGUI_FOUND
@@ -82,4 +104,5 @@
   CEGUILUA_LIBRARY_OPTIMIZED
   CEGUI_TOLUA_LIBRARY_OPTIMIZED
+  ${CEGUI_OGRE_RENDERER_LIBRARY_NAME}
 )
 
@@ -88,4 +111,7 @@
 HANDLE_LIBRARY_TYPES(CEGUILUA)
 HANDLE_LIBRARY_TYPES(CEGUI_TOLUA)
+IF(NOT CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
+  HANDLE_LIBRARY_TYPES(CEGUI_OGRE_RENDERER)
+ENDIF()
 
 MARK_AS_ADVANCED(
@@ -97,3 +123,5 @@
   CEGUI_TOLUA_LIBRARY_OPTIMIZED
   CEGUI_TOLUA_LIBRARY_DEBUG
+  CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
+  CEGUI_OGRE_RENDERER_LIBRARY_DEBUG
 )
Index: code/branches/kicklib/src/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/CMakeLists.txt	(revision 7959)
+++ code/branches/kicklib/src/CMakeLists.txt	(revision 7960)
@@ -99,4 +99,10 @@
 ENDIF()
 
+############## CEGUI OGRE Renderer ##############
+
+IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
+  SET(CEGUI_OGRE_RENDERER_LIBRARY ogreceguirenderer_orxonox)
+ENDIF()
+
 ################### Tolua Bind ##################
 
Index: code/branches/kicklib/src/external/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/external/CMakeLists.txt	(revision 7959)
+++ code/branches/kicklib/src/external/CMakeLists.txt	(revision 7960)
@@ -25,5 +25,7 @@
 ADD_SUBDIRECTORY(enet)
 ADD_SUBDIRECTORY(loki)
-ADD_SUBDIRECTORY(ogreceguirenderer)
+IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
+  ADD_SUBDIRECTORY(ogreceguirenderer)
+ENDIF()
 ADD_SUBDIRECTORY(ois)
 ADD_SUBDIRECTORY(tinyxml)
Index: code/branches/kicklib/src/libraries/core/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/libraries/core/CMakeLists.txt	(revision 7959)
+++ code/branches/kicklib/src/libraries/core/CMakeLists.txt	(revision 7960)
@@ -93,7 +93,7 @@
     ${CEGUILUA_LIBRARY}
     ${CEGUI_TOLUA_LIBRARY}
+    ${CEGUI_OGRE_RENDERER_LIBRARY}
     ${LUA5.1_LIBRARY}
     cpptcl_orxonox
-    ogreceguirenderer_orxonox
     ois_orxonox
     tinyxml_orxonox
Index: code/branches/kicklib/src/libraries/core/CorePrereqs.h
===================================================================
--- code/branches/kicklib/src/libraries/core/CorePrereqs.h	(revision 7959)
+++ code/branches/kicklib/src/libraries/core/CorePrereqs.h	(revision 7960)
@@ -38,4 +38,5 @@
 #include "OrxonoxConfig.h"
 #include <boost/version.hpp>
+#include <CEGUIVersion.h>
 
 //-----------------------------------------------------------------------
@@ -305,7 +306,13 @@
     class LuaScriptModule;
 
+#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
     class OgreCEGUIRenderer;
     class OgreCEGUIResourceProvider;
     class OgreCEGUITexture;
+#else
+    class OgreRenderer;
+    class OgreResourceProvider;
+    class OgreImageCodec;
+#endif
 }
 
Index: code/branches/kicklib/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/GUIManager.cc	(revision 7959)
+++ code/branches/kicklib/src/libraries/core/GUIManager.cc	(revision 7960)
@@ -32,4 +32,6 @@
 #include <memory>
 #include <boost/bind.hpp>
+#include <OgreRenderQueue.h>
+#include <OgreRenderWindow.h>
 
 #include <CEGUIDefaultLogger.h>
@@ -44,6 +46,13 @@
 #include <elements/CEGUIListboxItem.h>
 
-#include <CEGUILua.h>
-#include <ogreceguirenderer/OgreCEGUIRenderer.h>
+#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
+#  include <CEGUILua.h>
+#  include <ogreceguirenderer/OgreCEGUIRenderer.h>
+#else
+#  include <ScriptingModules/LuaScriptModule/CEGUILua.h>
+#  include <RendererModules/Ogre/CEGUIOgreImageCodec.h>
+#  include <RendererModules/Ogre/CEGUIOgreRenderer.h>
+#  include <RendererModules/Ogre/CEGUIOgreResourceProvider.h>
+#endif
 
 #include "util/Clock.h"
@@ -118,4 +127,7 @@
         , guiSystem_(NULL)
         , resourceProvider_(NULL)
+#if CEGUI_VERSION_MAJOR >= 1 || CEGUI_VERSION_MINOR >= 7
+        , imageCodec_(NULL)
+#endif
         , camera_(NULL)
     {
@@ -128,6 +140,12 @@
 
         // Note: No SceneManager specified yet
+#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
         guiRenderer_ = new OgreCEGUIRenderer(GraphicsManager::getInstance().getRenderWindow(), Ogre::RENDER_QUEUE_OVERLAY, false, 3000);
         resourceProvider_ = guiRenderer_->createResourceProvider();
+#else
+        guiRenderer_ = &OgreRenderer::create(*GraphicsManager::getInstance().getRenderWindow());
+        resourceProvider_ = &OgreRenderer::createOgreResourceProvider();
+        imageCodec_ = &OgreRenderer::createOgreImageCodec();
+#endif
         resourceProvider_->setDefaultResourceGroup("General");
 
@@ -137,5 +155,9 @@
         // This is necessary to ensure that input events also use the right resource info when triggering lua functions
         luaState_->setDefaultResourceInfo(this->rootFileInfo_);
+#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
         scriptModule_ = new LuaScriptModule(luaState_->getInternalLuaState());
+#else
+        scriptModule_ = &LuaScriptModule::create(luaState_->getInternalLuaState());
+#endif
         scriptModule_->setDefaultPCallErrorHandler(LuaState::ERROR_HANDLER_NAME);
 
@@ -149,5 +171,9 @@
 
         // Create the CEGUI system singleton
+#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
         guiSystem_ = new System(guiRenderer_, resourceProvider_, 0, scriptModule_);
+#else
+        guiSystem_ = &System::create(*guiRenderer_, resourceProvider_, 0, imageCodec_, scriptModule_);
+#endif
 
         // Align CEGUI mouse with OIS mouse
@@ -178,7 +204,15 @@
         using namespace CEGUI;
 
+#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
         delete guiSystem_;
         delete guiRenderer_;
         delete scriptModule_;
+#else
+        System::destroy();
+        OgreRenderer::destroyOgreResourceProvider(*resourceProvider_);
+        OgreRenderer::destroyOgreImageCodec(*imageCodec_);
+        OgreRenderer::destroy(*guiRenderer_);
+        LuaScriptModule::destroy(*scriptModule_);
+#endif
         delete luaState_;
     }
@@ -223,8 +257,10 @@
     {
         this->camera_ = camera;
+#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
         if (camera == NULL)
             this->guiRenderer_->setTargetSceneManager(0);
         else
             this->guiRenderer_->setTargetSceneManager(camera->getSceneManager());
+#endif
     }
 
@@ -512,5 +548,9 @@
     void GUIManager::windowResized(unsigned int newWidth, unsigned int newHeight)
     {
+#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
         this->guiRenderer_->setDisplaySize(CEGUI::Size(newWidth, newHeight));
+#else
+        this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight));
+#endif
     }
 
Index: code/branches/kicklib/src/libraries/core/GUIManager.h
===================================================================
--- code/branches/kicklib/src/libraries/core/GUIManager.h	(revision 7959)
+++ code/branches/kicklib/src/libraries/core/GUIManager.h	(revision 7960)
@@ -42,5 +42,5 @@
 #include <string>
 #include <CEGUIForwardRefs.h>
-#include <boost/scoped_ptr.hpp>
+#include <CEGUIVersion.h>
 #include <boost/shared_ptr.hpp>
 #include <loki/ScopeGuard.h>
@@ -147,6 +147,12 @@
         Loki::ObjScopeGuardImpl0<GUIManager, void (GUIManager::*)()> destroyer_;
 
+#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
         CEGUI::OgreCEGUIRenderer*            guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
         CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
+#else
+        CEGUI::OgreRenderer*                 guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
+        CEGUI::OgreResourceProvider*         resourceProvider_; //!< CEGUI's resource provider
+        CEGUI::OgreImageCodec*               imageCodec_;
+#endif
         LuaState*                            luaState_;         //!< LuaState, access point to the Lua engine
         CEGUI::LuaScriptModule*              scriptModule_;     //!< CEGUI's script module to use Lua
Index: code/branches/kicklib/src/libraries/util/Exception.cc
===================================================================
--- code/branches/kicklib/src/libraries/util/Exception.cc	(revision 7959)
+++ code/branches/kicklib/src/libraries/util/Exception.cc	(revision 7960)
@@ -95,12 +95,12 @@
             throw;
         }
-        catch (const std::exception& ex)
-        {
-            return ex.what();
-        }
         catch (const CEGUI::Exception& ex)
         {
             return GeneralException(ex.getMessage().c_str(), ex.getLine(),
                 ex.getFileName().c_str(), ex.getName().c_str()).getDescription();
+        }
+        catch (const std::exception& ex)
+        {
+            return ex.what();
         }
         catch (...)
