Index: code/branches/buildsystem/cmake/UseTolua.cmake
===================================================================
--- code/branches/buildsystem/cmake/UseTolua.cmake	(revision 2238)
+++ code/branches/buildsystem/cmake/UseTolua.cmake	(revision 2239)
@@ -19,11 +19,4 @@
 GET_TARGET_PROPERTY(TOLUA_EXECUTABLE "${_tolua_executable_name}" LOCATION)
 
-MACRO(INCLUDE_DIRECTORIES_QUOTES)
-  FOREACH(_tolua_quote_dir ${ARGN})
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -iquote ${_tolua_quote_dir}")
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -iquote ${_tolua_quote_dir}")
-  ENDFOREACH(_tolua_quote_dir)
-ENDMACRO(INCLUDE_DIRECTORIES_QUOTES)
-
 MACRO(TOLUA _tolua_package _tolua_srcfiles_varname)
   # TODO: cleaner arguments handling
@@ -32,6 +25,6 @@
 
   SET(_tolua_pkgfile "${CMAKE_CURRENT_BINARY_DIR}/tolua.pkg")
-  SET(_tolua_cxxfile "${CMAKE_CURRENT_BINARY_DIR}/tolua_bind.cc")
-  SET(_tolua_hfile   "${CMAKE_CURRENT_BINARY_DIR}/tolua_bind.h")
+  SET(_tolua_cxxfile "${CMAKE_CURRENT_BINARY_DIR}/ToluaBind${_tolua_package}.cc")
+  SET(_tolua_hfile   "${CMAKE_CURRENT_BINARY_DIR}/ToluaBind${_tolua_package}.h")
   SET(${_tolua_srcfiles_varname} ${${_tolua_srcfiles_varname}} "${_tolua_cxxfile}")
 
Index: code/branches/buildsystem/src/CMakeLists.txt
===================================================================
--- code/branches/buildsystem/src/CMakeLists.txt	(revision 2238)
+++ code/branches/buildsystem/src/CMakeLists.txt	(revision 2239)
@@ -21,4 +21,6 @@
   orxonox
   tolua
+  # Required for tolua bind files that are in the build folder
+  ${CMAKE_CURRENT_BINARY_DIR}
 )
 
Index: code/branches/buildsystem/src/core/CMakeLists.txt
===================================================================
--- code/branches/buildsystem/src/core/CMakeLists.txt	(revision 2238)
+++ code/branches/buildsystem/src/core/CMakeLists.txt	(revision 2239)
@@ -54,5 +54,4 @@
 INCLUDE(UseTolua)
 TOLUA(Core CORE_SRC_FILES INPUTFILES Script.h CommandExecutor.h)
-INCLUDE_DIRECTORIES_QUOTES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
 
 ADD_LIBRARY(core SHARED ${CORE_SRC_FILES})
Index: code/branches/buildsystem/src/core/Script.cc
===================================================================
--- code/branches/buildsystem/src/core/Script.cc	(revision 2238)
+++ code/branches/buildsystem/src/core/Script.cc	(revision 2239)
@@ -40,5 +40,5 @@
 
 #include "tolua++.h"
-#include "tolua_bind.h"
+#include "core/ToluaBindCore.h"
 
 namespace orxonox
Index: code/branches/buildsystem/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/buildsystem/src/orxonox/CMakeLists.txt	(revision 2238)
+++ code/branches/buildsystem/src/orxonox/CMakeLists.txt	(revision 2239)
@@ -66,6 +66,4 @@
 INCLUDE(UseTolua)
 TOLUA(Orxonox ORXONOX_SRC_FILES INPUTFILES gui/GUIManager.h)
-INCLUDE_DIRECTORIES_QUOTES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
-INCLUDE_DIRECTORIES_QUOTES("${CMAKE_SOURCE_DIR}/src/core" "${CMAKE_BINARY_DIR}/src/core")
 
 ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} )
Index: code/branches/buildsystem/src/orxonox/gui/GUIManager.cc
===================================================================
--- code/branches/buildsystem/src/orxonox/gui/GUIManager.cc	(revision 2238)
+++ code/branches/buildsystem/src/orxonox/gui/GUIManager.cc	(revision 2239)
@@ -43,8 +43,8 @@
 #include "core/input/InputManager.h"
 #include "core/input/SimpleInputState.h"
-#include "../core/tolua_bind.h"
 #include "core/ConsoleCommand.h"
 #include "core/Core.h"
-#include "tolua_bind.h"
+#include "core/ToluaBindCore.h"
+#include "orxonox/ToluaBindOrxonox.h"
 #include "GraphicsEngine.h"
 #include "OgreCEGUIRenderer.h"
Index: code/branches/buildsystem/src/tolua/lua/package.lua
===================================================================
--- code/branches/buildsystem/src/tolua/lua/package.lua	(revision 2238)
+++ code/branches/buildsystem/src/tolua/lua/package.lua	(revision 2239)
@@ -128,5 +128,6 @@
     if flags.H then
         local header = gsub(flags.H, '^.-([%w_]*%.[%w_]*)$', '%1')
-        output('#include "'..header..'"\n')
+        local package_lower = string.lower(self.name)
+        output('#include "'..package_lower..'/'..header..'"\n')
     end
 
@@ -203,5 +204,6 @@
 
     if flags.H then
-        output('#include "'..self.name..'Prereqs.h"\n')
+        local package_lower = string.lower(self.name)
+        output('#include "'..package_lower..'/'..self.name..'Prereqs.h"\n')
         output('/* Exported function */')
         output('_'..self.name..'Export')
@@ -220,5 +222,5 @@
 -- *** Thanks to Ariel Manzur for fixing bugs in nested directives ***
 function extract_code(fn,s)
-    local code = '\n$#include "'..fn..'"\n'
+    local code = '\n$#include "'..string.lower(flags.n)..'/'..fn..'"\n'
     s= "\n" .. s .. "\n" -- add blank lines as sentinels
 
