Index: code/branches/cmake/src/CMakeLists.txt
===================================================================
--- code/branches/cmake/src/CMakeLists.txt	(revision 1124)
+++ code/branches/cmake/src/CMakeLists.txt	(revision 1127)
@@ -1,7 +1,6 @@
 INCLUDE_DIRECTORIES(.)
 INCLUDE_DIRECTORIES(orxonox)
-INCLUDE_DIRECTORIES(tolua)
+INCLUDE_DIRECTORIES(util/tolua)
 
-ADD_SUBDIRECTORY(tolua)
 ADD_SUBDIRECTORY(util)
 ADD_SUBDIRECTORY(core)
Index: code/branches/cmake/src/core/CMakeLists.txt
===================================================================
--- code/branches/cmake/src/core/CMakeLists.txt	(revision 1124)
+++ code/branches/cmake/src/core/CMakeLists.txt	(revision 1127)
@@ -26,4 +26,13 @@
   Tickable.cc
   Script.cc
+  tolua/tolua_bind.cc
+)
+
+GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
+ADD_CUSTOM_COMMAND(
+  OUTPUT tolua/tolua_bind.cc
+  COMMAND ${TOLUA_EXE} -n core -o core/tolua/tolua_bind.cc -H core/tolua/tolua_bind.h core/tolua/tolua.pkg
+  DEPENDS tolua
+  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src
 )
 
@@ -31,7 +40,7 @@
 
 TARGET_LINK_LIBRARIES(core
-  util
-  tolualib
   ${Lua_LIBRARIES}
   ${OIS_LIBRARIES}
+  ${OGRE_LIBRARIES}
+  util
 )
Index: code/branches/cmake/src/core/InputManager.cc
===================================================================
--- code/branches/cmake/src/core/InputManager.cc	(revision 1124)
+++ code/branches/cmake/src/core/InputManager.cc	(revision 1127)
@@ -93,7 +93,7 @@
       paramList.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
 
-#if defined OIS_LINUX_PLATFORM
-      paramList.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
-#endif
+//#if defined OIS_LINUX_PLATFORM
+//      paramList.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
+//#endif
 
       try
Index: code/branches/cmake/src/core/Script.cc
===================================================================
--- code/branches/cmake/src/core/Script.cc	(revision 1124)
+++ code/branches/cmake/src/core/Script.cc	(revision 1127)
@@ -39,5 +39,5 @@
 }
 
-#include "tolua/tolua++.h"
+#include "tolua++.h"
 #include "tolua/tolua_bind.h"
 
@@ -60,5 +60,5 @@
     luaopen_debug(luaState_);
 #endif
-    tolua_orxonox_open(luaState_);
+    tolua_core_open(luaState_);
     output_ = "";
   }
Index: code/branches/cmake/src/core/tolua/tolua.pkg
===================================================================
--- code/branches/cmake/src/core/tolua/tolua.pkg	(revision 1127)
+++ code/branches/cmake/src/core/tolua/tolua.pkg	(revision 1127)
@@ -0,0 +1,1 @@
+$cfile "core/Script_clean.h"
Index: code/branches/cmake/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/cmake/src/orxonox/CMakeLists.txt	(revision 1124)
+++ code/branches/cmake/src/orxonox/CMakeLists.txt	(revision 1127)
@@ -30,6 +30,15 @@
 #  objects/weapon/BulletManager.cc
 #  objects/weapon/WeaponStation.cc
+  tolua/tolua_bind.cc
 )
 
+GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
+ADD_CUSTOM_COMMAND(
+  OUTPUT tolua/tolua_bind.cc
+  COMMAND ${TOLUA_EXE} -n orxonox -o orxonox/tolua/tolua_bind.cc -H orxonox/tolua/tolua_bind.h orxonox/tolua/tolua.pkg
+  DEPENDS tolua
+  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src
+)
+	
 ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} )
 
Index: code/branches/cmake/src/util/CMakeLists.txt
===================================================================
--- code/branches/cmake/src/util/CMakeLists.txt	(revision 1124)
+++ code/branches/cmake/src/util/CMakeLists.txt	(revision 1127)
@@ -1,15 +1,24 @@
-AUX_SOURCE_DIRECTORY(tinyxml TINYXML_SRC_FILES)
-
 SET(UTIL_SRC_FILES
   ArgReader.cc
+  Clipboard.cc
+  ExprParser.cc
   Math.cc
-  String.cc
-  Clipboard.cc
-  SubString.cc
-  ExprParser.cc
   MultiTypePrimitive.cc
   MultiTypeString.cc
   MultiTypeMath.cc
-  ${TINYXML_SRC_FILES}
+  String.cc
+  SubString.cc
+
+  tinyxml/ticpp.cc
+  tinyxml/tinystr.cc
+  tinyxml/tinyxml.cc
+  tinyxml/tinyxmlerror.cc
+  tinyxml/tinyxmlparser.cc
+
+  tolua/tolua_event.c
+  tolua/tolua_is.c
+  tolua/tolua_map.c
+  tolua/tolua_push.c
+  tolua/tolua_to.c
 )
 
@@ -22,4 +31,7 @@
 TARGET_LINK_LIBRARIES(util
   ${OGRE_LIBRARIES}
+  ${Lua_LIBRARIES}
 ) 
 
+ADD_SUBDIRECTORY(tolua)
+
