Index: code/branches/buildsystem2/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/CMakeLists.txt	(revision 2510)
@@ -33,12 +33,12 @@
 SET(CMAKE_C_FLAGS   "$ENV{CFLAGS}   -Wall -Wextra -Wno-unused-parameter")
 SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -Wall -Wextra -Wno-unused-parameter")
-SET(CMAKE_C_FLAGS_DEBUG            "-g -ggdb")
-SET(CMAKE_CXX_FLAGS_DEBUG          "-g -ggdb")
-SET(CMAKE_C_FLAGS_RELEASE          "-O3 -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG")
-SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -DNDEBUG -g -ggdb")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -DNDEBUG -g -ggdb")
-SET(CMAKE_C_FLAGS_MINSIZEREL       "-Os -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
+SET(CMAKE_C_FLAGS_DEBUG            "-g -ggdb -fPIC")
+SET(CMAKE_CXX_FLAGS_DEBUG          "-g -ggdb -fPIC")
+SET(CMAKE_C_FLAGS_RELEASE          "-O3 -DNDEBUG -fPIC")
+SET(CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG -fPIC")
+SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -DNDEBUG -g -ggdb -fPIC")
+SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -DNDEBUG -g -ggdb -fPIC")
+SET(CMAKE_C_FLAGS_MINSIZEREL       "-Os -DNDEBUG -fPIC")
+SET(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG -fPIC")
 
 SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
@@ -52,5 +52,5 @@
 FIND_PACKAGE(OGRE REQUIRED)
 FIND_PACKAGE(CEGUI REQUIRED)
-# CEGUI_OGRE included in source
+# CEGUI_OGRE is already included in source
 #FIND_PACKAGE(CEGUI_OGRE REQUIRED)
 FIND_PACKAGE(ENet REQUIRED)
@@ -61,8 +61,20 @@
 FIND_PACKAGE(ZLIB REQUIRED)
 FIND_PACKAGE(DirectX REQUIRED)
-FIND_PACKAGE(Lua50 REQUIRED)
-#FIND_PACKAGE(Lua51 QUIET)
 
-#don't require the whole tcl rat tail
+# Require Lua 5.0 or 5.1
+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)
+ENDIF(NOT LUA50_FOUND)
+# Determine Lua version (Lua50 may also find Lua51)
+FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" LUA_VERSION REGEX "LUA_VERSION")
+STRING(REGEX REPLACE "^.*\"Lua (.*)\".*$" "\\1" LUA_VERSION "${LUA_VERSION}")
+
+# Don't require the whole tcl rat tail
 FIND_PACKAGE(TCL QUIET)
 IF(NOT TCL_FOUND)
Index: code/branches/buildsystem2/TODO_buildsystem
===================================================================
--- code/branches/buildsystem2/TODO_buildsystem	(revision 2509)
+++ code/branches/buildsystem2/TODO_buildsystem	(revision 2510)
@@ -1,2 +1,1 @@
-- Detect lua version and modify all.lua accordingly (do not include compat-5.1 for lua 5.0)
 - Detect ceguilua version other than with the variable from the pkg config file. It might not exist everywhere.
Index: code/branches/buildsystem2/bin/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/bin/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/bin/CMakeLists.txt	(revision 2510)
@@ -8,7 +8,10 @@
 
 IF(IS_TARDIS)
+  # OGRE can't find fonts to display config screen on Tardis,
+  # so providing default config file here.
   SET(CONFIG_FILES ${CONFIG_FILES}
     linux/run-script
-	tardis/orxonox.ini
+    tardis/orxonox.ini
+    tardis/ogre.cfg
   )
 
@@ -16,5 +19,5 @@
   SET(CONFIG_FILES ${CONFIG_FILES}
     linux/run-script
-	linux/orxonox.ini
+    linux/orxonox.ini
   )
 ENDIF(IS_TARDIS)
Index: code/branches/buildsystem2/bin/linux/orxonox.ini
===================================================================
--- code/branches/buildsystem2/bin/linux/orxonox.ini	(revision 2509)
+++ code/branches/buildsystem2/bin/linux/orxonox.ini	(revision 2510)
@@ -4,3 +4,3 @@
 [GSGraphics]
 ogrePluginsFolder_ = /usr/lib/OGRE
-ogrePlugins_ = RenderSystem_GL, Plugin_ParticleFX, Plugin_CgProgramManager #,Plugin_BSPSceneManager, Plugin_OctreeSceneManager
+ogrePlugins_ = RenderSystem_GL, Plugin_ParticleFX #, Plugin_CgProgramManager, Plugin_BSPSceneManager, Plugin_OctreeSceneManager
Index: code/branches/buildsystem2/bin/tardis/ogre.cfg
===================================================================
--- code/branches/buildsystem2/bin/tardis/ogre.cfg	(revision 2510)
+++ code/branches/buildsystem2/bin/tardis/ogre.cfg	(revision 2510)
@@ -0,0 +1,7 @@
+Render System=OpenGL Rendering Subsystem
+
+[OpenGL Rendering Subsystem]
+FSAA=0
+Full Screen=No
+RTT Preferred Mode=FBO
+Video Mode=800 x 600
Index: code/branches/buildsystem2/cmake/CheckOrxonoxWinDeps.cmake
===================================================================
--- code/branches/buildsystem2/cmake/CheckOrxonoxWinDeps.cmake	(revision 2509)
+++ code/branches/buildsystem2/cmake/CheckOrxonoxWinDeps.cmake	(revision 2510)
@@ -33,15 +33,23 @@
 IF (MINGW)
   MESSAGE(STATUS "Running on MinGW. Using customized paths.")
-  SET(MINGW_LIBRARY_DIR "../libs")
+  SET(MINGW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/../libs")
   #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{ENETDIR} ".${MINGW_LIBRARY_DIR}/enet-1.1")
-  SET(ENV{ALUTDIR} ".${MINGW_LIBRARY_DIR}/freealut-1.1.0")
-  SET(ENV{OPENALDIR} ".${MINGW_LIBRARY_DIR}/openal-0.0.8/common")
-  SET(ENV{LUA_DIR} ".${MINGW_LIBRARY_DIR}/lua-5.1.3")
-  SET(ENV{OGGVORBISDIR} ".${MINGW_LIBRARY_DIR}/libogg-1.1.3")
-  #SET(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")
-  SET(ENV{CEGUIDIR} ".${MINGW_LIBRARY_DIR}/cegui-0.6.1")
-  SET(ENV{OGREDIR} ".${MINGW_LIBRARY_DIR}/ogre/OgreMain;.${MINGW_LIBRARY_DIR}/ogre/Samples/Common/bin/Release")
+  SET(BOOST_INCLUDEDIR "${MINGW_LIBRARY_DIR}/boost_1_34_1")
+  SET(BOOST_LIBRARYDIR "${MINGW_LIBRARY_DIR}/boost_1_34_1/stage/lib")
+  SET(ENV{ENETDIR} "${MINGW_LIBRARY_DIR}/enet-1.1")
+  SET(ENV{ALUTDIR} "${MINGW_LIBRARY_DIR}/freealut-1.1.0")
+  SET(ENV{OPENALDIR} "${MINGW_LIBRARY_DIR}/openal-0.0.8/common")
+  SET(ENV{LUA_DIR} "${MINGW_LIBRARY_DIR}/lua-5.1.3")
+  SET(ENV{OGGVORBISDIR} "${MINGW_LIBRARY_DIR}/oggvorbis-1.1.3-1.2.0")
+  SET(TCL_INCLUDE_PATH "${MINGW_LIBRARY_DIR}/tcl8.5.2/generic")
+  SET(TCL_LIBRARY_PATH "${MINGW_LIBRARY_DIR}/tcl8.5.2/win")
+  SET(ENV{CEGUIDIR} "${MINGW_LIBRARY_DIR}/cegui-0.6.1")
+  SET(ENV{OGREDIR} "${MINGW_LIBRARY_DIR}/ogre/OgreMain;${MINGW_LIBRARY_DIR}/ogre/Samples/Common/bin/Release")
+  SET(ZLIB_INCLUDE_DIR "${MINGW_LIBRARY_DIR}/zlib/include")
+  SET(ZLIB_LIB_DIR "${MINGW_LIBRARY_DIR}/zlib")
+  IF (NOT ENV{DXSDK_DIR})
+    SET(ENV{DXSDK_DIR} "${MINGW_LIBRARY_DIR}/DXSDK")
+  ENDIF (NOT ENV{DXSDK_DIR})
 ENDIF (MINGW)
+
+#MARK_AS_ADVANCED(MINGW_LIBRARY_DIR)
Index: code/branches/buildsystem2/cmake/CheckTardis.cmake
===================================================================
--- code/branches/buildsystem2/cmake/CheckTardis.cmake	(revision 2509)
+++ code/branches/buildsystem2/cmake/CheckTardis.cmake	(revision 2510)
@@ -4,31 +4,11 @@
 #################################################
 
-# only run this test on a lunix/unix machine
 IF (UNIX)
-  FIND_PROGRAM(UNAME_CMD "uname"
-  PATHS "/usr/bin /bin")
-  IF(NOT UNAME_CMD)
-    MESSAGE(ERROR "Unable to find uname. Tardis-Check cannot be done.")
-  ENDIF(NOT UNAME_CMD)
-
-  # run uname -n to get nodename
-  EXECUTE_PROCESS(
-  COMMAND "${UNAME_CMD}" "-n"
-  RESULT_VARIABLE UNAME_RV
-  ERROR_VARIABLE UNAME_EV
-  OUTPUT_VARIABLE UNAME_OV)
-
-  IF (NOT "${UNAME_RV}" STREQUAL "0")
-    MESSAGE(ERROR "ERROR: uname terminated unclean.")
-  ENDIF (NOT "${UNAME_RV}" STREQUAL "0")
-
-  # check wheter we are on a tardis machine
-  IF ("${UNAME_OV}" MATCHES "tardis")
+  FILE(STRINGS /etc/hostname HOSTNAME LIMIT_COUNT 1)
+  IF ("${HOSTNAME}" MATCHES "^tardis-[a-z][0-9][0-9]$")
     SET (IS_TARDIS ON)
-  ENDIF ("${UNAME_OV}" MATCHES "tardis")
-
+  ENDIF ("${HOSTNAME}" MATCHES "^tardis-[a-z][0-9][0-9]$")
 ENDIF (UNIX)
-
-MARK_AS_ADVANCED(IS_TARDIS)
+MARK_AS_ADVANCED(HOSTNAME IS_TARDIS)
 
 IF (IS_TARDIS)
@@ -48,4 +28,2 @@
   SET(ENV{OGREDIR} "/usr/pack/ogre-1.4.5-sd;/usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1")
 ENDIF (IS_TARDIS)
-
-MARK_AS_ADVANCED(UNAME_CMD IS_TARDIS)
Index: code/branches/buildsystem2/cmake/FindCEGUI.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindCEGUI.cmake	(revision 2509)
+++ code/branches/buildsystem2/cmake/FindCEGUI.cmake	(revision 2510)
@@ -29,13 +29,34 @@
 )
 
-#SET(CEGUI_LIBRARIES debug CEGUIBase_d optimized CEGUIBase)
-FIND_LIBRARY(CEGUI_LIBRARY
-    NAMES CEGUIBase
-    PATHS
-    $ENV{CEGUIDIR}
-    /usr/local
-    /usr
-    PATH_SUFFIXES lib
-)
+IF(WIN32)
+    FIND_LIBRARY(CEGUI_LIBRARY_
+        NAMES CEGUIBase
+        PATHS
+        $ENV{CEGUIDIR}
+        PATH_SUFFIXES lib
+    )
+    FIND_LIBRARY(CEGUI_LIBRARY_d
+        NAMES CEGUIBase_d
+        PATHS
+        $ENV{CEGUIDIR}
+        PATH_SUFFIXES lib
+    )
+    IF(CEGUI_LIBRARY_)
+        IF(CEGUI_LIBRARY_d)
+            SET(CEGUI_LIBRARY optimized ${CEGUI_LIBRARY_} debug ${CEGUI_LIBRARY_d})
+        ELSE(CEGUI_LIBRARY_d)
+            SET(CEGUI_LIBRARY ${CEGUI_LIBRARY_})
+        ENDIF(CEGUI_LIBRARY_d)
+    ENDIF(CEGUI_LIBRARY_)
+ELSE(WIN32)
+    FIND_LIBRARY(CEGUI_LIBRARY
+        NAMES CEGUIBase
+        PATHS
+        $ENV{CEGUIDIR}
+        /usr/local
+        /usr
+        PATH_SUFFIXES lib
+    )
+ENDIF(WIN32)
 
 #    IF (NOT CEGUI_SCRIPT_LIBDIR)
@@ -65,4 +86,6 @@
 MARK_AS_ADVANCED(
     CEGUI_LIBRARY
+    CEGUI_LIBRARY_
+    CEGUI_LIBRARY_d
     CEGUI_INCLUDE_DIR
     #CEGUI_SCRIPT_LIBRARIES
Index: code/branches/buildsystem2/cmake/FindDirectX.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindDirectX.cmake	(revision 2509)
+++ code/branches/buildsystem2/cmake/FindDirectX.cmake	(revision 2510)
@@ -9,41 +9,20 @@
   #                 > www.orxonox.net <
 
-  IF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
-    SET(DirectX_FIND_QUIETLY TRUE)
-  ENDIF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
-
-  set(DirectX_FOUND "NO")
-
-  FIND_PATH(DirectX_INCLUDE_DIR "dinput.h"
-    ../libs/DXSDK/Include
-    $ENV{DXSDK_DIR}/Include
+  FIND_PATH(DirectX_INCLUDE_DIR dinput.h
+    PATHS
+    $ENV{DXSDK_DIR}
+    PATH_SUFFIXES include Include
   )
 
-  FIND_PATH(DirectX_LIB_DIR "dinput8.lib"
-    ../libs/DXSDK/Lib
-    ../libs/DXSDK/Lib/x86
-    $ENV{DXSDK_DIR}/lib/x86
+  FIND_PATH(DirectX_LIB_DIR dinput8.lib
+    PATHS
+    $ENV{DXSDK_DIR}
+    PATH_SUFFIXES lib Lib lib/x86 Lib/x86
   )
 
-  IF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
-    SET (DirectX_FOUND "YES")
-  ENDIF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
+  INCLUDE(FindPackageHandleStandardArgs)
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectX DEFAULT_MSG DirectX_INCLUDE_DIR DirectX_LIB_DIR)
 
-  IF (DirectX_FOUND)
-    IF (NOT DirectX_FIND_QUIETLY)
-      MESSAGE(STATUS "DirectX was found.")
-      IF (VERBOSE_FIND)
-        MESSAGE (STATUS "  include path: ${DirectX_INCLUDE_DIR}")
-        MESSAGE (STATUS "  library path: ${DirectX_LIB_DIR}")
-        MESSAGE (STATUS "  libraries:    dinput8.lib")
-      ENDIF (VERBOSE_FIND)
-    ENDIF (NOT DirectX_FIND_QUIETLY)
-  ELSE (DirectX_FOUND)
-    IF (NOT DirectX_INCLUDE_DIR)
-      MESSAGE(SEND_ERROR "DirectX include path was not found.")
-    ENDIF (NOT DirectX_INCLUDE_DIR)
-    IF (NOT DirectX_LIB_DIR)
-      MESSAGE(SEND_ERROR "DirectX library was not found.")
-    ENDIF (NOT DirectX_LIB_DIR)
-  ENDIF (DirectX_FOUND)
 ENDIF(WIN32)
+
+MARK_AS_ADVANCED(DirectX_INCLUDE_DIR DirectX_LIB_DIR)
Index: code/branches/buildsystem2/cmake/FindENet.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindENet.cmake	(revision 2509)
+++ code/branches/buildsystem2/cmake/FindENet.cmake	(revision 2510)
@@ -46,3 +46,3 @@
 ENDIF (ENET_FOUND)
 
-MARK_AS_ADVANCED(ENet_LIBRARY ENet_INCLUDE_DIR)
+MARK_AS_ADVANCED(ENet_LIBRARY ENet_LIBRARIES ENet_INCLUDE_DIR)
Index: code/branches/buildsystem2/cmake/FindOGRE.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindOGRE.cmake	(revision 2509)
+++ code/branches/buildsystem2/cmake/FindOGRE.cmake	(revision 2510)
@@ -23,13 +23,34 @@
 )
 
-#SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
-FIND_LIBRARY(OGRE_LIBRARY
-    NAMES OgreMain
-    PATHS
-    $ENV{OGREDIR}
-    /usr/local
-    /usr
-    PATH_SUFFIXES lib
-)
+IF(WIN32)
+    FIND_LIBRARY(OGRE_LIBRARY_
+        NAMES OgreMain
+        PATHS
+        $ENV{OGREDIR}
+        PATH_SUFFIXES lib
+    )
+    FIND_LIBRARY(OGRE_LIBRARY_d
+        NAMES OgreMain_d
+        PATHS
+        $ENV{OGREDIR}
+        PATH_SUFFIXES lib
+    )
+    IF(OGRE_LIBRARY_)
+        IF(OGRE_LIBRARY_d)
+            SET(OGRE_LIBRARY optimized ${OGRE_LIBRARY_} debug ${OGRE_LIBRARY_d})
+        ELSE(OGRE_LIBRARY_d)
+            SET(OGRE_LIBRARY ${OGRE_LIBRARY_})
+        ENDIF(OGRE_LIBRARY_d)
+    ENDIF(OGRE_LIBRARY_)
+ELSE(WIN32)
+    FIND_LIBRARY(OGRE_LIBRARY
+        NAMES OgreMain
+        PATHS
+        $ENV{OGREDIR}
+        /usr/local
+        /usr
+        PATH_SUFFIXES lib
+    )
+ENDIF(WIN32)
 
 INCLUDE(FindPackageHandleStandardArgs)
@@ -41,4 +62,6 @@
 MARK_AS_ADVANCED(
     OGRE_LIBRARY
+    OGRE_LIBRARY_
+    OGRE_LIBRARY_d
     OGRE_INCLUDE_DIR
 )
Index: code/branches/buildsystem2/cmake/FindOggVorbis.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindOggVorbis.cmake	(revision 2509)
+++ code/branches/buildsystem2/cmake/FindOggVorbis.cmake	(revision 2510)
@@ -73,4 +73,5 @@
   VORBIS_LIBRARY
   VORBISFILE_LIBRARY
+  #VORBISENC_LIBRARY
   VORBIS_INCLUDE_DIR
 )
Index: code/branches/buildsystem2/cmake/UseTolua.cmake
===================================================================
--- code/branches/buildsystem2/cmake/UseTolua.cmake	(revision 2509)
+++ code/branches/buildsystem2/cmake/UseTolua.cmake	(revision 2510)
@@ -18,4 +18,9 @@
 SET(_tolua_executable_name toluaexe_orxonox)
 GET_TARGET_PROPERTY(TOLUA_EXECUTABLE "${_tolua_executable_name}" LOCATION)
+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)
@@ -45,5 +50,5 @@
     DEPENDS "${_tolua_executable_name}" ${TOLUA_PARSER_DEPENDENCIES}
     IMPLICIT_DEPENDS CXX ${_tolua_inputfiles}
-    WORKING_DIRECTORY "${LIBRARY_OUTPUT_PATH}"
+    ${_tolua_command_wd}
   )
 ENDMACRO(TOLUA)
