Index: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt	(revision 1120)
+++ code/trunk/CMakeLists.txt	(revision 1126)
@@ -32,6 +32,6 @@
 
 #set binary output directories
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
-SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/bin/lib)
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
+SET(LIBRARY_OUTPUT_PATH    ${PROJECT_SOURCE_DIR}/bin/lib)
 
 # global compiler/linker flags. force -O2!
@@ -43,6 +43,8 @@
 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
 
-#Create verbose makefile output when compiling
-SET(CMAKE_VERBOSE_MAKEFILE TRUE)
+#use 'cmake -D make_verb:1 path' to get verbose make output when compiling
+IF (MAKE_VERB)
+ SET(CMAKE_VERBOSE_MAKEFILE TRUE)
+ENDIF (MAKE_VERB)
 
 
Index: code/trunk/cmake/FindLua.cmake
===================================================================
--- code/trunk/cmake/FindLua.cmake	(revision 1120)
+++ code/trunk/cmake/FindLua.cmake	(revision 1126)
@@ -1,69 +1,74 @@
-# Find Lua includes and library
+#  Find Lua header and library files
 #
-# This module defines
-#  Lua_INCLUDE_DIR
-#  Lua_LIBRARIES, the libraries to link against to use Lua.
-#  Lua_LIB_DIR, the location of the libraries
-#  Lua_FOUND, If false, do not try to use Lua
+#  When called, this script tries to define:
+#  Lua_INCLUDE_DIR    Header files directory
+#  Lua_LIBRARIES      library files (or file when using lua 5.1)
+#  Lua_FOUND          defined (true) if lua was found
+#  Lua_VERSION        either 5.1 or 5.0 or undefined
 #
-# Copyright © 2007, Matt Williams
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
+#  authors: Benjamin Knecht, Reto Grieder
 
-MESSAGE(STATUS "lua libs in cache: ${Lua_LIBRARIES}")
 IF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
-    SET(Lua_FIND_QUIETLY TRUE) # Already in cache, be silent
+
+  # Already in cache, be silent
+  SET(Lua_FOUND TRUE)
+  SET(Lua_FIND_QUIETLY TRUE) 
+  MESSAGE(STATUS "Lua was found.")
+
+ELSE (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
+
+  FIND_PATH(Lua_INCLUDE_DIR_51 lua.h
+    /usr/include/lua5.1
+    /usr/local/include/lua5.1
+    ../libs/lua-5.1.3/src)
+
+  FIND_PATH(Lua_INCLUDE_DIR_50 lua.h
+    /usr/include/lua50
+    /usr/local/include/lua50
+    /usr/pack/lua-5.0.3-sd/include)
+
+  FIND_LIBRARY(Lua_LIBRARY_51 lua5.1
+    /usr/lib
+    /usr/local/lib
+    ../libs/lua-5.1.3/lib)
+
+  FIND_LIBRARY(Lua_LIBRARY_1_50 NAMES lua50 lua PATHS
+	/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib #tardis
+    /usr/lib
+    /usr/local/lib)
+
+  FIND_LIBRARY(Lua_LIBRARY_2_50 NAMES lualib50 lualib PATHS
+	/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib #tardis
+    /usr/lib
+    /usr/local/lib)
+
+
+  IF (Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51)
+
+    # Found newer lua 5.1 libs
+    SET(Lua_FOUND TRUE)
+    SET(Lua_VERSION 5.1 CACHE STRING "")
+    SET(Lua_INCLUDE_DIR ${Lua_INCLUDE_DIR_51} CACHE PATH "")
+    SET(Lua_LIBRARIES ${Lua_LIBRARY_51} CACHE FILEPATH "")
+
+  ELSEIF(Lua_INCLUDE_DIR_50 AND Lua_LIBRARY_1_50 AND Lua_LIBRARY_2_50)
+
+    # Found older lua 5.0 libs
+    SET(Lua_FOUND TRUE)
+    SET(Lua_VERSION 5.0 CACHE STRING "")
+    SET(Lua_INCLUDE_DIR ${Lua_INCLUDE_DIR_50} CACHE PATH "")
+    SET(Lua_LIBRARIES ${Lua_LIBRARY_1_50} ${Lua_LIBRARY_2_50} CACHE FILEPATH "")
+
+  ENDIF (Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51)
+	
+
+  IF (Lua_FOUND)
+    MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}")
+  ELSE (Lua_FOUND)
+    IF (Lua_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Could not find Lua")
+    ENDIF (Lua_FIND_REQUIRED)
+  ENDIF (Lua_FOUND)
+
 ENDIF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
 
-FIND_PATH(Lua_INCLUDE_DIR lua.h
-	/usr/include/lua5.1
-	/usr/local/include/lua5.1
-	../libs/lua-5.1.3/src)
-
-FIND_LIBRARY(Lua_LIBRARIES lua5.1
-	/usr/lib
-	/usr/local/lib
-	../libs/lua-5.1.3/lib)
-
-IF (NOT Lua_INCLUDE_DIR)
- FIND_PATH(Lua_INCLUDE_DIR lua.h
-	/usr/include/lua50
-	/usr/local/include/lua50
-	/usr/pack/lua-5.0.3-sd/include)
-ENDIF (NOT Lua_INCLUDE_DIR)
-
-IF (NOT Lua_LIBRARIES)
- FIND_LIBRARY(Lua_LIBRARIES lua50
-	/usr/lib
-	/usr/local/lib)
-
- FIND_LIBRARY(Lua_LIBRARY lualib50
-	/usr/lib
-	/usr/local/lib)
-
-#SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})
-ENDIF (NOT Lua_LIBRARIES)
-
-#especially for tardis
-IF (NOT Lua_LIBRARIES)
- FIND_LIBRARY(Lua_LIBRARIES lua
-	/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib)
-
- FIND_LIBRARY(Lua_LIBRARY lualib
-	/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib)
-
-#SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})
-ENDIF (NOT Lua_LIBRARIES)
-
-IF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
-    SET(Lua_FOUND TRUE)
-ENDIF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
-
-IF (Lua_FOUND)
-    MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}")
-    MESSAGE(STATUS "Found Lua: ${Lua_LIBRARY}")
-ELSE (Lua_FOUND)
-    IF (Lua_FIND_REQUIRED)
-        MESSAGE(FATAL_ERROR "Could not find Lua")
-    ENDIF (Lua_FIND_REQUIRED)
-ENDIF (Lua_FOUND)
Index: code/trunk/src/core/CMakeLists.txt
===================================================================
--- code/trunk/src/core/CMakeLists.txt	(revision 1120)
+++ code/trunk/src/core/CMakeLists.txt	(revision 1126)
@@ -34,5 +34,4 @@
   tolualib
   ${Lua_LIBRARIES}
