Index: code/branches/buildsystem2/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+SET_SOURCE_FILES(ORXONOX_SRC_FILES
   CameraManager.cc
   GraphicsEngine.cc
@@ -7,22 +7,19 @@
   Settings.cc
 )
+ADD_SUBDIRECTORY(gamestates)
+ADD_SUBDIRECTORY(gui)
+ADD_SUBDIRECTORY(objects)
+ADD_SUBDIRECTORY(overlays)
+ADD_SUBDIRECTORY(tools)
+GET_ALL_HEADER_FILES(ORXONOX_HDR_FILES)
+SET(ORXONOX_FILES ${ORXONOX_SRC_FILES} ${ORXONOX_HDR_FILES})
 
-ADD_SOURCE_DIRECTORY(gamestates)
-ADD_SOURCE_DIRECTORY(gui)
-ADD_SOURCE_DIRECTORY(objects)
-ADD_SOURCE_DIRECTORY(overlays)
-ADD_SOURCE_DIRECTORY(tools)
-
-WRITE_SOURCE_FILES(ORXONOX_SRC_FILES)
-
-TOLUA(Orxonox ORXONOX_SRC_FILES INPUTFILES gui/GUIManager.h)
+GENERATE_SOURCE_GROUPS(${ORXONOX_FILES})
+GENERATE_TOLUA_BINDINGS(Orxonox ORXONOX_FILES INPUTFILES gui/GUIManager.h)
 
 # Not using precompiled header files: Avoid dependencies
 INCLUDE_DIRECTORIES(pch/nopch)
 
-# Enlarge heap size for precompiled header files
-ADD_CXX_FLAGS("-Zm200" MSVC)
-
-ADD_EXECUTABLE(orxonox ${ORXONOX_SRC_FILES})
+ADD_EXECUTABLE(orxonox ${ORXONOX_FILES})
 GET_TARGET_PROPERTY(_exec_loc orxonox LOCATION)
 GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME)
@@ -44,9 +41,8 @@
   ${CEGUI_LIBRARY}
   ${LUA_LIBRARIES}
-  #${CEGUI_SCRIPT_LIBRARIES}
-  ceguilua_orxonox
+  ${CEGUILUA_LIBRARY}
   ogreceguirenderer_orxonox
-  tinyxml_orxonox
-  tolualib_orxonox
+  tinyxml++_orxonox
+  tolua++_orxonox
   util
   core
Index: code/branches/buildsystem2/src/orxonox/gamestates/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/gamestates/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/gamestates/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   GSDedicated.cc
   GSClient.cc
Index: code/branches/buildsystem2/src/orxonox/gui/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/gui/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/gui/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   GUIManager.cc
 )
Index: code/branches/buildsystem2/src/orxonox/gui/GUIManager.cc
===================================================================
--- code/branches/buildsystem2/src/orxonox/gui/GUIManager.cc	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/gui/GUIManager.cc	(revision 2621)
@@ -39,6 +39,10 @@
 #include <OgreRoot.h>
 #include <CEGUI.h>
-#include <ceguilua/CEGUILua.h>
 #include <ogreceguirenderer/OgreCEGUIRenderer.h>
+#ifdef CEGUILUA_USE_INTERNAL_LIBRARY
+#   include <ceguilua/CEGUILua.h>
+#else
+#   include <CEGUILua.h>
+#endif
 
 #include "util/Exception.h"
@@ -103,5 +107,5 @@
 	        //lua_pushnil(luaState_);
 	        //lua_setglobal(luaState_, "Core");
-            // TODO: deleting the script module fails an assertation.
+            // TODO: deleting the script module fails an assertion.
             // However there is not much we can do about it since it occurs too when
             // we don't open Core or Orxonox. Might be a CEGUI issue.
Index: code/branches/buildsystem2/src/orxonox/objects/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   EventListener.cc
   EventDispatcher.cc
@@ -13,9 +13,9 @@
 )
 
-ADD_SOURCE_DIRECTORY(controllers)
-ADD_SOURCE_DIRECTORY(gametypes)
-ADD_SOURCE_DIRECTORY(infos)
-#ADD_SOURCE_DIRECTORY(pickup)
-ADD_SOURCE_DIRECTORY(quest)
-ADD_SOURCE_DIRECTORY(weaponSystem)
-ADD_SOURCE_DIRECTORY(worldentities)
+ADD_SUBDIRECTORY(controllers)
+ADD_SUBDIRECTORY(gametypes)
+ADD_SUBDIRECTORY(infos)
+#ADD_SUBDIRECTORY(pickup)
+ADD_SUBDIRECTORY(quest)
+ADD_SUBDIRECTORY(weaponSystem)
+ADD_SUBDIRECTORY(worldentities)
Index: code/branches/buildsystem2/src/orxonox/objects/controllers/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/controllers/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/controllers/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Controller.cc
   HumanController.cc
Index: code/branches/buildsystem2/src/orxonox/objects/gametypes/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/gametypes/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/gametypes/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Gametype.cc
 )
Index: code/branches/buildsystem2/src/orxonox/objects/infos/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/infos/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/infos/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Info.cc
   PlayerInfo.cc
Index: code/branches/buildsystem2/src/orxonox/objects/pickup/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/pickup/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/pickup/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   ShipEquipmentClasses.cc
   ShipItem.cc