Index: code/branches/buildsystem2/src/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/CMakeLists.txt	(revision 2510)
@@ -33,5 +33,5 @@
 ADD_SUBDIRECTORY(tolua)
 
-# TODO: write include file for this stuff
+# TODO: FIXME
 # Some people may not have CEGUILua installed, espc. with version 0.5
 # And we don't know what lua version it was linked against, so we compile
@@ -41,13 +41,13 @@
 IF (WIN32)
     ADD_SUBDIRECTORY(ceguilua-0.6.1/ceguilua)
-    INCLUDE_DIRECTORIES(ceguilua-0.6.1)
+    INCLUDE_DIRECTORIES(ceguilua-0.6.1/ceguilua)
 ELSE (WIN32)
     # FIXME
     #IF (${CEGUI_VERSION} LESS 0.6.0)
         ADD_SUBDIRECTORY(ceguilua-0.5.0/ceguilua)
-        INCLUDE_DIRECTORIES(ceguilua-0.5.0)
+        INCLUDE_DIRECTORIES(ceguilua-0.5.0/ceguilua)
     #ELSE (${CEGUI_VERSION} LESS 0.6.0)
     #    ADD_SUBDIRECTORY(ceguilua-0.6.1/ceguilua)
-    #    INCLUDE_DIRECTORIES(ceguilua-0.6.1)
+    #    INCLUDE_DIRECTORIES(ceguilua-0.6.1/ceguilua)
     #ENDIF (${CEGUI_VERSION} LESS 0.6.0)
 ENDIF (WIN32)
