Index: code/branches/buildsystem2/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/CMakeLists.txt	(revision 2582)
+++ code/branches/buildsystem2/CMakeLists.txt	(revision 2583)
@@ -14,7 +14,7 @@
 
 # Set binary output directories
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
-SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/bin)
-MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
+SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 
 # Set Debug build to default when not having multi-config generator like msvc
@@ -25,5 +25,5 @@
 ############## Platform Config ##################
 
-# Configre platform specific options
+# Configure platform specific options
 INCLUDE(ConfigPlatforms)
 
@@ -40,12 +40,12 @@
 ############### Library finding #################
 
-INCLUDE(FindPackageHandleStandardArgs)
-INCLUDE(HandleLibraryTypes)
+# Performs the search and sets the variables
 
-# Performs the search and sets the variables
+# Expand the next statement if newer boost versions than 1.36.1 are released
+SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 CACHE STRING "")
+FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem)
 FIND_PACKAGE(OGRE REQUIRED)
 FIND_PACKAGE(CEGUI REQUIRED)
 FIND_PACKAGE(ENet REQUIRED)
-FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem)
 FIND_PACKAGE(OpenAL REQUIRED)
 FIND_PACKAGE(ALUT REQUIRED)
@@ -57,10 +57,10 @@
 FIND_PACKAGE(Lua50 QUIET)
 IF(NOT LUA50_FOUND)
-    # Remove variables set by Lua50 and try with Lua51
-    SET(LUA_INCLUDE_DIR)
-    SET(LUA_LIBRARY_lua)
-    SET(LUA_LIBRARY_lualib)
-    SET(LUA_LIBRARIES)
-    FIND_PACKAGE(Lua51 REQUIRED)
+  # Remove variables set by Lua50 and try with Lua51
+  SET(LUA_INCLUDE_DIR)
+  SET(LUA_LIBRARY_lua)
+  SET(LUA_LIBRARY_lualib)
+  SET(LUA_LIBRARIES)
+  FIND_PACKAGE(Lua51 REQUIRED)
 ENDIF(NOT LUA50_FOUND)
 # Determine Lua version (Lua50 may also find Lua51)
@@ -71,13 +71,13 @@
 FIND_PACKAGE(TCL QUIET)
 IF(NOT TCL_FOUND)
-    MESSAGE(FATAL_ERROR "Tcl was not found.")
+  MESSAGE(FATAL_ERROR "Tcl was not found.")
 ENDIF(NOT TCL_FOUND)
 
 # Hide variables created by CMake FindXX scripts
 MARK_AS_ADVANCED(
-    LUA_LIBRARY_lua
-    LUA_LIBRARY_lualib
-    OPENAL_INCLUDE_DIR
-    OPENAL_LIBRARY
+  LUA_LIBRARY_lua
+  LUA_LIBRARY_lualib
+  OPENAL_INCLUDE_DIR
+  OPENAL_LIBRARY
 )
 
Index: code/branches/buildsystem2/bin/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/bin/CMakeLists.txt	(revision 2582)
+++ code/branches/buildsystem2/bin/CMakeLists.txt	(revision 2583)
@@ -8,7 +8,7 @@
 )
 
-IF(IS_TARDIS)
+IF(TARDIS)
   # OGRE can't find fonts to display config screen on Tardis,
-  # so providing default config file here.
+  # so providing default config file here (bug).
   SET(CONFIG_FILES ${CONFIG_FILES}
     linux/run-script
@@ -22,5 +22,5 @@
     linux/orxonox.ini
   )
-ENDIF(IS_TARDIS)
+ENDIF(TARDIS)
 
 IF(MINGW)
Index: code/branches/buildsystem2/cmake/ConfigMSVC.cmake
===================================================================
--- code/branches/buildsystem2/cmake/ConfigMSVC.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/ConfigMSVC.cmake	(revision 2583)
@@ -42,9 +42,9 @@
     MESSAGE(FATAL_ERROR "Could not find dependency directory for the Visual Studio libraries")
   ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)