Index: code/branches/buildsystem2/src/orxonox/objects/quest/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/quest/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/quest/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   AddQuest.cc
   AddQuestHint.cc
Index: code/branches/buildsystem2/src/orxonox/objects/weaponSystem/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/weaponSystem/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/weaponSystem/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Munition.cc
   Weapon.cc
@@ -7,5 +7,5 @@
 )
 
-#ADD_SOURCE_DIRECTORY(munitions)
-#ADD_SOURCE_DIRECTORY(projectiles)
-#ADD_SOURCE_DIRECTORY(weapons)
+#ADD_SUBDIRECTORY(munitions)
+#ADD_SUBDIRECTORY(projectiles)
+#ADD_SUBDIRECTORY(weapons)
Index: code/branches/buildsystem2/src/orxonox/objects/weaponSystem/munitions/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/weaponSystem/munitions/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/weaponSystem/munitions/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   LaserGunMunition.cc
 )
Index: code/branches/buildsystem2/src/orxonox/objects/weaponSystem/projectiles/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/weaponSystem/projectiles/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/weaponSystem/projectiles/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   BillboardProjectile.cc
   ParticleProjectile.cc
Index: code/branches/buildsystem2/src/orxonox/objects/weaponSystem/weapons/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/weaponSystem/weapons/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/weaponSystem/weapons/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   LaserGun.cc
   Missile.cc
Index: code/branches/buildsystem2/src/orxonox/objects/worldentities/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/worldentities/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/worldentities/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   WorldEntity.cc
   PositionableEntity.cc
@@ -16,4 +16,4 @@
 )
 
-ADD_SOURCE_DIRECTORY(pawns)
-ADD_SOURCE_DIRECTORY(triggers)
+ADD_SUBDIRECTORY(pawns)
+ADD_SUBDIRECTORY(triggers)
Index: code/branches/buildsystem2/src/orxonox/objects/worldentities/pawns/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/worldentities/pawns/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/worldentities/pawns/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Spectator.cc
   Pawn.cc
Index: code/branches/buildsystem2/src/orxonox/objects/worldentities/triggers/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/objects/worldentities/triggers/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/objects/worldentities/triggers/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Trigger.cc
   DistanceTrigger.cc
Index: code/branches/buildsystem2/src/orxonox/orxonox.vcproj.user
===================================================================
--- code/branches/buildsystem2/src/orxonox/orxonox.vcproj.user	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/orxonox.vcproj.user	(revision 2621)
@@ -11,5 +11,5 @@
 			<DebugSettings
 				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="Path=${ORXONOX_LIBRARY_BIN_DIR}"
+				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
 				EnvironmentMerge="true"
 			/>
@@ -20,5 +20,5 @@
 			<DebugSettings
 				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="Path=${ORXONOX_LIBRARY_BIN_DIR}"
+				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
 				EnvironmentMerge="true"
 			/>
@@ -29,5 +29,5 @@
 			<DebugSettings
 				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="Path=${ORXONOX_LIBRARY_BIN_DIR}"
+				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
 				EnvironmentMerge="true"
 			/>
@@ -38,5 +38,5 @@
 			<DebugSettings
 				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="Path=${ORXONOX_LIBRARY_BIN_DIR}"
+				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
 				EnvironmentMerge="true"
 			/>
Index: code/branches/buildsystem2/src/orxonox/overlays/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/overlays/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/overlays/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   OrxonoxOverlay.cc
   OverlayGroup.cc
@@ -5,5 +5,5 @@
 )
 
-ADD_SOURCE_DIRECTORY(console)
-ADD_SOURCE_DIRECTORY(debug)
-ADD_SOURCE_DIRECTORY(hud)
+ADD_SUBDIRECTORY(console)
+ADD_SUBDIRECTORY(debug)
+ADD_SUBDIRECTORY(hud)
Index: code/branches/buildsystem2/src/orxonox/overlays/console/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/overlays/console/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/overlays/console/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   InGameConsole.cc
 )
Index: code/branches/buildsystem2/src/orxonox/overlays/debug/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/overlays/debug/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/overlays/debug/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   DebugFPSText.cc
   DebugRTRText.cc
Index: code/branches/buildsystem2/src/orxonox/overlays/hud/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/overlays/hud/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/overlays/hud/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   HUDBar.cc
   HUDNavigation.cc
Index: code/branches/buildsystem2/src/orxonox/pch/nopch/OrxonoxStableHeaders.h
===================================================================
--- code/branches/buildsystem2/src/orxonox/pch/nopch/OrxonoxStableHeaders.h	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/pch/nopch/OrxonoxStableHeaders.h	(revision 2621)
@@ -35,5 +35,5 @@
 #define _OrxonoxStableHeaders_H__
 
-#include "util/OrxonoxPlatform.h"
+#include "OrxonoxConfig.h"
 
 #endif /* _OrxonoxStableHeaders_H__ */
Index: code/branches/buildsystem2/src/orxonox/tools/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/tools/CMakeLists.txt	(revision 2619)
+++ code/branches/buildsystem2/src/orxonox/tools/CMakeLists.txt	(revision 2621)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   BillboardSet.cc
   Mesh.cc