Index: code/branches/buildsystem2/src/audio/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/audio/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/audio/CMakeLists.txt	(revision 2510)
@@ -21,3 +21,3 @@
 )
 
-
+INSTALL(TARGETS audio LIBRARY DESTINATION lib)
Index: code/branches/buildsystem2/src/ceguilua-0.5.0/ceguilua/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/ceguilua-0.5.0/ceguilua/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/ceguilua-0.5.0/ceguilua/CMakeLists.txt	(revision 2510)
@@ -13,2 +13,4 @@
   ${CEGUI_LIBRARY}
 )
+
+INSTALL(TARGETS ceguilua_orxonox LIBRARY DESTINATION lib)
Index: code/branches/buildsystem2/src/ceguilua-0.6.1/ceguilua/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/ceguilua-0.6.1/ceguilua/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/ceguilua-0.6.1/ceguilua/CMakeLists.txt	(revision 2510)
@@ -13,2 +13,4 @@
   ${CEGUI_LIBRARY}
 )
+
+INSTALL(TARGETS ceguilua_orxonox LIBRARY DESTINATION lib)
Index: code/branches/buildsystem2/src/core/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/core/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/core/CMakeLists.txt	(revision 2510)
@@ -62,2 +62,4 @@
   util
 )
+
+INSTALL(TARGETS core LIBRARY DESTINATION lib)
Index: code/branches/buildsystem2/src/cpptcl/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/cpptcl/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/cpptcl/CMakeLists.txt	(revision 2510)
@@ -4,2 +4,4 @@
   ${TCL_LIBRARY}
 )