-  MARK_AS_ADVANCED(MSVC_LIBRARY_DIR)
 
   # Set variables for the include directories and the libraries
-  SET(BOOST_INCLUDEDIR       ${MSVC_LIBRARY_DIR}/boost-1.35.0/include)
-  SET(BOOST_LIBRARYDIR       ${MSVC_LIBRARY_DIR}/boost-1.35.0/lib)
+  # Note: When setting ENV${} variables, make sure to use quotes when
+  #       having multiple directories.
+  SET(ENV{BOOST_ROOT}        ${MSVC_LIBRARY_DIR}/boost-1.35.0)
   SET(ENV{CEGUIDIR}          ${MSVC_LIBRARY_DIR}/cegui-0.6.1)
   SET(ENV{ENETDIR}           ${MSVC_LIBRARY_DIR}/enet-1.2)
@@ -62,6 +62,6 @@
   SET(TCL_TCLSH_FOUND TRUE)
   SET(ZLIB_INCLUDE_DIR       ${MSVC_LIBRARY_DIR}/zlib-1.2.3/include)
-  SET(ZLIB_LIBRARY OPTIMIZED ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib.lib
-                   DEBUG     ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib_d.lib)
+  SET(ZLIB_LIBRARY optimized ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib.lib
+                   debug     ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib_d.lib)
   SET(ZLIB_FOUND TRUE)
 
@@ -85,3 +85,8 @@
   SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
   SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
+
+  ######################### Misc ##########################
+
+  # Set tolua working directory because lua.dll is not where tolua is
+  SET(TOLUA_PARSER_WORKING_DIRECTORY ${MSVC_LIBRARY_DIR}/bin)
 ENDIF (MSVC)
Index: code/branches/buildsystem2/cmake/ConfigMinGW.cmake
===================================================================
--- code/branches/buildsystem2/cmake/ConfigMinGW.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/ConfigMinGW.cmake	(revision 2583)
@@ -21,5 +21,5 @@
  #
  #   Author:
- #      ...
+ #      Reto Grieder
  #   Co-authors:
  #      ...
@@ -42,27 +42,23 @@
     MESSAGE(FATAL_ERROR "Could not find dependency directory for the MinGW libraries")
   ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/libs)
-  MARK_AS_ADVANCED(MING_LIBRARY_DIR)
 