-  ${Lua_LIBRARY}
   ${OIS_LIBRARIES}
 )
Index: code/trunk/src/tolua/CMakeLists.txt
===================================================================
--- code/trunk/src/tolua/CMakeLists.txt	(revision 1120)
+++ code/trunk/src/tolua/CMakeLists.txt	(revision 1126)
@@ -14,5 +14,4 @@
 TARGET_LINK_LIBRARIES(tolua
   ${Lua_LIBRARIES}
-  ${Lua_LIBRARY}
   m
 )
@@ -41,7 +40,7 @@
 ADD_CUSTOM_COMMAND(
   OUTPUT tolua_bind.h tolua_bind.cc
-  COMMAND ${TOLUA_EXE} -n orxonox -o ../../src/tolua/tolua_bind.cc -H ../../src/tolua/tolua_bind.h ../../src/tolua/tolua.pkg
+  COMMAND ${TOLUA_EXE} -n orxonox -o tolua/tolua_bind.cc -H tolua/tolua_bind.h tolua/tolua.pkg
   DEPENDS tolua
-  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin/lib
+  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src
 )
 
@@ -50,5 +49,4 @@
 TARGET_LINK_LIBRARIES(tolualib
   ${Lua_LIBRARIES}
-  ${Lua_LIBRARY}
 )
 
Index: code/trunk/src/tolua/tolua.pkg
===================================================================
--- code/trunk/src/tolua/tolua.pkg	(revision 1120)
+++ code/trunk/src/tolua/tolua.pkg	(revision 1126)
@@ -1,1 +1,1 @@
-$cfile "../../src/core/Script_clean.h"
+$cfile "core/Script_clean.h"
Index: code/trunk/visual_studio/vc8/core.vcproj
===================================================================
--- code/trunk/visual_studio/vc8/core.vcproj	(revision 1120)
+++ code/trunk/visual_studio/vc8/core.vcproj	(revision 1126)
@@ -252,19 +252,4 @@
 				>
 			</File>
-			<Filter
-				Name="tolua"
-				>
-				<File
-					RelativePath="..\..\src\core\tolua\tolua_bind.cc"
-					>
-					<FileConfiguration
-						Name="Debug|Win32"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-				</File>
-			</Filter>
 		</Filter>
 		<Filter
@@ -425,12 +410,4 @@
 				>
 			</File>
-			<Filter
-				Name="tolua"
-				>
-				<File
-					RelativePath="..\..\src\core\tolua\tolua_bind.h"
-					>
-				</File>
-			</Filter>
 		</Filter>
 	</Files>
Index: code/trunk/visual_studio/vc8/tolua++.vcproj
===================================================================
--- code/trunk/visual_studio/vc8/tolua++.vcproj	(revision 1120)
+++ code/trunk/visual_studio/vc8/tolua++.vcproj	(revision 1126)
@@ -131,21 +131,25 @@
 			>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_event.c"
+				RelativePath="..\..\src\tolua\tolua_bind.cc"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_is.c"
+				RelativePath="..\..\src\tolua\tolua_event.c"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_map.c"
+				RelativePath="..\..\src\tolua\tolua_is.c"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_push.c"
+				RelativePath="..\..\src\tolua\tolua_map.c"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_to.c"
+				RelativePath="..\..\src\tolua\tolua_push.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\tolua\tolua_to.c"
 				>
 			</File>
@@ -157,9 +161,13 @@
 			>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua++.h"
+				RelativePath="..\..\src\tolua\tolua++.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_event.h"
+				RelativePath="..\..\src\tolua\tolua_bind.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\tolua\tolua_event.h"
 				>
 			</File>
Index: code/trunk/visual_studio/vc8/util.vcproj
===================================================================
--- code/trunk/visual_studio/vc8/util.vcproj	(revision 1120)
+++ code/trunk/visual_studio/vc8/util.vcproj	(revision 1126)
@@ -157,4 +157,8 @@
 			</File>
 			<File
+				RelativePath="..\..\src\util\ExprParser.cc"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\util\Math.cc"
 				>
@@ -199,4 +203,8 @@
 			</File>
 			<File
+				RelativePath="..\..\src\util\ExprParser.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\util\Math.h"
 				>