+
+INSTALL(TARGETS cpptcl_orxonox LIBRARY DESTINATION lib)
Index: code/branches/buildsystem2/src/network/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/network/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/network/CMakeLists.txt	(revision 2510)
@@ -30,4 +30,5 @@
 )
 
+INSTALL(TARGETS network LIBRARY DESTINATION lib)
 
 # build those parts only on request.
Index: code/branches/buildsystem2/src/ois/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/ois/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/ois/CMakeLists.txt	(revision 2510)
@@ -46,2 +46,3 @@
 ENDIF(WIN32)
 
+INSTALL(TARGETS ois_orxonox LIBRARY DESTINATION lib)
Index: code/branches/buildsystem2/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/orxonox/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/orxonox/CMakeLists.txt	(revision 2510)
@@ -44,2 +44,4 @@
   network
 )
+
+INSTALL(TARGETS orxonox RUNTIME DESTINATION bin)
Index: code/branches/buildsystem2/src/tinyxml/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/tinyxml/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/tinyxml/CMakeLists.txt	(revision 2510)
@@ -8,2 +8,3 @@
 
 ADD_LIBRARY(tinyxml_orxonox SHARED ${TINYXML_SRC_FILES})
+INSTALL(TARGETS tinyxml_orxonox LIBRARY DESTINATION lib)
Index: code/branches/buildsystem2/src/tolua/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/tolua/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/tolua/CMakeLists.txt	(revision 2510)
@@ -1,3 +1,3 @@
-SET(TOLUALIB_SRC_FILES
+ADD_LIBRARY(tolualib_orxonox STATIC
   tolua_event.c
   tolua_is.c
@@ -7,7 +7,7 @@
 )
 
-ADD_LIBRARY          (tolualib_orxonox SHARED ${TOLUALIB_SRC_FILES})
 TARGET_LINK_LIBRARIES(tolualib_orxonox ${LUA_LIBRARIES})
 
+#INSTALL(TARGETS tolualib_orxonox LIBRARY DESTINATION lib)
 
 SET(TOLUAGEN_SRC_FILES
@@ -15,9 +15,16 @@
 )
 
-ADD_EXECUTABLE       (toluaexe_orxonox ${TOLUAGEN_SRC_FILES})
+ADD_EXECUTABLE(toluaexe_orxonox ${TOLUAGEN_SRC_FILES})
 TARGET_LINK_LIBRARIES(toluaexe_orxonox tolualib_orxonox ${LUA_LIBRARIES})
 
-# TODO: determine lua version and set appropriate pack file
-SET(TOLUA_ALL_PACK all-5.1.lua)
+#IF("${LUA_VERSION}" VERSION_LESS 5.1)
+IF("${LUA_VERSION}" MATCHES "^5.0")
+  SET(TOLUA_ALL_PACK all-5.0.lua)
+#ELSE("${LUA_VERSION}" VERSION_LESS 5.1)
+ELSE("${LUA_VERSION}" MATCHES "^5.0")
+  SET(TOLUA_ALL_PACK all-5.1.lua)
+#ENDIF("${LUA_VERSION}" VERSION_LESS 5.1)
+ENDIF("${LUA_VERSION}" MATCHES "^5.0")
+
 SET(TOLUA_PARSER_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${TOLUA_ALL_PACK}" PARENT_SCOPE)
 SET(TOLUA_PARSER_DEPENDENCIES
Index: code/branches/buildsystem2/src/util/CMakeLists.txt
===================================================================
--- code/branches/buildsystem2/src/util/CMakeLists.txt	(revision 2509)
+++ code/branches/buildsystem2/src/util/CMakeLists.txt	(revision 2510)
@@ -15,4 +15,5 @@
 ADD_LIBRARY(util SHARED ${UTIL_SRC_FILES})
 TARGET_LINK_LIBRARIES(util ${OGRE_LIBRARY})
+INSTALL(TARGETS util LIBRARY DESTINATION lib)
 
 )
Index: code/branches/buildsystem2/updateMedia.sh
===================================================================
--- code/branches/buildsystem2/updateMedia.sh	(revision 2509)
+++ 	(revision )
@@ -1,5 +1,0 @@
-#!/bin/bash
-dir=${pwd}
-cd ../media
-svn up
-cd $dir
Index: code/branches/buildsystem2/update_media
===================================================================
--- code/branches/buildsystem2/update_media	(revision 2510)
+++ code/branches/buildsystem2/update_media	(revision 2510)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# convenience script for updating media repository
+
+cd ../media && svn up