-  #SET(Boost_ADDITIONAL_VERSIONS "1.36")
-  SET(BOOST_INCLUDEDIR ${MINGW_LIBRARY_DIR}/boost_1_34_1)
-  SET(BOOST_LIBRARYDIR ${MINGW_LIBRARY_DIR}/boost_1_34_1/stage/lib)
-  SET(ENV{CEGUIDIR}    ${MINGW_LIBRARY_DIR}/cegui-0.6.1)
-  SET(ENV{ENETDIR}     ${MINGW_LIBRARY_DIR}/enet-1.1)
-  SET(ENV{ALUTDIR}     ${MINGW_LIBRARY_DIR}/freealut-1.1.0)
-  SET(ENV{OGGSDIR}     ${MINGW_LIBRARY_DIR}/libogg-1.1.3
-                       ${MINGW_LIBRARY_DIR}/libogg-1.1.3/src/.libs)
-  SET(ENV{VORBISDIR}   ${MINGW_LIBRARY_DIR}/libogg-1.1.3
-                       ${MINGW_LIBRARY_DIR}/libvorbis-1.2.0/src/.libs)
-  SET(ENV{OPENALDIR}   ${MINGW_LIBRARY_DIR}/openal-0.0.8/common
-                       ${MINGW_LIBRARY_DIR}/openal-0.0.8/src/.libs)
-  SET(ENV{LUA_DIR}     ${MINGW_LIBRARY_DIR}/lua-5.1.3)
-  SET(ENV{OGRE_HOME}   ${MINGW_LIBRARY_DIR}/ogre/OgreMain
-                       ${MINGW_LIBRARY_DIR}/ogre/Samples/Common/bin/Release)
-  SET(TCL_INCLUDE_PATH ${MINGW_LIBRARY_DIR}/tcl8.5.2/generic)
-  SET(TCL_LIBRARY_PATH ${MINGW_LIBRARY_DIR}/tcl8.5.2/win/tcl85.dll)
-  SET(ZLIB_INCLUDE_DIR ${MINGW_LIBRARY_DIR}/zlib/include)
-  SET(ZLIB_LIBRARY     ${MINGW_LIBRARY_DIR}/zlib/libzlib.a)
+
+  # Note: When setting ENV${} variables, make sure to use quotes when
+  #       having multiple directories.
+  SET(ENV{BOOST_ROOT}    "${MINGW_LIBRARY_DIR}/boost_1_34_1")
+  SET(ENV{CEGUIDIR}      "${MINGW_LIBRARY_DIR}/cegui-0.6.1")
+  SET(ENV{ENETDIR}       "${MINGW_LIBRARY_DIR}/enet-1.1")
+  SET(ENV{ALUTDIR}       "${MINGW_LIBRARY_DIR}/freealut-1.1.0")
+  SET(ENV{OGGDIR}        "${MINGW_LIBRARY_DIR}/libogg-1.1.3;${MINGW_LIBRARY_DIR}/libogg-1.1.3/src/.libs")
+  SET(ENV{VORBISDIR}     "${MINGW_LIBRARY_DIR}/libogg-1.1.3;${MINGW_LIBRARY_DIR}/libvorbis-1.2.0/src/.libs")
+  SET(ENV{OPENALDIR}     "${MINGW_LIBRARY_DIR}/openal-0.0.8/common;${MINGW_LIBRARY_DIR}/openal-0.0.8/src/.libs")
+  SET(ENV{LUA_DIR}       "${MINGW_LIBRARY_DIR}/lua-5.1.3")
+  SET(ENV{OGRE_HOME}     "${MINGW_LIBRARY_DIR}/ogre/OgreMain;${MINGW_LIBRARY_DIR}/ogre/Samples/Common")
+  SET(TCL_INCLUDE_PATH   "${MINGW_LIBRARY_DIR}/tcl8.5.2/generic")
+  SET(TCL_LIBRARY_PATH   "${MINGW_LIBRARY_DIR}/tcl8.5.2/win/tcl85.dll")
+  SET(ZLIB_INCLUDE_DIR   "${MINGW_LIBRARY_DIR}/zlib/include")
+  SET(ZLIB_LIBRARY       "${MINGW_LIBRARY_DIR}/zlib/libzlib.a")
   IF (NOT ENV{DXSDK_DIR})
-    SET(ENV{DXSDK_DIR} ${MINGW_LIBRARY_DIR}/DXSDK)
+    SET(ENV{DXSDK_DIR} "${MINGW_LIBRARY_DIR}/DXSDK")
   ENDIF (NOT ENV{DXSDK_DIR})
 
@@ -70,3 +66,7 @@
   SET(CMAKE_C_FLAGS   "$ENV{CFLAGS}   ${ORXONOX_WARNING_FLAGS)")
   SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${ORXONOX_WARNING_FLAGS)")
+
+  # Also set the tolua working directory because lua.dll is not where tolua ia
+  SET(TOLUA_PARSER_WORKING_DIRECTORY "${MNGW_LIBRARY_DIR}/lua-5.1.3/lib")
+
 ENDIF (MINGW)
Index: code/branches/buildsystem2/cmake/ConfigPlatforms.cmake
===================================================================
--- code/branches/buildsystem2/cmake/ConfigPlatforms.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/ConfigPlatforms.cmake	(revision 2583)
@@ -32,7 +32,10 @@
 ############ Misc Default Options ###############
 
+# When searching for debug libraries, this is appended to the libarary name
 SET(LIBRARY_DEBUG_POSTFIX "_d")
