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)