+# Working directory for the tolua parser. Adjust for windows because lua.dll has to be there!
+SET(TOLUA_PARSER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
 
-OPTION(EXTRA_WARNINGS "Enable some extra warnings (pollutes the output heavily)")
+OPTION(EXTRA_WARNINGS "Enable some extra warnings (heavily pollutes the output)")
 IF(EXTRA_WARNINGS)
   SET(ORXONOX_WARNING_FLAGS "-Wextra --Wno-unsued-parameter")
@@ -40,9 +43,4 @@
   SET(ORXONOX_WARNING_FLAGS "-Wall")
 ENDIF(EXTRA_WARNINGS)
-
-MARK_AS_ADVANCED(
-  LIBRARY_DEBUG_POSTFIX
-  ORXONOX_WARNINGS_FLAGS
-)
 
 ###### Default Compiler/Linker Options ##########
Index: code/branches/buildsystem2/cmake/ConfigTardis.cmake
===================================================================
--- code/branches/buildsystem2/cmake/ConfigTardis.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/ConfigTardis.cmake	(revision 2583)
@@ -6,16 +6,16 @@
 IF (UNIX)
   FILE(STRINGS /etc/hostname HOSTNAME LIMIT_COUNT 1)
-  IF ("${HOSTNAME}" MATCHES "^tardis-[a-z][0-9][0-9]$")
-    SET (IS_TARDIS ON)
-  ENDIF ("${HOSTNAME}" MATCHES "^tardis-[a-z][0-9][0-9]$")
+  IF (${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$")
+    SET (TARDIS ON)
+  ENDIF (${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$")
 ENDIF (UNIX)
-MARK_AS_ADVANCED(HOSTNAME IS_TARDIS)
 
-IF (IS_TARDIS)
+IF (TARDIS)
   MESSAGE(STATUS "Running on D-ITET isg.ee Tardis Computer. Using customized paths.")
   SET(CMAKE_C_COMPILER "gcc-4.1")
   SET(CMAKE_CXX_COMPILER "g++-4.1")
 
-  #SET(Boost_ADDITIONAL_VERSIONS "1.36")
+  # Note: When setting ENV${} variables, make sure to use quotes when
+  #       having multiple directories.
   SET(BOOST_INCLUDEDIR "/usr/pack/boost-1.34.1-sd/include")
   SET(BOOST_LIBRARYDIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/lib")
@@ -29,3 +29,3 @@
   SET(ENV{OPENALDIR}   "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
   #SET(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")
-ENDIF (IS_TARDIS)
+ENDIF (TARDIS)
Index: code/branches/buildsystem2/cmake/DetermineVersion.cmake
===================================================================
--- code/branches/buildsystem2/cmake/DetermineVersion.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/DetermineVersion.cmake	(revision 2583)
@@ -17,5 +17,5 @@
 #    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
-MACRO(DetermineVersion _name _file)
+MACRO(DETERMINE_VERSION _name _file)
   FILE(READ ${_file} _file_content)
   IF(_file_content)
@@ -42,3 +42,3 @@
     MARK_AS_ADVANCED(${_name}_VERSION)
   ENDIF(_file_content)
-ENDMACRO(DetermineVersion)
+ENDMACRO(DETERMINE_VERSION)
Index: code/branches/buildsystem2/cmake/FindALUT.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindALUT.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/FindALUT.cmake	(revision 2583)
@@ -20,4 +20,7 @@
 # Some simplifications by Adrian Friedli
 #                 > www.orxonox.net <
+
+INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(HandleLibraryTypes)
 
 SET(ALUT_PATHS
@@ -70,5 +73,5 @@
   )
   FIND_LIBRARY(ALUT_LIBRARY_DEBUG
-    NAMES alut_${LIBRARY_DEBUG_POSTFIX}
+    NAMES alut${LIBRARY_DEBUG_POSTFIX}
     PATHS ${ALUT_PATHS}
     PATH_SUFFIXES lib libs
Index: code/branches/buildsystem2/cmake/FindCEGUI.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindCEGUI.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/FindCEGUI.cmake	(revision 2583)
@@ -19,4 +19,7 @@
 #                 > www.orxonox.net <
 
+INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(HandleLibraryTypes)
+
 FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
     PATHS
@@ -35,5 +38,5 @@
 )
 FIND_LIBRARY(CEGUI_LIBRARY_DEBUG
-    NAMES CEGUIBase_${LIBRARY_DEBUG_POSTFIX}
+    NAMES CEGUIBase${LIBRARY_DEBUG_POSTFIX}
     PATHS
     $ENV{CEGUIDIR}
@@ -45,5 +48,5 @@
 # Look in CEGUIVersion.h for the version number
 INCLUDE(DetermineVersion)
-DetermineVersion(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
+DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
 # STRLESS can be dangerous since it only compares strings.
 # Unfortunately VERSION_LESS is only provided since CMake v2.6.2
Index: code/branches/buildsystem2/cmake/FindDirectX.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindDirectX.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/FindDirectX.cmake	(revision 2583)
@@ -1,2 +1,5 @@
+INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(HandleLibraryTypes)
+
 IF(WIN32)
   # Find script for DirectX on Windows
Index: code/branches/buildsystem2/cmake/FindENet.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindENet.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/FindENet.cmake	(revision 2583)
@@ -14,4 +14,7 @@
 # Lots of simplifications by Adrian Friedli
 #                 > www.orxonox.net <
+
+INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(HandleLibraryTypes)
 
 FIND_PATH(ENET_INCLUDE_DIR enet/enet.h
@@ -31,5 +34,5 @@
 )
 FIND_LIBRARY(ENET_LIBRARY_DEBUG
-    NAMES enet_${LIBRARY_DEBUG_POSTFIX}
+    NAMES enet${LIBRARY_DEBUG_POSTFIX}
     PATHS
     $ENV{ENETDIR}
Index: code/branches/buildsystem2/cmake/FindOGRE.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindOGRE.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/FindOGRE.cmake	(revision 2583)
@@ -15,26 +15,20 @@
 #                 > www.orxonox.net <
 
+INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(HandleLibraryTypes)
+
 FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
-    PATHS
-    $ENV{OGRE_HOME}
-    /usr/local
-    /usr
+    PATHS $ENV{OGRE_HOME} /usr/local /usr
     PATH_SUFFIXES include include/OGRE
 )
 FIND_LIBRARY(OGRE_LIBRARY_OPTIMIZED
     NAMES OgreMain
-    PATHS
-    $ENV{OGRE_HOME}
-    /usr/local
-    /usr
-    PATH_SUFFIXES lib
+    PATHS $ENV{OGRE_HOME} /usr/local /usr
+    PATH_SUFFIXES lib bin/Release bin/release
 )
 FIND_LIBRARY(OGRE_LIBRARY_DEBUG
-    NAMES OgreMain_${LIBRARY_DEBUG_POSTFIX}
-    PATHS
-    $ENV{OGRE_HOME}
-    /usr/local
-    /usr
-    PATH_SUFFIXES lib
+    NAMES OgreMain${LIBRARY_DEBUG_POSTFIX}
+    PATHS $ENV{OGRE_HOME} /usr/local /usr
+    PATH_SUFFIXES lib bin/Debug bin/debug
 )
 
Index: code/branches/buildsystem2/cmake/FindOggVorbis.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindOggVorbis.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/FindOggVorbis.cmake	(revision 2583)
@@ -17,4 +17,7 @@
 # Most of all rewritten by Adrian Friedli
 #                 > www.orxonox.net <
+
+INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(HandleLibraryTypes)
 
 SET(OGG_SEARCH_PATHS
@@ -41,5 +44,5 @@
   PATH_SUFFIXES lib
 )
-FIND_LIBRARY(OGG_LIBRARY_DEBUG NAMES ogg_${LIBRARY_DEBUG_POSTFIX}
+FIND_LIBRARY(OGG_LIBRARY_DEBUG NAMES ogg${LIBRARY_DEBUG_POSTFIX}
   PATHS ${OGG_SEARCH_PATHS}
   PATH_SUFFIXES lib
@@ -49,5 +52,5 @@
   PATH_SUFFIXES lib
 )
-FIND_LIBRARY(VORBIS_LIBRARY_DEBUG NAMES vorbis_${LIBRARY_DEBUG_POSTFIX}
+FIND_LIBRARY(VORBIS_LIBRARY_DEBUG NAMES vorbis${LIBRARY_DEBUG_POSTFIX}
   PATHS ${OGG_SEARCH_PATHS}
   PATH_SUFFIXES lib
@@ -57,5 +60,5 @@
   PATH_SUFFIXES lib
 )
-FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG NAMES vorbisfile_${LIBRARY_DEBUG_POSTFIX}
+FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG NAMES vorbisfile${LIBRARY_DEBUG_POSTFIX}
   PATHS ${OGG_SEARCH_PATHS}
   PATH_SUFFIXES lib
@@ -70,4 +73,7 @@
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBIS DEFAULT_MSG
   VORBIS_LIBRARY_OPTIMIZED
+  VORBIS_INCLUDE_DIR
+)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBISFILE DEFAULT_MSG
   VORBISFILE_LIBRARY_OPTIMIZED
   VORBIS_INCLUDE_DIR
Index: code/branches/buildsystem2/cmake/HandleLibraryTypes.cmake
===================================================================
--- code/branches/buildsystem2/cmake/HandleLibraryTypes.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/HandleLibraryTypes.cmake	(revision 2583)
@@ -31,6 +31,6 @@
     IF(${_name}_LIBRARY_DEBUG)
       SET(${_name}_LIBRARY
-          OPTIMIZED ${${_name}_LIBRARY_OPTIMIZED} ${ARGN}
-          DEBUG     ${${_name}_LIBRARY_DEBUG}     ${ARGN}
+          optimized ${${_name}_LIBRARY_OPTIMIZED} ${ARGN}
+          debug     ${${_name}_LIBRARY_DEBUG}     ${ARGN}
           CACHE STRING "${_name} library file(s)" FORCE
       )
Index: code/branches/buildsystem2/cmake/UseTolua.cmake
===================================================================
--- code/branches/buildsystem2/cmake/UseTolua.cmake	(revision 2582)
+++ code/branches/buildsystem2/cmake/UseTolua.cmake	(revision 2583)
@@ -15,10 +15,4 @@
 #    along with this program; if not, write to the Free Software
 #    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
-
-IF(MINGW_LIBRARY_DIR)
-  SET(_tolua_command_wd "WORKING_DIRECTORY;${MINGW_LIBRARY_DIR}/lua-5.1.3/lib")
-ELSE(MINGW_LIBRARY_DIR)
-  SET(_tolua_command_wd)
-ENDIF(MINGW_LIBRARY_DIR)
 
 MACRO(TOLUA _tolua_package _tolua_srcfiles_varname)
@@ -39,15 +33,17 @@
 
   # Note: Some of the variables are already defined in src/tolua/CMakeLists.txt
+  #       or in the platform config
   ADD_CUSTOM_COMMAND(
     OUTPUT ${_tolua_cxxfile} ${_tolua_hfile}
-    COMMAND ${TOLUA_PARSER_EXECUTABLE} -n ${_tolua_package}
-                                       -w ${CMAKE_CURRENT_SOURCE_DIR}
-                                       -o ${_tolua_cxxfile}
-                                       -H ${_tolua_hfile}
-                                       -s ${TOLUA_PARSER_SOURCE}
-                                          ${_tolua_pkgfile}
-    DEPENDS ${TOLUA_PARSER_DEPENDENCIES}
+    COMMAND toluaexe_orxonox -n ${_tolua_package}
+                             -w ${CMAKE_CURRENT_SOURCE_DIR}
+                             -o ${_tolua_cxxfile}
+                             -H ${_tolua_hfile}
+                             -s ${TOLUA_PARSER_SOURCE}
+                                ${_tolua_pkgfile}
+    DEPENDS              ${TOLUA_PARSER_DEPENDENCIES}
     IMPLICIT_DEPENDS CXX ${_tolua_inputfiles}
-    ${_tolua_command_wd}
+    WORKING_DIRECTORY    ${TOLUA_PARSER_WORKING_DIRECTORY}
+    COMMENT "Generating tolua bind files for package ${_tolua_package}"
   )
 ENDMACRO(TOLUA)
Index: code/branches/buildsystem2/src/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/CMakeLists.txt	(revision 2582)
+++ code/branches/buildsystem2/src/CMakeLists.txt	(revision 2583)
@@ -3,5 +3,5 @@
   ${OGRE_INCLUDE_DIR}
   ${CEGUI_INCLUDE_DIR}
-  ${ENet_INCLUDE_DIR}
+  ${ENET_INCLUDE_DIR}
   ${Boost_INCLUDE_DIRS}
   ${OPENAL_INCLUDE_DIR}
@@ -17,5 +17,5 @@
 # Check whether the required CEGUILua version is even available
 IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua-${CEGUI_VERSION})
-  MESSAGE(FATAL_ERROR "Your CEGUI version is not supported (${CEGUI_VERSION})")
+  MESSAGE(FATAL_ERROR "No matching CEGUILua version shipped with Orxonox (${CEGUI_VERSION})")
 ENDIF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua-${CEGUI_VERSION})
 
@@ -39,4 +39,9 @@
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTIXML_USE_TICPP")
 
+# Include macros
+INCLUDE(AddSourceFiles)
+INCLUDE(UseTolua)
+
+# External libraries, but copied into the repository
 ADD_SUBDIRECTORY(ceguilua-${CEGUI_VERSION}/ceguilua)
 ADD_SUBDIRECTORY(cpptcl)
@@ -46,8 +51,4 @@
 ADD_SUBDIRECTORY(tolua)
 
-# Include macros
-INCLUDE(AddSourceFiles)
-INCLUDE(UseTolua)
-
 # Our own libraries
 ADD_SUBDIRECTORY(util)
Index: code/branches/buildsystem2/src/audio/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/audio/CMakeLists.txt	(revision 2582)
+++ code/branches/buildsystem2/src/audio/CMakeLists.txt	(revision 2583)
@@ -19,4 +19,5 @@
   ${OGG_LIBRARY}
   core
+  util
 )
 
Index: code/branches/buildsystem2/src/network/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/network/CMakeLists.txt	(revision 2582)
+++ code/branches/buildsystem2/src/network/CMakeLists.txt	(revision 2583)
@@ -28,4 +28,5 @@
   ${ENET_LIBRARY}
   ${Boost_THREAD_LIBRARY}
+  util
   core
 )
Index: code/branches/buildsystem2/src/ogreceguirenderer/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/ogreceguirenderer/CMakeLists.txt	(revision 2582)
+++ code/branches/buildsystem2/src/ogreceguirenderer/CMakeLists.txt	(revision 2583)
@@ -7,4 +7,8 @@
 ADD_LIBRARY(ogreceguirenderer_orxonox SHARED ${SRC_FILES})
 
+TARGET_LINK_LIBRARIES(ogreceguirenderer_orxonox
+  ${OGRE_LIBRARY}
+  ${CEGUI_LIBRARY}
+)
 IF (NOT WIN32)
   INSTALL(TARGETS ogreceguirenderer_orxonox LIBRARY DESTINATION lib)
Index: code/branches/buildsystem2/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/buildsystem2/src/orxonox/OrxonoxPrereqs.h	(revision 2582)
+++ code/branches/buildsystem2/src/orxonox/OrxonoxPrereqs.h	(revision 2583)
@@ -40,4 +40,5 @@
 // Shared library settings
 //-----------------------------------------------------------------------
+#define ORXONOX_NO_EXPORTS // This is an executable that needs no exports
 #if (ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32) && !(defined(ORXONOX_STATIC_BUILD) || defined(ORXONOX_NO_EXPORTS))
 #  ifdef ORXONOX_SHARED_BUILD
Index: code/branches/buildsystem2/src/tolua/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/tolua/CMakeLists.txt	(revision 2582)
+++ code/branches/buildsystem2/src/tolua/CMakeLists.txt	(revision 2583)
@@ -6,4 +6,5 @@
   tolua_to.c
 )
+TARGET_LINK_LIBRARIES(tolualib_orxonox ${LUA_LIBRARY})
 
 IF (NOT WIN32)
@@ -27,8 +28,6 @@
 ENDIF("${LUA_VERSION}" MATCHES "^5.0")
 
-# Set some variables to the parent scope in order to use them in the TOLUA macro
-GET_TARGET_PROPERTY(_temp_location toluaexe_orxonox LOCATION)
-SET(TOLUA_PARSER_EXECUTABLE ${_temp_location} PARENT_SCOPE)
-SET(TOLUA_PARSER_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${TOLUA_ALL_PACK}" PARENT_SCOPE)
+# Set some variables to the cache in order to use them in the TOLUA macro
+SET(TOLUA_PARSER_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${TOLUA_ALL_PACK}" CACHE STRING "")
 SET(TOLUA_PARSER_DEPENDENCIES
   toluaexe_orxonox
@@ -56,4 +55,5 @@
   ${CMAKE_CURRENT_SOURCE_DIR}/lua/doit.lua
 
-  PARENT_SCOPE
+  CACHE STRING ""
 )
+MARK_AS_ADVANCED(TOLUA_PARSER_SOURCE TOLUA_PARSER_DEPENDENCIES)
Index: code/branches/buildsystem2/visual_studio/vc8/base.vsprops
===================================================================
--- code/branches/buildsystem2/visual_studio/vc8/base.vsprops	(revision 2582)
+++ code/branches/buildsystem2/visual_studio/vc8/base.vsprops	(revision 2583)
@@ -23,5 +23,4 @@
 		SubSystem="1"
 		ImportLibrary="$(IntDir)\$(TargetName).lib"
-		TargetMachine="1"
 	/>
 </VisualStudioPropertySheet>
Index: code/branches/buildsystem2/visual_studio/vc8/ois.vsprops
===================================================================
--- code/branches/buildsystem2/visual_studio/vc8/ois.vsprops	(revision 2582)
+++ code/branches/buildsystem2/visual_studio/vc8/ois.vsprops	(revision 2583)
@@ -9,5 +9,5 @@
 		Name="VCCLCompilerTool"
 		AdditionalOptions="/MP2"
-		PreprocessorDefinitions="OIS_NONCLIENT_BUILD;OIS_DYNAMIC_LIB"
+		PreprocessorDefinitions="OIS_NONCLIENT_BUILD"
 	/>
 	<Tool
Index: code/branches/buildsystem2/visual_studio/vc8/orxonox.vsprops
===================================================================
--- code/branches/buildsystem2/visual_studio/vc8/orxonox.vsprops	(revision 2582)
+++ code/branches/buildsystem2/visual_studio/vc8/orxonox.vsprops	(revision 2583)
@@ -10,5 +10,5 @@
 		AdditionalOptions="/MP2 /Zm200"
 		AdditionalIncludeDirectories="&quot;$(RootDir)\src\orxonox\pch\havepch&quot;"
-		PreprocessorDefinitions="ORXONOX_NO_EXPORTS;ORXONOX_ENABLE_PCH;LUA_BUILD_AS_DLL"
+		PreprocessorDefinitions="ORXONOX_ENABLE_PCH"
 		UsePrecompiledHeader="2"
 		PrecompiledHeaderThrough="OrxonoxStableHeaders.h"
