Index: code/branches/buildsystem2/cmake/CheckOrxonoxWinDeps.cmake
===================================================================
--- code/branches/buildsystem2/cmake/CheckOrxonoxWinDeps.cmake	(revision 2509)
+++ code/branches/buildsystem2/cmake/CheckOrxonoxWinDeps.cmake	(revision 2509)
@@ -0,0 +1,47 @@
+ #
+ #   ORXONOX - the hottest 3D action shooter ever to exist
+ #                    > www.orxonox.net <
+ #
+ #
+ #   License notice:
+ #
+ #   This program is free software; you can redistribute it and/or
+ #   modify it under the terms of the GNU General Public License
+ #   as published by the Free Software Foundation; either version 2
+ #   of the License, or (at your option) any later version.
+ #
+ #   This program is distributed in the hope that it will be useful,
+ #   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ #   GNU General Public License for more details.
+ #
+ #   You should have received a copy of the GNU General Public License
+ #   along with this program; if not, write to the Free Software
+ #   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ #
+ #   Author:
+ #      ...
+ #   Co-authors:
+ #      ...
+ #
+ 
+################# Win check ##################
+# Set the library directory when using precompiled tarballs for
+# the dependencies under windows
+###########################################
+
+IF (MINGW)
+  MESSAGE(STATUS "Running on MinGW. Using customized paths.")
+  SET(MINGW_LIBRARY_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")
+ENDIF (MINGW)
Index: code/branches/buildsystem2/cmake/CheckTardis.cmake
===================================================================
--- code/branches/buildsystem2/cmake/CheckTardis.cmake	(revision 2507)
+++ code/branches/buildsystem2/cmake/CheckTardis.cmake	(revision 2509)
@@ -6,5 +6,4 @@
 # only run this test on a lunix/unix machine
 IF (UNIX)
-
   FIND_PROGRAM(UNAME_CMD "uname"
   PATHS "/usr/bin /bin")
@@ -30,2 +29,23 @@
 
 ENDIF (UNIX)
+
+MARK_AS_ADVANCED(IS_TARDIS)
+
+IF (IS_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")
+  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")
+  SET(ENV{LUA_DIR} "/usr/pack/lua-5.0.3-sd;/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1")
+  SET(ENV{ALUTDIR} "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
+  SET(ENV{OPENALDIR} "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
+  SET(ENV{ENETDIR} "/usr/pack/enet-2007-sd;/usr/pack/enet-2007-sd/i686-debian-linux3.1")
+  SET(ENV{OGGVORBISDIR} "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
+  #SET(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")
+  SET(ENV{CEGUIDIR} "/usr/pack/cegui-0.5.0-sd;/usr/pack/cegui-0.5.0-sd/i686-debian-linux3.1")
+  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/FindALUT.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindALUT.cmake	(revision 2507)
+++ code/branches/buildsystem2/cmake/FindALUT.cmake	(revision 2509)
@@ -18,36 +18,20 @@
 #
 # Several changes and additions by Fabian 'x3n' Landau
+# Some simplifications by Adrian Friedli
 #                 > www.orxonox.net <
 
-IF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
-  SET (ALUT_FIND_QUIETLY TRUE)
-ENDIF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
-
 FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
-  $ENV{ALUTDIR}/include
-  ~/Library/Frameworks/OpenAL.framework/Headers
-  /Library/Frameworks/OpenAL.framework/Headers
-  /System/Library/Frameworks/OpenAL.framework/Headers # Tiger
-  /usr/pack/openal-0.0.8-cl/include # Tardis specific hack
-  /usr/local/include/
-  /usr/local/include/OpenAL
-  /usr/local/include
-  /usr/include/
-  /usr/include/OpenAL
-  /usr/include
-  /sw/include/ # Fink
-  /sw/include/OpenAL
-  /sw/include
-  /opt/local/include/AL # DarwinPorts
-  /opt/local/include/OpenAL
-  /opt/local/include
-  /opt/csw/include/ # Blastwave
-  /opt/csw/include/OpenAL
-  /opt/csw/include
-  /opt/include/
-  /opt/include/OpenAL
-  /opt/include
-  ../libs/freealut-1.1.0/include
-  ${DEPENDENCY_DIR}/freealut-1.1.0/include
+  PATHS
+  $ENV{ALUTDIR}
+  ~/Library/Frameworks/OpenAL.framework
+  /Library/Frameworks/OpenAL.framework
+  /System/Library/Frameworks/OpenAL.framework # Tiger
+  /usr/local
+  /usr
+  /sw # Fink
+  /opt/local # DarwinPorts
+  /opt/csw # Blastwave
+  /opt
+  PATH_SUFFIXES include include/OpenAL include/AL Headers
   )
 
@@ -78,38 +62,19 @@
     NAMES alut
     PATHS
-    $ENV{ALUTDIR}/lib
-    $ENV{ALUTDIR}/libs
-    /usr/pack/openal-0.0.8-cl/i686-debian-linux3.1/lib
-    /usr/local/lib
-    /usr/lib
-    /sw/lib
-    /opt/local/lib
-    /opt/csw/lib
-    /opt/lib
-    ../libs/freealut-1.1.0/src/.libs
-    ../libs/freealut-1.1.0/lib
-    ${DEPENDENCY_DIR}/freealut-1.1.0/lib
+    $ENV{ALUTDIR}
+    /usr/local
+    /usr
+    /sw
+    /opt/local
+    /opt/csw
+    /opt
+    PATH_SUFFIXES lib libs
     )
 ENDIF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
 
-SET (ALUT_FOUND "NO")
-IF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
-  SET (ALUT_FOUND "YES")
-  IF (NOT ALUT_FIND_QUIETLY)
-    MESSAGE (STATUS "FreeAlut was found.")
-    IF (VERBOSE_FIND)
-      MESSAGE (STATUS "  include path: ${ALUT_INCLUDE_DIR}")
-      MESSAGE (STATUS "  library path: ${ALUT_LIBRARY}")
-      MESSAGE (STATUS "  libraries:    alut")
-    ENDIF (VERBOSE_FIND)
-  ENDIF (NOT ALUT_FIND_QUIETLY)
-ELSE (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
-  IF (NOT ALUT_INCLUDE_DIR)
-    MESSAGE (SEND_ERROR "FreeAlut include path was not found.")
-  ENDIF (NOT ALUT_INCLUDE_DIR)
-  IF (NOT ALUT_LIBRARY)
-    MESSAGE (SEND_ERROR "FreeAlut library was not found.")
-  ENDIF (NOT ALUT_LIBRARY)
-ENDIF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
+# handle the QUIETLY and REQUIRED arguments and set ALUT_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG ALUT_LIBRARY ALUT_INCLUDE_DIR)
 
-
+MARK_AS_ADVANCED(ALUT_LIBRARY ALUT_INCLUDE_DIR)
Index: code/branches/buildsystem2/cmake/FindBoost.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindBoost.cmake	(revision 2507)
+++ 	(revision )
@@ -1,316 +1,0 @@
-# THIS FILE HAS BEEN MODIFIED TO WORK ON THE TARDIS INFRASTURUCTURE of THE ETH.
-# use with caution
-# Nicolas Schlumberger <nico AT orxonx DOT net> (C) 2007
-#
-# Several changes and additions by Fabian 'x3n' Landau
-#                 > www.orxonox.net <
-#
-# - Find the Boost includes and libraries.
-# The following variables are set if Boost is found.  If Boost is not
-# found, Boost_FOUND is set to false.
-#  Boost_FOUND                  - True when the Boost include directory is found.
-#  Boost_INCLUDE_DIRS           - the path to where the boost include files are.
-#  Boost_LIBRARY_DIRS           - The path to where the boost library files are.
-#  Boost_LIB_DIAGNOSTIC_DEFINITIONS - Only set if using Windows.
-#  Boost_<library>_FOUND        - True if the Boost <library> is found.
-#  Boost_<library>_INCLUDE_DIRS - The include path for Boost <library>.
-#  Boost_<library>_LIBRARIES    - The libraries to link to to use Boost <library>.
-#  Boost_LIBRARIES              - The libraries to link to to use all Boost libraries.
-#
-# The following variables can be set to configure how Boost is found:
-#  Boost_LIB_PREFIX             - Look for Boost libraries prefixed with this, e.g. "lib"
-#  Boost_LIB_SUFFIX             - Look for Boost libraries ending with this, e.g. "vc80-mt"
-#  Boost_LIB_SUFFIX_DEBUG       - As for Boost_LIB_SUFFIX but for debug builds, e.g. "vs80-mt-gd"
-
-# ----------------------------------------------------------------------------
-# If you have installed Boost in a non-standard location or you have
-# just staged the boost files using bjam then you have three
-# options. In the following comments, it is assumed that <Your Path>
-# points to the root directory of the include directory of Boost. e.g
-# If you have put boost in C:\development\Boost then <Your Path> is
-# "C:/development/Boost" and in this directory there will be two
-# directories called "include" and "lib".
-# 1) After CMake runs, set Boost_INCLUDE_DIR to <Your Path>/include/boost<-version>
-# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/include. This will allow FIND_PATH()
-#    to locate Boost_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g.
-#    SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
-# 3) Set an environment variable called ${BOOST_ROOT} that points to the root of where you have
-#    installed Boost, e.g. <Your Path>. It is assumed that there is at least a subdirectory called
-#    include in this path.
-#
-# Note:
-#  1) If you are just using the boost headers, then you do not need to use
-#     Boost_LIBRARY_DIRS in your CMakeLists.txt file.
-#  2) If Boost has not been installed, then when setting Boost_LIBRARY_DIRS
-#     the script will look for /lib first and, if this fails, then for /stage/lib.
-#
-# Usage:
-# In your CMakeLists.txt file do something like this:
-# ...
-# # Boost
-# FIND_PACKAGE(Boost)
-# ...
-# INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
-# LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
-
-#
-# TODO:
-#
-# 1) Automatically find the Boost library files and eliminate the need
-#    to use Link Directories.
-#
-
-IF (Boost_INCLUDE_DIR)
-  SET (Boost_INCLUDE_FIND_QUIETLY TRUE)
-ENDIF (Boost_INCLUDE_DIR)
-
-IF(WIN32)
-# In windows, automatic linking is performed, so you do not have to specify the libraries.
-# If you are linking to a dynamic runtime, then you can choose to link to either a static or a
-# dynamic Boost library, the default is to do a static link.  You can alter this for a specific
-# library "whatever" by defining BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to
-# be linked dynamically.  Alternatively you can force all Boost libraries to dynamic link by
-# defining BOOST_ALL_DYN_LINK.
-
-# This feature can be disabled for Boost library "whatever" by defining BOOST_WHATEVER_NO_LIB,
-# or for all of Boost by defining BOOST_ALL_NO_LIB.
-
-# If you want to observe which libraries are being linked against then defining
-# BOOST_LIB_DIAGNOSTIC will cause the auto-linking code to emit a #pragma message each time
-# a library is selected for linking.
-#  SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
-#  SET(Boost_LIB_PREFIX "lib")
-#  SET(Boost_LIB_SUFFIX "gcc-mt-1_33_1.lib")
-ENDIF(WIN32)
-
-
-SET(BOOST_INCLUDE_PATH_DESCRIPTION "directory containing the boost include files.")
-
-SET(BOOST_DIR_MESSAGE "Set the Boost_INCLUDE_DIR cmake cache entry to the ${BOOST_INCLUDE_PATH_DESCRIPTION}")
-
-SET(BOOST_DIR_SEARCH $ENV{BOOST_ROOT})
-IF(BOOST_DIR_SEARCH)
-  FILE(TO_CMAKE_PATH ${BOOST_DIR_SEARCH} BOOST_DIR_SEARCH)
-  SET(BOOST_DIR_SEARCH ${BOOST_DIR_SEARCH}/include)
-ENDIF(BOOST_DIR_SEARCH)
-
-# Add in some path suffixes. These will have to be updated whenever a new Boost version comes out.
-SET(SUFFIX_FOR_PATH
- boost
- boost-1_35_0
- boost-1_35
- boost-1_34_1
- boost-1_34_0
- boost-1_34
- boost-1_33_1
- boost-1_33_0
-)
-
-#
-# Look for an installation.
-#
-FIND_PATH(Boost_INCLUDE_DIR NAMES boost/config.hpp PATH_SUFFIXES ${SUFFIX_FOR_PATH} PATHS
-
-# Look in other places.
-  ${BOOST_DIR_SEARCH}
-
-#    ../libs/boost_1_33_1
-    ../libs/boost_1_34_1
-#    ../libs/boost-1_35_0
-    ${DEPENDENCY_DIR}/boost-1.35.0/include
-
-# Help the user find it if we cannot.
-  DOC "The ${BOOST_INCLUDE_PATH_DESCRIPTION}"
-)
-
-# Assume we didn't find it.
-SET(Boost_FOUND 0)
-
-# Now try to get the include and library path.
-IF(Boost_INCLUDE_DIR)
-
-# Look for the boost library path.
-# Note that the user may not have installed any libraries
-# so it is quite possible the Boost_LIBRARY_PATH may not exist.
-  SET(Boost_LIBRARY_DIR ${Boost_INCLUDE_DIR})
-
-  IF("${Boost_LIBRARY_DIR}" MATCHES "boost-[0-9]+")
-    GET_FILENAME_COMPONENT(Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR} PATH)
-  ENDIF ("${Boost_LIBRARY_DIR}" MATCHES "boost-[0-9]+")
-
-  IF("${Boost_LIBRARY_DIR}" MATCHES "/include$")
-# Strip off the trailing "/include" in the path.
-    GET_FILENAME_COMPONENT(Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR} PATH)
-  ENDIF("${Boost_LIBRARY_DIR}" MATCHES "/include$")
-
-  IF(EXISTS "${Boost_LIBRARY_DIR}/lib")
-    SET (Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR}/lib)
-  ELSEIF(EXISTS "${Boost_LIBRARY_DIR}/bin/boost/libs/thread/build/boost_thread.dll/gcc/release/threading-multi")
-    SET (Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR}/bin/boost/libs/thread/build/boost_thread.dll/gcc/release/threading-multi)
-  ELSE(EXISTS "${Boost_LIBRARY_DIR}/lib")
-    IF(EXISTS "${Boost_LIBRARY_DIR}/stage/lib")
-      SET(Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR}/stage/lib)
-    ELSE(EXISTS "${Boost_LIBRARY_DIR}/stage/lib")
-      IF(EXISTS "${Boost_LIBRARY_DIR}/../../lib")
-        SET(Boost_LIBRARY_DIR "${Boost_LIBRARY_DIR}/../../lib")
-      ELSE(EXISTS "${Boost_LIBRARY_DIR}/../../lib")
-        SET(Boost_LIBRARY_DIR "")
-      ENDIF(EXISTS "${Boost_LIBRARY_DIR}/../../lib")
-    ENDIF(EXISTS "${Boost_LIBRARY_DIR}/stage/lib")
-  ENDIF(EXISTS "${Boost_LIBRARY_DIR}/lib")
-
-
-  IF(EXISTS "${Boost_INCLUDE_DIR}")
-    SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
-# We have found boost. It is possible that the user has not
-# compiled any libraries so we set Boost_FOUND to be true here.
-    SET(Boost_FOUND 1)
-    MARK_AS_ADVANCED(Boost_INCLUDE_DIR)
-  ENDIF(EXISTS "${Boost_INCLUDE_DIR}")
-  IF(Boost_LIBRARY_DIR AND EXISTS "${Boost_LIBRARY_DIR}")
-    SET(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR})
-  ENDIF(Boost_LIBRARY_DIR AND EXISTS "${Boost_LIBRARY_DIR}")
-ENDIF(Boost_INCLUDE_DIR)
-
-
-#
-# Find boost libraries
-#
-
-# List of library suffixes to search, e.g. libboost_date_time-gcc
-SET(BOOST_SUFFIX_SEARCH
-  mt
-  gcc41-mt
-  gcc
-  il
-  gcc-1_33_1
-  gcc-mt-1_33_1
-  mgw34-mt-1_34_1
-  mgw34-mt-1_35
-  vc80-mt-1_35
-  vc80-mt-gd-1_35
-)
-
-# List of all boost libraries
-SET(BOOST_ALL_LIBRARIES
-  date_time
-  filesystem
-  graph
-  iostreams
-  program_options
-  regex
-  serialization
-  signals
-  unit_test_framework
-  thread
-  wave
-)
-
-# Macro to find boost library called name
-MACRO(BOOST_FIND_LIBRARY name)
-
-# User can specify a particular build variant via the variables:
-#   Boost_LIB_PREFIX, Boost_LIB_SUFFIX, Boost_LIB_SUFFIX_DEBUG
-# otherwise we'll search the BOOST_SUFFIX_SEARCH list
-
-  SET(BOOST_LIB_NAMES ${Boost_LIB_PREFIX}boost_${name}-${Boost_LIB_SUFFIX})
-  IF(NOT Boost_LIB_SUFFIX)
-    FOREACH(suffix ${BOOST_SUFFIX_SEARCH})
-      SET(BOOST_LIB_NAMES ${BOOST_LIB_NAMES} ${Boost_LIB_PREFIX}boost_${name}-${suffix})
-    ENDFOREACH(suffix)
-  ENDIF(NOT Boost_LIB_SUFFIX)
-
-# Find the library in the Boost_LIBRARY_DIRS
-  FIND_LIBRARY(Boost_${name}_LIBRARY
-    NAMES ${BOOST_LIB_NAMES}
-    PATHS ${Boost_LIBRARY_DIRS})
-
-# For MSVC builds find debug library
-  IF(WIN32 AND MSVC AND Boost_${name}_LIBRARY)
-    FIND_LIBRARY(Boost_${name}_LIBRARY_DEBUG
-      NAMES ${Boost_LIB_PREFIX}boost_${name}-${Boost_LIB_SUFFIX_DEBUG}
-      PATHS ${Boost_LIBRARY_DIRS})
-
-    IF(MSVC_IDE)
-      IF(Boost_${name}_LIBRARY AND Boost_${name}_LIBRARY_DEBUG)
-        SET(Boost_${name}_LIBRARIES debug ${Boost_${name}_LIBRARY_DEBUG} optimized ${Boost_${name}_LIBRARY})
-      ELSE(Boost_${name}_LIBRARY AND Boost_${name}_LIBRARY_DEBUG)
-        MESSAGE(FATAL_ERROR "Could not find the debug and release version of Boost ${name} library.")
-      ENDIF(Boost_${name}_LIBRARY AND Boost_${name}_LIBRARY_DEBUG)
-    ELSE(MSVC_IDE)
-      STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
-      IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
-        SET(Boost_${name}_LIBRARIES ${Boost_${name}_LIBRARY_DEBUG})
-      ELSE(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
-        SET(Boost_${name}_LIBRARIES ${Boost_${name}_LIBRARY})
-      ENDIF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
-    ENDIF(MSVC_IDE)
-  ELSE(WIN32 AND MSVC AND Boost_${name}_LIBRARY)
-    SET(Boost_${name}_LIBRARIES ${Boost_${name}_LIBRARY})
-  ENDIF(WIN32 AND MSVC AND Boost_${name}_LIBRARY)
-
-# If we've got it setup appropriate variables or issue error message
-  IF(Boost_${name}_LIBRARY)
-    SET(Boost_${name}_FOUND 1)
-    SET(Boost_${name}_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
-    MARK_AS_ADVANCED(Boost_${name}_LIBRARY Boost_${name}_LIBRARY_DEBUG)
-  ELSE(Boost_${name}_LIBRARY)
-    IF(NOT Boost_FIND_QUIETLY)
-      MESSAGE(SEND_ERROR "Boost ${name} library was not found.")
-    ELSE(NOT Boost_FIND_QUIETLY)
-      IF(Boost_FIND_REQUIRED_${name})
-        MESSAGE(FATAL_ERROR "Could NOT find required Boost ${name} library.")
-      ENDIF(Boost_FIND_REQUIRED_${name})
-    ENDIF(NOT Boost_FIND_QUIETLY)
-  ENDIF(Boost_${name}_LIBRARY)
-ENDMACRO(BOOST_FIND_LIBRARY)
-
-IF(Boost_LIBRARY_DIRS)
-
-# If the user specified required components e.g. via
-# FIND_PACKAGE(Boost REQUIRED date_time regex)
-# find (just) those libraries. Otherwise find all libraries.
-  IF(Boost_FIND_COMPONENTS)
-    SET(Boost_FIND_LIBRARIES ${Boost_FIND_COMPONENTS})
-  ELSE(Boost_FIND_COMPONENTS)
-    SET(Boost_FIND_LIBRARIES ${BOOST_ALL_LIBRARIES})
-  ENDIF(Boost_FIND_COMPONENTS)
-
-  SET(Boost_LIBRARIES)
-  FOREACH(library ${Boost_FIND_LIBRARIES})
-    IF (Boost_${library}_LIBRARY)
-      SET (Boost_${name}_LIBRARY_FIND_QUIETLY TRUE)
-    ENDIF (Boost_${library}_LIBRARY)
-
-    BOOST_FIND_LIBRARY(${library})
-    IF(Boost_${library}_FOUND)
-      SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${library}_LIBRARIES})
-      IF (NOT Boost_${name}_LIBRARY_FIND_QUIETLY)
-        MESSAGE(STATUS "Found BoostLibrary: ${library}")
-        IF (VERBOSE_FIND)
-          MESSAGE (STATUS "  library path: ${Boost_${library}_LIBRARIES}")
-        ENDIF (VERBOSE_FIND)
-      ENDIF (NOT Boost_${name}_LIBRARY_FIND_QUIETLY)
-    ENDIF(Boost_${library}_FOUND)
-  ENDFOREACH(library)
-ELSE(Boost_LIBRARY_DIRS)
-  MESSAGE(SEND_ERROR "Boost libraries not found: ${Boost_FIND_COMPONENTS}")
-ENDIF(Boost_LIBRARY_DIRS)
-
-IF(NOT Boost_FOUND)
-  IF(NOT Boost_FIND_QUIETLY)
-    MESSAGE(SEND_ERROR "Boost was not found. ${BOOST_DIR_MESSAGE}")
-  ELSE(NOT Boost_FIND_QUIETLY)
-    IF(Boost_FIND_REQUIRED)
-      MESSAGE(SEND_ERROR "Boost was not found. ${BOOST_DIR_MESSAGE}")
-    ENDIF(Boost_FIND_REQUIRED)
-  ENDIF(NOT Boost_FIND_QUIETLY)
-ELSE(NOT Boost_FOUND)
-  IF (NOT Boost_INCLUDE_FIND_QUIETLY)
-    MESSAGE(STATUS "Boost include path was found.")
-    IF (VERBOSE_FIND)
-      MESSAGE (STATUS "  include path: ${Boost_INCLUDE_DIR}")
-    ENDIF (VERBOSE_FIND)
-  ENDIF (NOT Boost_INCLUDE_FIND_QUIETLY)
-ENDIF(NOT Boost_FOUND)
-
Index: code/branches/buildsystem2/cmake/FindCEGUI.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindCEGUI.cmake	(revision 2507)
+++ code/branches/buildsystem2/cmake/FindCEGUI.cmake	(revision 2509)
@@ -3,6 +3,5 @@
 # This module defines
 #  CEGUI_INCLUDE_DIR
-#  CEGUI_LIBRARIES, the libraries to link against to use CEGUI.
-#  CEGUI_LIB_DIR, the location of the libraries
+#  CEGUI_LIBRARY, the library to link against to use CEGUI.
 #  CEGUI_FOUND, If false, do not try to use CEGUI
 #
@@ -17,27 +16,26 @@
 #
 # Several changes and additions by Fabian 'x3n' Landau
+# Lots of simplifications by Adrian Friedli
 #                 > www.orxonox.net <
 
-IF (CEGUI_LIBRARIES AND CEGUI_INCLUDE_DIR AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
-    SET(CEGUI_FIND_QUIETLY TRUE) # Already in cache, be silent
-ENDIF (CEGUI_LIBRARIES AND CEGUI_INCLUDE_DIR AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
+# TODO: Determine CEGUI version
 
-IF (WIN32) #Windows
-    FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
-        ../libs/cegui-0.6.1/include
-        ${DEPENDENCY_DIR}/cegui-0.6.1/include
-    )
+FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
+    PATHS
+    $ENV{CEGUIDIR}
+    /usr/local
+    /usr
+    PATH_SUFFIXES include include/CEGUI
+)
 
-    SET(CEGUI_LIBRARIES debug CEGUIBase_d optimized CEGUIBase)
-    FIND_LIBRARY(CEGUI_LIBDIR NAMES ${CEGUI_LIBRARIES} PATHS
-        ../libs/cegui-0.6.1/bin
-        ${DEPENDENCY_DIR}/cegui-0.6.1/lib
-    )
-
-    # Strip the filename from the path
-    IF (CEGUI_LIBDIR)
-        GET_FILENAME_COMPONENT(CEGUI_LIBDIR ${CEGUI_LIBDIR} PATH)
-        SET (CEGUI_LIB_DIR ${CEGUI_LIBDIR} CACHE FILEPATH "")
-    ENDIF (CEGUI_LIBDIR)
+#SET(CEGUI_LIBRARIES debug CEGUIBase_d optimized CEGUIBase)
+FIND_LIBRARY(CEGUI_LIBRARY
+    NAMES CEGUIBase
+    PATHS
+    $ENV{CEGUIDIR}
+    /usr/local
+    /usr
+    PATH_SUFFIXES lib
+)
 
 #    IF (NOT CEGUI_SCRIPT_LIBDIR)
@@ -58,56 +56,14 @@
 #    ENDIF (NOT CEGUI_SCRIPT_LIBDIR)
 
-#    # Strip the filename from the path
-#    IF (CEGUI_SCRIPT_LIBDIR)
-#        GET_FILENAME_COMPONENT(CEGUI_SCRIPT_LIBDIR ${CEGUI_SCRIPT_LIBDIR} PATH)
-#        SET (CEGUI_SCRIPT_LIB_DIR ${CEGUI_SCRIPT_LIBDIR} CACHE FILEPATH "")
-#    ENDIF (CEGUI_SCRIPT_LIBDIR)
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUI DEFAULT_MSG
+    CEGUI_LIBRARY
+    CEGUI_INCLUDE_DIR
+    #CEGUI_SCRIPT_LIBRARIES
+)
 
-ELSE (WIN32) #Unix
-    FIND_PACKAGE(PkgConfig)
-    PKG_SEARCH_MODULE(CEGUI CEGUI /usr/pack/cegui-0.5.0-sd/i686-debian-linux3.1/lib/pkgconfig/CEGUI.pc) # tardis specific hack
-    SET(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIRS})
-    SET(CEGUI_LIB_DIR ${CEGUI_LIBDIR})
-    SET(CEGUI_LIBRARIES ${CEGUI_LIBRARIES} CACHE STRING "")
-#    SET(CEGUI_SCRIPT_LIBRARIES "CEGUILuaScriptModule")
-#    SET(CEGUI_SCRIPT_LIB_DIR)
-ENDIF (WIN32)
-
-IF (CEGUI_INCLUDE_DIR AND CEGUI_LIBRARIES AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
-    SET(CEGUI_FOUND TRUE)
-
-    #Do some preparation
-    SEPARATE_ARGUMENTS(CEGUI_INCLUDE_DIR)
-    SEPARATE_ARGUMENTS(CEGUI_LIBRARIES)
-
-    SET(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIR} CACHE PATH "")
-    SET(CEGUI_LIBRARIES ${CEGUI_LIBRARIES} CACHE STRING "")
-    SET(CEGUI_LIB_DIR ${CEGUI_LIB_DIR} CACHE PATH "")
-#    SET(CEGUI_SCRIPT_LIBRARIES ${CEGUI_SCRIPT_LIBRARIES} CACHE PATH "")
-ENDIF (CEGUI_INCLUDE_DIR AND CEGUI_LIBRARIES AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
-
-IF (CEGUI_FOUND)
-    IF (NOT CEGUI_FIND_QUIETLY)
-        MESSAGE(STATUS "CEGUI was found.")
-        IF (VERBOSE_FIND)
-            MESSAGE (STATUS "  include path: ${CEGUI_INCLUDE_DIR}")
-            MESSAGE (STATUS "  library path: ${CEGUI_LIB_DIR}")
-            MESSAGE (STATUS "  libraries:    ${CEGUI_LIBRARIES}")
-#            MESSAGE (STATUS "           :    ${CEGUI_SCRIPT_LIBRARIES}")
-        ENDIF (VERBOSE_FIND)
-    ENDIF (NOT CEGUI_FIND_QUIETLY)
-ELSE (CEGUI_FOUND)
-    IF (NOT CEGUI_INCLUDE_DIR)
-        MESSAGE(SEND_ERROR "CEGUI include path was not found.")
-    ENDIF (NOT CEGUI_INCLUDE_DIR)
-    IF (NOT CEGUI_LIB_DIR)
-        MESSAGE(SEND_ERROR "CEGUI library was not found.")
-    ENDIF (NOT CEGUI_LIB_DIR)
-    IF (NOT CEGUI_LIBRARIES)
-        MESSAGE(SEND_ERROR "CEGUI libraries not known.")
-    ENDIF (NOT CEGUI_LIBRARIES)
-#    IF (NOT CEGUI_SCRIPT_LIBRARIES)
-#        MESSAGE(SEND_ERROR "CEGUI Lua script module was not found.")
-#    ENDIF (NOT CEGUI_SCRIPT_LIBRARIES)
-ENDIF (CEGUI_FOUND)
-
+MARK_AS_ADVANCED(
+    CEGUI_LIBRARY
+    CEGUI_INCLUDE_DIR
+    #CEGUI_SCRIPT_LIBRARIES
+)
Index: code/branches/buildsystem2/cmake/FindCEGUI_OGRE.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindCEGUI_OGRE.cmake	(revision 2507)
+++ 	(revision )
@@ -1,69 +1,0 @@
-# Find CEGUI_OGRE includes and library
-#
-# This module defines
-#  CEGUI_OGRE_INCLUDE_DIR
-#  CEGUI_OGRE_LIBRARIES, the libraries to link against to use CEGUI_OGRE.
-#  CEGUI_OGRE_LIB_DIR, the location of the libraries
-#  CEGUI_OGRE_FOUND, If false, do not try to use CEGUI_OGRE
-#
-# Created by Matt Williams to find OGRE libraries
-# Copyright © 2007, Matt Williams
-#
-# Modified by Nicolas Schlumberger to find CEGUI-OGRE libraries
-# and make it run on the Tardis-Infrastucture of the ETH Zurich
-# Copyright 2007, Nicolas Schlumberger
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-#
-# Several changes and additions by Fabian 'x3n' Landau
-#                 > www.orxonox.net <
-
-IF (CEGUI_OGRE_LIBRARIES AND CEGUI_OGRE_INCLUDE_DIR AND CEGUI_OGRE_LIB_DIR)
-    SET(CEGUI_OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent
-ENDIF (CEGUI_OGRE_LIBRARIES AND CEGUI_OGRE_INCLUDE_DIR AND CEGUI_OGRE_LIB_DIR)
-
-IF (WIN32) #Windows
-    MESSAGE(STATUS "Looking for CEGUI_OGRE")
-    SET(CEGUI_OGRE_INCLUDE_DIR ../libs/ogre/Samples/Common/CEGUIRenderer/include)
-    SET(CEGUI_OGRE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libs/ogre/Samples/Common/bin/Release/lib)
-    SET(CEGUI_OGRE_LIBRARIES debug OgreGUIRenderer_d optimized OgreGUIRenderer)
-ELSE (WIN32) #Unix
-    FIND_PACKAGE(PkgConfig)
-    PKG_SEARCH_MODULE(CEGUI_OGRE CEGUI-OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/CEGUI-OGRE.pc) # tardis specific hack
-    SET(CEGUI_OGRE_INCLUDE_DIR ${CEGUI_OGRE_INCLUDE_DIRS})
-    SET(CEGUI_OGRE_LIB_DIR ${CEGUI_OGRE_LIBDIR})
-    SET(CEGUI_OGRE_LIBRARIES ${CEGUI_OGRE_LIBRARIES} CACHE STRING "")
-ENDIF (WIN32)
-
-#Do some preparation
-SEPARATE_ARGUMENTS(CEGUI_OGRE_INCLUDE_DIR)
-SEPARATE_ARGUMENTS(CEGUI_OGRE_LIBRARIES)
-
-SET(CEGUI_OGRE_INCLUDE_DIR ${CEGUI_OGRE_INCLUDE_DIR} CACHE PATH "")
-SET(CEGUI_OGRE_LIBRARIES ${CEGUI_OGRE_LIBRARIES} CACHE STRING "")
-SET(CEGUI_OGRE_LIB_DIR ${CEGUI_OGRE_LIB_DIR} CACHE PATH "")
-
-IF (CEGUI_OGRE_INCLUDE_DIR AND CEGUI_OGRE_LIBRARIES AND CEGUI_OGRE_LIB_DIR)
-    SET(CEGUI_OGRE_FOUND TRUE)
-ENDIF (CEGUI_OGRE_INCLUDE_DIR AND CEGUI_OGRE_LIBRARIES AND CEGUI_OGRE_LIB_DIR)
-
-IF (CEGUI_OGRE_FOUND)
-    IF (NOT CEGUI_OGRE_FIND_QUIETLY)
-        MESSAGE(STATUS "CEGUI_Ogre was found.")
-        IF (VERBOSE_FIND)
-            MESSAGE (STATUS "  include path: ${CEGUI_OGRE_INCLUDE_DIR}")
-            MESSAGE (STATUS "  library path: ${CEGUI_OGRE_LIB_DIR}")
-            MESSAGE (STATUS "  libraries:    ${CEGUI_OGRE_LIBRARIES}")
-        ENDIF (VERBOSE_FIND)
-    ENDIF (NOT CEGUI_OGRE_FIND_QUIETLY)
-ELSE (CEGUI_OGRE_FOUND)
-    IF (NOT CEGUI_OGRE_INCLUDE_DIR)
-        MESSAGE(SEND_ERROR "CEGUI_Ogre include path was not found.")
-    ENDIF (NOT CEGUI_OGRE_INCLUDE_DIR)
-    IF (NOT CEGUI_OGRE_LIB_DIR)
-        MESSAGE(SEND_ERROR "CEGUI_Ogre library was not found.")
-    ENDIF (NOT CEGUI_OGRE_LIB_DIR)
-    IF (NOT CEGUI_OGRE_LIBRARIES)
-        MESSAGE(SEND_ERROR "CEGUI_Ogre libraries not known.")
-    ENDIF (NOT CEGUI_OGRE_LIBRARIES)
-ENDIF (CEGUI_OGRE_FOUND)
Index: code/branches/buildsystem2/cmake/FindENet.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindENet.cmake	(revision 2507)
+++ code/branches/buildsystem2/cmake/FindENet.cmake	(revision 2509)
@@ -3,7 +3,8 @@
 #
 #  ENET_FOUND - system has enet
-#  ENET_INCLUDE_DIR - the enet include directory
-#  ENET_LIBRARIES - the libraries needed to use enet
-#  ENET_DEFINITIONS - Compiler switches required for using enet
+#  ENet_INCLUDE_DIR - the enet include directory
+#  ENet_LIBRARIES - the libraries needed to use enet
+#
+# $ENETDIR is an environment variable used for finding enet.
 #
 #  Borrowed from The Mana World
@@ -11,55 +12,37 @@
 #
 # Several changes and additions by Fabian 'x3n' Landau
+# Lots of simplifications by Adrian Friedli
 #                 > www.orxonox.net <
 
-IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
-   SET(ENet_FIND_QUIETLY TRUE)
-ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
-
 FIND_PATH(ENet_INCLUDE_DIR enet/enet.h
-    /usr/include
-    /usr/local/include
-    /usr/pack/enet-2007-sd/include
-    ../libs/enet-1.1/include
-    ${DEPENDENCY_DIR}/enet-1.2/include
+    PATHS
+    $ENV{ENETDIR}
+    /usr/local
+    /usr
+    PATH_SUFFIXES include
     )
 
 FIND_LIBRARY(ENet_LIBRARY
     NAMES enet
-    PATHS /usr/lib /usr/local/lib /usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/
-    ../libs/enet-1.1
-    ${DEPENDENCY_DIR}/enet-1.2/lib
+    PATHS
+    $ENV{ENETDIR}
+    /usr/local
+    /usr
+    PATH_SUFFIXES lib
     )
 
-SET(ENET_FOUND FALSE)
-IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
-    SET(ENET_FOUND TRUE)
-    SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR})
+# handle the QUIETLY and REQUIRED arguments and set ENET_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ENet DEFAULT_MSG ENet_LIBRARY ENet_INCLUDE_DIR)
 
+IF (ENET_FOUND)
     IF(WIN32)
         SET(WINDOWS_ENET_DEPENDENCIES "ws2_32;winmm")
-        SET(ENet_LIBRARY ${ENet_LIBRARY} ${WINDOWS_ENET_DEPENDENCIES})
+        SET(ENet_LIBRARIES ${ENet_LIBRARY} ${WINDOWS_ENET_DEPENDENCIES})
+    ELSE(WIN32)
+        SET(ENet_LIBRARIES ${ENet_LIBRARY})
     ENDIF(WIN32)
-
-    SET(ENET_LIBRARIES ${ENet_LIBRARY})
-ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
-
-IF (ENET_FOUND)
-    IF (NOT ENet_FIND_QUIETLY)
-        MESSAGE(STATUS "ENet was found.")
-        IF (VERBOSE_FIND)
-            MESSAGE (STATUS "  include path: ${ENet_INCLUDE_DIR}")
-            MESSAGE (STATUS "  library path: ${ENet_LIBRARY}")
-            MESSAGE (STATUS "  libraries:    enet")
-        ENDIF (VERBOSE_FIND)
-    ENDIF (NOT ENet_FIND_QUIETLY)
-ELSE (ENET_FOUND)
-    IF (NOT ENet_INCLUDE_DIR)
-        MESSAGE(SEND_ERROR "ENet include path was not found.")
-    ENDIF (NOT ENet_INCLUDE_DIR)
-    IF (NOT ENet_LIBRARY)
-        MESSAGE(SEND_ERROR "ENet library was not found.")
-    ENDIF (NOT ENet_LIBRARY)
 ENDIF (ENET_FOUND)
 
-MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY)
+MARK_AS_ADVANCED(ENet_LIBRARY ENet_INCLUDE_DIR)
Index: code/branches/buildsystem2/cmake/FindLua.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindLua.cmake	(revision 2507)
+++ 	(revision )
@@ -1,101 +1,0 @@
-#  Find Lua header and library files
-#
-#  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
-#
-#  authors: Benjamin Knecht, Reto Grieder
-#
-# Several changes and additions by Fabian 'x3n' Landau
-#                 > www.orxonox.net <
-
-IF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
-
-  # 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/include)
-
-  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 NAMES lua5.1 lua PATHS
-    /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 "")
-    SET(Lua_LIBRARY_NAMES "lua5.1 lua")
-
-  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 "")
-    SET(Lua_LIBRARY_NAMES "lua50 lua, lualib50 lualib")
-
-  ENDIF (Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51)
-	
-
-  IF (Lua_FOUND)
-    MESSAGE(STATUS "Lua was found.")
-    IF (VERBOSE_FIND)
-      MESSAGE (STATUS "  include path: ${Lua_INCLUDE_DIR}")
-      MESSAGE (STATUS "  library path: ${Lua_LIBRARIES}")
-      MESSAGE (STATUS "  libraries:    ${Lua_LIBRARY_NAMES}")
-    ENDIF (VERBOSE_FIND)
-  ELSE (Lua_FOUND)
-    IF (Lua_INCLUDE_DIR_51 AND NOT Lua_LIBRARY_51)
-      MESSAGE(SEND_ERROR "Lua 5.1 library was not found")
-    ENDIF (Lua_INCLUDE_DIR_51 AND NOT Lua_LIBRARY_51)
-    IF (NOT Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51)
-      MESSAGE(SEND_ERROR "Lua 5.1 include path was not found")
-    ENDIF (NOT Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51)
-
-    IF (Lua_INCLUDE_DIR_50)
-      IF (NOT Lua_LIBRARY_1_50)
-       MESSAGE(SEND_ERROR "Lua 5.0 library "lua" was not found")
-      ENDIF (NOT Lua_LIBRARY_1_50)
-      IF (NOT Lua_LIBRARY_2_50)
-       MESSAGE(SEND_ERROR "Lua 5.0 library "lualib" was not found")
-      ENDIF (NOT Lua_LIBRARY_2_50)
-    ENDIF (Lua_INCLUDE_DIR_50)
-    IF (NOT Lua_INCLUDE_DIR_50 AND Lua_LIBRARY_1_50 AND Lua_LIBRARY_2_50)
-      MESSAGE(SEND_ERROR "Lua 5.0 include path was not found")
-    ENDIF (NOT Lua_INCLUDE_DIR_50 AND Lua_LIBRARY_1_50 AND Lua_LIBRARY_2_50)
-
-    MESSAGE(SEND_ERROR "Lua was not found.")
-  ENDIF (Lua_FOUND)
-
-ENDIF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
-
Index: code/branches/buildsystem2/cmake/FindODE.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindODE.cmake	(revision 2507)
+++ 	(revision )
@@ -1,46 +1,0 @@
-# find ODE (Open Dynamics Engine) includes and library
-#
-# ODE_INCLUDE_DIR - where the directory containing the ODE headers can be
-#                   found
-# ODE_LIBRARY     - full path to the ODE library
-# ODE_FOUND       - TRUE if ODE was found
-
-IF (NOT ODE_FOUND)
-
-  FIND_PATH(ODE_INCLUDE_DIR ode/ode.h
-    /usr/include
-    /usr/local/include
-    $ENV{OGRE_HOME}/include # OGRE SDK on WIN32
-    $ENV{INCLUDE}
-  )
-  FIND_LIBRARY(ODE_LIBRARY
-    NAMES ode
-    PATHS
-    /usr/lib
-    /usr/local/lib
-    $ENV{OGRE_HOME}/lib # OGRE SDK on WIN32
-  )
-
-  IF(ODE_INCLUDE_DIR)
-    MESSAGE(STATUS "Found ODE include dir: ${ODE_INCLUDE_DIR}")
-  ELSE(ODE_INCLUDE_DIR)
-    MESSAGE(STATUS "Could NOT find ODE headers.")
-  ENDIF(ODE_INCLUDE_DIR)
-
-  IF(ODE_LIBRARY)
-    MESSAGE(STATUS "Found ODE library: ${ODE_LIBRARY}")
-  ELSE(ODE_LIBRARY)
-    MESSAGE(STATUS "Could NOT find ODE library.")
-  ENDIF(ODE_LIBRARY)
-
-  IF(ODE_INCLUDE_DIR AND ODE_LIBRARY)
-     SET(ODE_FOUND TRUE CACHE STRING "Whether ODE was found or not")
-   ELSE(ODE_INCLUDE_DIR AND ODE_LIBRARY)
-     SET(ODE_FOUND FALSE)
-     IF(ODE_FIND_REQUIRED)
-       MESSAGE(FATAL_ERROR "Could not find ODE. Please install ODE (http://www.ode.org)")
-     ENDIF(ODE_FIND_REQUIRED)
-   ENDIF(ODE_INCLUDE_DIR AND ODE_LIBRARY)
-ENDIF (NOT ODE_FOUND)
-
-# vim: et sw=4 ts=4
Index: code/branches/buildsystem2/cmake/FindOGRE.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindOGRE.cmake	(revision 2507)
+++ code/branches/buildsystem2/cmake/FindOGRE.cmake	(revision 2509)
@@ -3,6 +3,5 @@
 # This module defines
 #  OGRE_INCLUDE_DIR
-#  OGRE_LIBRARIES, the libraries to link against to use OGRE.
-#  OGRE_LIB_DIR, the location of the libraries
+#  OGRE_LIBRARY, the library to link against to use OGRE.
 #  OGRE_FOUND, If false, do not try to use OGRE
 #
@@ -13,65 +12,33 @@
 #
 # Several changes and additions by Fabian 'x3n' Landau
+# Lots of simplifications by Adrian Friedli
 #                 > www.orxonox.net <
 
-IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR AND OGRE_LIB_DIR)
-    SET (OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent
-ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR AND OGRE_LIB_DIR)
+FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
+    PATHS
+    $ENV{OGREDIR}
+    /usr/local
+    /usr
+    PATH_SUFFIXES include include/OGRE
+)
 
-IF (WIN32) #Windows
-    FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
-        ../libs/ogre/OgreMain/include
-        ${DEPENDENCY_DIR}/ogre-1.4.9/include
-    )
+#SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
+FIND_LIBRARY(OGRE_LIBRARY
+    NAMES OgreMain
+    PATHS
+    $ENV{OGREDIR}
+    /usr/local
+    /usr
+    PATH_SUFFIXES lib
+)
 
-    SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
-    FIND_LIBRARY(OGRE_LIBDIR NAMES ${OGRE_LIBRARIES} PATHS
-        ../libs/ogre/Samples/Common/bin/Release
-        ${DEPENDENCY_DIR}/ogre-1.4.9/lib
-    )
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGRE DEFAULT_MSG
+    OGRE_LIBRARY
+    OGRE_INCLUDE_DIR
+)
 
-    # Strip the filename from the path
-    IF (OGRE_LIBDIR)
-        GET_FILENAME_COMPONENT(OGRE_LIBDIR ${OGRE_LIBDIR} PATH)
-        SET (OGRE_LIB_DIR ${OGRE_LIBDIR} CACHE FILEPATH "")
-    ENDIF (OGRE_LIBDIR)
-ELSE (WIN32) #Unix
-    FIND_PACKAGE(PkgConfig)
-    PKG_SEARCH_MODULE(OGRE OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc) # tardis specific hack
-    SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS})
-    SET(OGRE_LIB_DIR ${OGRE_LIBDIR})
-    SET(OGRE_LIBRARIES ${OGRE_LIBRARIES})
-ENDIF (WIN32)
-
-#Do some preparation
-SEPARATE_ARGUMENTS(OGRE_INCLUDE_DIR)
-SEPARATE_ARGUMENTS(OGRE_LIBRARIES)
-
-SET (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "")
-SET (OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
-SET (OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "")
-
-IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES AND OGRE_LIB_DIR)
-    SET(OGRE_FOUND TRUE)
-ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES AND OGRE_LIB_DIR)
-
-IF (OGRE_FOUND)
-    IF (NOT OGRE_FIND_QUIETLY)
-        MESSAGE(STATUS "Ogre was found.")
-        IF (VERBOSE_FIND)
-            MESSAGE (STATUS "  include path: ${OGRE_INCLUDE_DIR}")
-            MESSAGE (STATUS "  library path: ${OGRE_LIB_DIR}")
-            MESSAGE (STATUS "  libraries:    ${OGRE_LIBRARIES}")
-        ENDIF (VERBOSE_FIND)
-    ENDIF (NOT OGRE_FIND_QUIETLY)
-ELSE (OGRE_FOUND)
-    IF (NOT OGRE_INCLUDE_DIR)
-        MESSAGE(SEND_ERROR "Ogre include path was not found.")
-    ENDIF (NOT OGRE_INCLUDE_DIR)
-    IF (NOT OGRE_LIB_DIR)
-        MESSAGE(SEND_ERROR "Ogre library was not found.")
-    ENDIF (NOT OGRE_LIB_DIR)
-    IF (NOT OGRE_LIBRARIES)
-        MESSAGE(SEND_ERROR "Ogre libraries not known.")
-    ENDIF (NOT OGRE_LIBRARIES)
-ENDIF (OGRE_FOUND)
+MARK_AS_ADVANCED(
+    OGRE_LIBRARY
+    OGRE_INCLUDE_DIR
+)
Index: code/branches/buildsystem2/cmake/FindOggVorbis.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindOggVorbis.cmake	(revision 2507)
+++ code/branches/buildsystem2/cmake/FindOggVorbis.cmake	(revision 2509)
@@ -1,156 +1,76 @@
+# - Try to find ogg/vorbis
+# Once done this will define
+#
+#  OGG_FOUND - system has ogg
+#  OGG_INCLUDE_DIR
+#  OGG_LIBRARY
+#  VORBIS_FOUND - system has vorbis
+#  VORBIS_INCLUDE_DIR
+#  VORBIS_LIBRARY
+#  VORBISENC_LIBRARY
+#  VORBISFILE_LIBRARY
+#
+# $OGGVORBISDIR is an environment variable used for finding ogg/vorbis.
+#
 # Several changes and additions by Fabian 'x3n' Landau
+# Most of all rewritten by Adrian Friedli
 #                 > www.orxonox.net <
 
-IF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
-  SET(OGG_FIND_QUIETLY TRUE)
-ENDIF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
-
-IF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISENC_LIBRARY AND VORBISFILE_LIBRARY)
-  SET(VORBIS_FIND_QUIETLY TRUE)
-ENDIF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISENC_LIBRARY AND VORBISFILE_LIBRARY) 
-
-
-#SET(OGGVORBIS_LIBRARY_DIR "/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/lib")
-#SET(OGGVORBIS_LIBRARY "-L ${OGGVORBIS_LIBRARY_DIR} -lvorbisenc -lvorbisfile -logg -lvorbis ")
-#SET(OGGVORBIS_INCLUDE_DIR "/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include")
-
-#
-# Includes
-#
+SET(OGG_SEARCH_PATHS
+  $ENV{OGGVORBISDIR}
+  /usr/local
+  /usr
+  /sw
+  /opt/local
+  /opt/csw
+  /opt
+)
 
 FIND_PATH(OGG_INCLUDE_DIR ogg/ogg.h
-  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include 		# Tardis specific hack
-  /usr/local/include
-  /usr/include
-  /sw/include
-  /opt/local/include
-  /opt/csw/include
-  /opt/csw/include
-  /opt/include
-  ../libs/libogg-1.1.3/include
-  ${DEPENDENCY_DIR}/libogg-1.1.3/include
-  )
+  PATHS ${OGG_SEARCH_PATHS}
+  PATH_SUFFIXES include
+)
 
 FIND_PATH(VORBIS_INCLUDE_DIR vorbis/codec.h
-  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include 		# Tardis specific hack
-  /usr/local/include
-  /usr/include
-  /sw/include
-  /opt/local/include
-  /opt/csw/include
-  /opt/csw/include
-  /opt/include
-  ../libs/libvorbis-1.2.0/include
-  ${DEPENDENCY_DIR}/libvorbis-1.2.0/include
-  )
+  PATHS ${OGG_SEARCH_PATHS}
+  PATH_SUFFIXES include
+)
 
-#
-# Libs
-#
+FIND_LIBRARY(OGG_LIBRARY NAMES ogg
+  PATHS ${OGG_SEARCH_PATHS}
+  PATH_SUFFIXES lib
+)
 
-FIND_LIBRARY(OGG_LIBRARY
-  NAMES ogg
-  PATHS
-  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
-  /usr/local/lib
-  /usr/lib
-  /sw/lib
-  /opt/local/lib
-  /opt/csw/lib
-  /opt/lib
-  ../libs/libogg-1.1.3/src/.libs
-  ${DEPENDENCY_DIR}/libogg-1.1.3/lib
-  )
+FIND_LIBRARY(VORBIS_LIBRARY NAMES vorbis
+  PATHS ${OGG_SEARCH_PATHS}
+  PATH_SUFFIXES lib
+)
 
-FIND_LIBRARY(VORBIS_LIBRARY
-  NAMES vorbis
-  PATHS
-  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
-  /usr/local/lib
-  /usr/lib
-  /sw/lib
-  /opt/local/lib
-  /opt/csw/lib
-  /opt/lib
-  ../libs/libvorbis-1.2.0/lib/.libs
-  ${DEPENDENCY_DIR}/libvorbis-1.2.0/lib
-  )
+#FIND_LIBRARY(VORBISENC_LIBRARY NAMES vorbisenc
+#  PATHS ${OGG_SEARCH_PATHS}
+#  PATH_SUFFIXES lib
+#)
 
-#FIND_LIBRARY(VORBISENC_LIBRARY
-#  NAMES vorbisenc
-#  PATHS
-#  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
-#  /usr/local/lib
-#  /usr/lib
-#  /sw/lib
-#  /opt/local/lib
-#  /opt/csw/lib
-#  /opt/lib
-#  ../libs/libvorbis-1.2.0/lib/.libs
-#  )
+FIND_LIBRARY(VORBISFILE_LIBRARY NAMES vorbisfile
+  PATHS ${OGG_SEARCH_PATHS}
+  PATH_SUFFIXES lib
+)
 
-FIND_LIBRARY(VORBISFILE_LIBRARY
-  NAMES vorbisfile
-  PATHS
-  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
-  /usr/local/lib
-  /usr/lib
-  /sw/lib
-  /opt/local/lib
-  /opt/csw/lib
-  /opt/lib
-  ../libs/libvorbis-1.2.0/lib/.libs
-  ${DEPENDENCY_DIR}/libvorbis-1.2.0/lib
-  )
+# handle the QUIETLY and REQUIRED arguments and set *_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGG DEFAULT_MSG OGG_LIBRARY OGG_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBIS DEFAULT_MSG
+  VORBIS_LIBRARY
+  VORBISFILE_LIBRARY
+  #VORBISENC_LIBRARY
+  VORBIS_INCLUDE_DIR
+)
 
-SET (OGG_FOUND "NO")
-
-IF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
-  SET (OGG_FOUND "YES")
-  IF (NOT OGG_FIND_QUIETLY)
-    MESSAGE (STATUS "Ogg was found.")
-    IF (VERBOSE_FIND)
-      MESSAGE (STATUS "  include path: ${OGG_INCLUDE_DIR}")
-      MESSAGE (STATUS "  library path: ${OGG_LIBRARY}")
-      MESSAGE (STATUS "  libraries:    ogg")
-    ENDIF (VERBOSE_FIND)
-  ENDIF (NOT OGG_FIND_QUIETLY)
-ELSE (OGG_INCLUDE_DIR AND OGG_LIBRARY)
-  IF (NOT OGG_INCLUDE_DIR)
-    MESSAGE (SEND_ERROR "Ogg include path was not found.")
-  ENDIF (NOT OGG_INCLUDE_DIR)
-  IF (NOT OGG_LIBRARY)
-    MESSAGE (SEND_ERROR "Ogg library was not found.")
-  ENDIF (NOT OGG_LIBRARY)
-ENDIF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
-
-
-SET (VORBIS_FOUND "NO")
-
-IF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)# AND VORBISENC_LIBRARY)
-  SET (VORBIS_FOUND "YES")
-  IF (NOT VORBIS_FIND_QUIETLY)
-    MESSAGE (STATUS "Vorbis was found.")
-    IF (VERBOSE_FIND)
-      MESSAGE (STATUS "  include path: ${VORBIS_INCLUDE_DIR}")
-      MESSAGE (STATUS "  library path: ${VORBIS_LIBRARY}")
-      #MESSAGE (STATUS "  library path: ${VORBISENC_LIBRARY}")
-      MESSAGE (STATUS "  library path: ${VORBISFILE_LIBRARY}")
-      MESSAGE (STATUS "  libraries:    vorbis vorbisenc vorbisfile")
-    ENDIF (VERBOSE_FIND)
-  ENDIF (NOT VORBIS_FIND_QUIETLY)
-ELSE (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)# AND VORBISENC_LIBRARY)
-  IF (NOT VORBIS_INCLUDE_DIR)
-    MESSAGE (SEND_ERROR "Vorbis include path was not found.")
-  ENDIF (NOT VORBIS_INCLUDE_DIR)
-  IF (NOT VORBIS_LIBRARY)
-    MESSAGE (SEND_ERROR "Vorbis library \"vorbis\" was not found.")
-  ENDIF (NOT VORBIS_LIBRARY)
-  #IF (NOT VORBISENC_LIBRARY)
-  #  MESSAGE (SEND_ERROR "Vorbis library \"vorbisenc\" was not found.")
-  #ENDIF (NOT VORBISENC_LIBRARY)
-  IF (NOT VORBISFILE_LIBRARY)
-    MESSAGE (SEND_ERROR "Vorbis library \"vorbisfile\" was not found.")
-  ENDIF (NOT VORBISFILE_LIBRARY)
-ENDIF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)# AND VORBISENC_LIBRARY)
-
+MARK_AS_ADVANCED(
+  OGG_LIBRARY
+  OGG_INCLUDE_DIR
+  VORBIS_LIBRARY
+  VORBISFILE_LIBRARY
+  VORBIS_INCLUDE_DIR
+)
Index: code/branches/buildsystem2/cmake/FindOpenAL.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindOpenAL.cmake	(revision 2507)
+++ 	(revision )
@@ -1,113 +1,0 @@
-# - Locate OpenAL
-# This module defines
-#  OPENAL_LIBRARY
-#  OPENAL_FOUND, if false, do not try to link to OpenAL
-#  OPENAL_INCLUDE_DIR, where to find the headers
-#
-# $OPENALDIR is an environment variable that would
-# correspond to the ./configure --prefix=$OPENALDIR
-# used in building OpenAL.
-#
-# Several changes and additions by Fabian 'x3n' Landau
-#                 > www.orxonox.net <
-
-IF (OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
-  SET(OPENAL_FIND_QUIETLY TRUE)
-ENDIF (OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
-
-# Created by Eric Wing. This was influenced by the FindSDL.cmake module.
-# On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of
-# OPENAL_LIBRARY to override this selection.
-# Tiger will include OpenAL as part of the System.
-# But for now, we have to look around.
-# Other (Unix) systems should be able to utilize the non-framework paths.
-FIND_PATH(OPENAL_INCLUDE_DIR AL/al.h
-  $ENV{OPENALDIR}/include
-  ~/Library/Frameworks/OpenAL.framework/Headers
-  /Library/Frameworks/OpenAL.framework/Headers
-  /System/Library/Frameworks/OpenAL.framework/Headers # Tiger
-  /usr/pack/openal-0.0.8-cl/include # Tardis specific hack
-  /usr/local/include/
-  /usr/local/include/OpenAL
-  /usr/local/include
-  /usr/include/
-  /usr/include/OpenAL
-  /usr/include
-  /sw/include # Fink
-  /sw/include/OpenAL
-  /sw/include
-  /opt/local/include # DarwinPorts
-  /opt/local/include/OpenAL
-  /opt/local/include
-  /opt/csw/include # Blastwave
-  /opt/csw/include/OpenAL
-  /opt/csw/include
-  /opt/include
-  /opt/include/OpenAL
-  /opt/include
-  ../libs/openal-0.0.8/common/include
-  ${DEPENDENCY_DIR}/openal-1.1/include
-  )
-# I'm not sure if I should do a special casing for Apple. It is
-# unlikely that other Unix systems will find the framework path.
-# But if they do ([Next|Open|GNU]Step?),
-# do they want the -framework option also?
-IF(${OPENAL_INCLUDE_DIR} MATCHES ".framework")
-  STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" OPENAL_FRAMEWORK_PATH_TMP ${OPENAL_INCLUDE_DIR})
-  IF("${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
-      OR "${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
-      )
-    # String is in default search path, don't need to use -F
-    SET (OPENAL_LIBRARY "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
-  ELSE("${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
-      OR "${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
-      )
-    # String is not /Library/Frameworks, need to use -F
-    SET(OPENAL_LIBRARY "-F${OPENAL_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
-  ENDIF("${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
-    OR "${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
-    )
-  # Clear the temp variable so nobody can see it
-  SET(OPENAL_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
-
-ELSE(${OPENAL_INCLUDE_DIR} MATCHES ".framework")
-  FIND_LIBRARY(OPENAL_LIBRARY
-    NAMES openal al OpenAL32
-    PATHS
-    $ENV{OPENALDIR}/lib
-    $ENV{OPENALDIR}/libs
-    /usr/pack/openal-0.0.8-cl/i686-debian-linux3.1/lib
-    /usr/local/lib
-    /usr/lib
-    /sw/lib
-    /opt/local/lib
-    /opt/csw/lib
-    /opt/lib
-    ../libs/openal-0.0.8/src/.libs
-    ${DEPENDENCY_DIR}/openal-1.1/lib
-    )
-ENDIF(${OPENAL_INCLUDE_DIR} MATCHES ".framework")
-
-SET (OPENAL_FOUND "NO")
-
-IF (OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
-  SET (OPENAL_FOUND "YES")
-  IF (NOT OPENAL_FIND_QUIETLY)
-    MESSAGE (STATUS "OpenAL was found.")
-    IF (VERBOSE_FIND)
-      MESSAGE (STATUS "  include path: ${OPENAL_INCLUDE_DIR}")
-      MESSAGE (STATUS "  library path: ${OPENAL_LIBRARY}")
-      MESSAGE (STATUS "  libraries:    openal al OpenAL32")
-    ENDIF (VERBOSE_FIND)
-  ENDIF (NOT OPENAL_FIND_QUIETLY)
-ELSE (OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
-  IF (NOT OPENAL_INCLUDE_DIR)
-    MESSAGE (SEND_ERROR "OpenAL include path was not found.")
-  ENDIF (NOT OPENAL_INCLUDE_DIR)
-  IF (NOT OPENAL_LIBRARY)
-    MESSAGE (SEND_ERROR "OpenAL library was not found.")
-  ENDIF (NOT OPENAL_LIBRARY)
-ENDIF (OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
-
-
Index: code/branches/buildsystem2/cmake/FindPkgConfig.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindPkgConfig.cmake	(revision 2507)
+++ 	(revision )
@@ -1,360 +1,0 @@
-# - a pkg-config module for CMake
-#
-# Usage:
-#   pkg_check_modules(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)
-#     checks for all the given modules
-#
-#   pkg_search_module(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)
-#     checks for given modules and uses the first working one
-#
-# When the 'REQUIRED' argument was set, macros will fail with an error
-# when module(s) could not be found
-#
-# It sets the following variables:
-#   PKG_CONFIG_FOUND         ... true iff pkg-config works on the system
-#   PKG_CONFIG_EXECUTABLE    ... pathname of the pkg-config program
-#   <PREFIX>_FOUND           ... set to 1 iff module(s) exist
-#
-# For the following variables two sets of values exist; first one is the
-# common one and has the given PREFIX. The second set contains flags
-# which are given out when pkgconfig was called with the '--static'
-# option.
-#   <XPREFIX>_LIBRARIES      ... only the libraries (w/o the '-l')
-#   <XPREFIX>_LIBRARY_DIRS   ... the paths of the libraries (w/o the '-L')
-#   <XPREFIX>_LDFLAGS        ... all required linker flags
-#   <XPREFIX>_LDFLAGS_OTHERS ... all other linker flags
-#   <XPREFIX>_INCLUDE_DIRS   ... the '-I' preprocessor flags (w/o the '-I')
-#   <XPREFIX>_CFLAGS         ... all required cflags
-#   <XPREFIX>_CFLAGS_OTHERS  ... the other compiler flags
-#
-#   <XPREFIX> = <PREFIX>        for common case
-#   <XPREFIX> = <PREFIX>_STATIC for static linking
-#
-# There are some special variables whose prefix depends on the count
-# of given modules. When there is only one module, <PREFIX> stays
-# unchanged. When there are multiple modules, the prefix will be
-# changed to <PREFIX>_<MODNAME>:
-#   <XPREFIX>_VERSION    ... version of the module
-#   <XPREFIX>_PREFIX     ... prefix-directory of the module
-#   <XPREFIX>_INCLUDEDIR ... include-dir of the module
-#   <XPREFIX>_LIBDIR     ... lib-dir of the module
-#
-#   <XPREFIX> = <PREFIX>  when |MODULES| == 1, else
-#   <XPREFIX> = <PREFIX>_<MODNAME>
-#
-# A <MODULE> parameter can have the following formats:
-#   {MODNAME}            ... matches any version
-#   {MODNAME}>={VERSION} ... at least version <VERSION> is required
-#   {MODNAME}={VERSION}  ... exactly version <VERSION> is required
-#   {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
-#
-# Examples
-#   pkg_check_modules (GLIB2   glib-2.0)
-#
-#   pkg_check_modules (GLIB2   glib-2.0>=2.10)
-#     requires at least version 2.10 of glib2 and defines e.g.
-#       GLIB2_VERSION=2.10.3
-#
-#   pkg_check_modules (FOO     glib-2.0>=2.10 gtk+-2.0)
-#     requires both glib2 and gtk2, and defines e.g.
-#       FOO_glib-2.0_VERSION=2.10.3
-#       FOO_gtk+-2.0_VERSION=2.8.20
-#
-#   pkg_check_modules (XRENDER REQUIRED xrender)
-#     defines e.g.:
-#       XRENDER_LIBRARIES=Xrender;X11
-#       XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
-#
-#   pkg_search_module (BAR     libxml-2.0 libxml2 libxml>=2)
-
-
-# Copyright (C) 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
-#
-# Redistribution and use, with or without modification, are permitted
-# provided that the following conditions are met:
-# 
-#    1. Redistributions must retain the above copyright notice, this
-#       list of conditions and the following disclaimer.
-#    2. The name of the author may not be used to endorse or promote
-#       products derived from this software without specific prior
-#       written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-### Common stuff ####
-set(PKG_CONFIG_VERSION 1)
-set(PKG_CONFIG_FOUND   0)
-
-find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
-mark_as_advanced(PKG_CONFIG_EXECUTABLE)
-
-if(PKG_CONFIG_EXECUTABLE)
-  set(PKG_CONFIG_FOUND 1)
-endif(PKG_CONFIG_EXECUTABLE)
-
-
-# Unsets the given variables
-macro(_pkgconfig_unset var)
-  set(${var} "" CACHE INTERNAL "")
-endmacro(_pkgconfig_unset)
-
-macro(_pkgconfig_set var value)
-  set(${var} ${value} CACHE INTERNAL "")
-endmacro(_pkgconfig_set)
-
-# Invokes pkgconfig, cleans up the result and sets variables
-macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
-  set(_pkgconfig_invoke_result)
-
-  execute_process(
-    COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist}
-    OUTPUT_VARIABLE _pkgconfig_invoke_result
-    RESULT_VARIABLE _pkgconfig_failed)
-
-  if (_pkgconfig_failed)
-    set(_pkgconfig_${_varname} "")
-    _pkgconfig_unset(${_prefix}_${_varname})
-  else(_pkgconfig_failed)
-    string(REGEX REPLACE "[\r\n]"                  " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
-    string(REGEX REPLACE " +$"                     ""  _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
-
-    if (NOT ${_regexp} STREQUAL "")
-      string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
-    endif(NOT ${_regexp} STREQUAL "")
-
-    separate_arguments(_pkgconfig_invoke_result)
-
-    #message(STATUS "  ${_varname} ... ${_pkgconfig_invoke_result}")
-    set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result})
-    _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}")
-  endif(_pkgconfig_failed)
-endmacro(_pkgconfig_invoke)
-
-# Invokes pkgconfig two times; once without '--static' and once with
-# '--static'
-macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)
-  _pkgconfig_invoke("${_pkglist}" ${_prefix}        ${_varname} "${cleanup_regexp}" ${ARGN})
-  _pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static  ${ARGN})
-endmacro(_pkgconfig_invoke_dyn)
-
-# Splits given arguments into options and a package list
-macro(_pkgconfig_parse_options _result _is_req)
-  set(${_is_req} 0)
-  
-  foreach(_pkg ${ARGN})
-    if (_pkg STREQUAL "REQUIRED")
-      set(${_is_req} 1)
-    endif (_pkg STREQUAL "REQUIRED")
-  endforeach(_pkg ${ARGN})
-
-  set(${_result} ${ARGN})
-  list(REMOVE_ITEM ${_result} "REQUIRED")
-endmacro(_pkgconfig_parse_options)
-
-###
-macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
-  _pkgconfig_unset(${_prefix}_FOUND)
-  _pkgconfig_unset(${_prefix}_VERSION)
-  _pkgconfig_unset(${_prefix}_PREFIX)
-  _pkgconfig_unset(${_prefix}_INCLUDEDIR)
-  _pkgconfig_unset(${_prefix}_LIBDIR)
-  _pkgconfig_unset(${_prefix}_LIBS)
-  _pkgconfig_unset(${_prefix}_LIBS_L)
-  _pkgconfig_unset(${_prefix}_LIBS_PATHS)
-  _pkgconfig_unset(${_prefix}_LIBS_OTHER)
-  _pkgconfig_unset(${_prefix}_CFLAGS)
-  _pkgconfig_unset(${_prefix}_CFLAGS_I)
-  _pkgconfig_unset(${_prefix}_CFLAGS_OTHER)
-  _pkgconfig_unset(${_prefix}_STATIC_LIBDIR)
-  _pkgconfig_unset(${_prefix}_STATIC_LIBS)
-  _pkgconfig_unset(${_prefix}_STATIC_LIBS_L)
-  _pkgconfig_unset(${_prefix}_STATIC_LIBS_PATHS)
-  _pkgconfig_unset(${_prefix}_STATIC_LIBS_OTHER)
-  _pkgconfig_unset(${_prefix}_STATIC_CFLAGS)
-  _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_I)
-  _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_OTHER)
-
-  # create a better addressable variable of the modules and calculate its size
-  set(_pkg_check_modules_list ${ARGN})
-  list(LENGTH _pkg_check_modules_list _pkg_check_modules_cnt)
-
-  if(PKG_CONFIG_EXECUTABLE)
-    # give out status message telling checked module
-    if (NOT ${_is_silent})
-      if (_pkg_check_modules_cnt EQUAL 1)
-        message(STATUS "checking for module '${_pkg_check_modules_list}'")
-      else(_pkg_check_modules_cnt EQUAL 1)
-        message(STATUS "checking for modules '${_pkg_check_modules_list}'")
-      endif(_pkg_check_modules_cnt EQUAL 1)
-    endif(NOT ${_is_silent})
-    
-    set(_pkg_check_modules_packages)
-    set(_pkg_check_modules_failed)
-
-    # iterate through module list and check whether they exist and match the required version
-    foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list})
-      set(_pkg_check_modules_exist_query)
-
-      # check whether version is given
-      if (_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
-        string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
-        string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op   "${_pkg_check_modules_pkg}")
-        string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver  "${_pkg_check_modules_pkg}")
-      else(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
-        set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
-        set(_pkg_check_modules_pkg_op)
-        set(_pkg_check_modules_pkg_ver)
-      endif(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
-
-      # handle the operands
-      if (_pkg_check_modules_pkg_op STREQUAL ">=")
-        list(APPEND _pkg_check_modules_exist_query --atleast-version)
-      endif(_pkg_check_modules_pkg_op STREQUAL ">=")
-
-      if (_pkg_check_modules_pkg_op STREQUAL "=")
-        list(APPEND _pkg_check_modules_exist_query --exact-version)
-      endif(_pkg_check_modules_pkg_op STREQUAL "=")
-      
-      if (_pkg_check_modules_pkg_op STREQUAL "<=")
-        list(APPEND _pkg_check_modules_exist_query --max-version)
-      endif(_pkg_check_modules_pkg_op STREQUAL "<=")
-
-      # create the final query which is of the format:
-      # * --atleast-version <version> <pkg-name>
-      # * --exact-version <version> <pkg-name>      
-      # * --max-version <version> <pkg-name>
-      # * --exists <pkg-name>
-      if (_pkg_check_modules_pkg_op)
-        list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}")
-      else(_pkg_check_modules_pkg_op)
-        list(APPEND _pkg_check_modules_exist_query --exists)
-      endif(_pkg_check_modules_pkg_op)
-
-      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION)
-      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX)
-      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR)
-      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR)
-
-      list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}")
-      list(APPEND _pkg_check_modules_packages    "${_pkg_check_modules_pkg_name}")
-
-      # execute the query
-      execute_process(
-        COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query}
-        RESULT_VARIABLE _pkgconfig_retval)
-
-      # evaluate result and tell failures
-      if (_pkgconfig_retval)
-        if(NOT ${_is_silent})
-          message(STATUS "  package '${_pkg_check_modules_pkg}' not found")
-        endif(NOT ${_is_silent})
-
-        set(_pkg_check_modules_failed 1)
-      endif(_pkgconfig_retval)
-    endforeach(_pkg_check_modules_pkg)
-
-    if(_pkg_check_modules_failed)
-      # fail when requested
-      if (${_is_required})
-        message(SEND_ERROR "A required package was not found")
-      endif (${_is_required})
-    else(_pkg_check_modules_failed)
-      # when we are here, we checked whether requested modules
-      # exist. Now, go through them and set variables
-      
-      _pkgconfig_set(${_prefix}_FOUND 1)
-      list(LENGTH _pkg_check_modules_packages pkg_count)
-
-      # iterate through all modules again and set individual variables
-      foreach (_pkg_check_modules_pkg ${_pkg_check_modules_packages})
-        # handle case when there is only one package required
-        if (pkg_count EQUAL 1)
-          set(_pkg_check_prefix "${_prefix}")
-        else(pkg_count EQUAL 1)
-          set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}")
-        endif(pkg_count EQUAL 1)
-        
-        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION    ""   --modversion )
-        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX     ""   --variable=prefix )
-        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR ""   --variable=includedir )
-        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" LIBDIR     ""   --variable=libdir )
-
-        message(STATUS "  found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}")
-      endforeach(_pkg_check_modules_pkg)
-
-      # set variables which are combined for multiple modules
-      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES           "(^| )-l" --libs-only-l )
-      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARY_DIRS        "(^| )-L" --libs-only-L )
-      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS             ""        --libs )
-      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS_OTHER       ""        --libs-only-other )
-
-      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS        "(^| )-I" --cflags-only-I )
-      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS              ""        --cflags )
-      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER        ""        --cflags-only-other )
-    endif(_pkg_check_modules_failed)
-  else(PKG_CONFIG_EXECUTABLE)
-    if (${_is_required})
-      message(SEND_ERROR "pkg-config tool not found")
-    endif (${_is_required})
-  endif(PKG_CONFIG_EXECUTABLE)
-endmacro(_pkg_check_modules_internal)
-
-###
-### User visible macros start here
-###
-
-###
-macro(pkg_check_modules _prefix _module0)
-  # check cached value
-  if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})
-    _pkgconfig_parse_options   (_pkg_modules _pkg_is_required "${_module0}" ${ARGN})
-    _pkg_check_modules_internal("${_pkg_is_required}" 0 "${_prefix}" ${_pkg_modules})
-
-    _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
-  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})
-endmacro(pkg_check_modules)
-
-###
-macro(pkg_search_module _prefix _module0)
-  # check cached value
-  if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})
-    set(_pkg_modules_found 0)
-    _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required "${_module0}" ${ARGN})
-
-    message(STATUS "checking for one of the modules '${_pkg_modules_alt}'")
-
-    # iterate through all modules and stop at the first working one.
-    foreach(_pkg_alt ${_pkg_modules_alt})
-      if(NOT _pkg_modules_found)
-        _pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}")
-      endif(NOT _pkg_modules_found)
-
-      if (${_prefix}_FOUND)
-        set(_pkg_modules_found 1)
-      endif(${_prefix}_FOUND)
-    endforeach(_pkg_alt)
-
-    if (NOT ${_prefix}_FOUND)
-      if(${_pkg_is_required})
-        message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found")
-      endif(${_pkg_is_required})
-    endif(NOT ${_prefix}_FOUND)
-    
-    _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
-  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})  
-endmacro(pkg_search_module)
-
-### Local Variables:
-### mode: cmake
-### End:
Index: code/branches/buildsystem2/cmake/FindTCL.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindTCL.cmake	(revision 2507)
+++ 	(revision )
@@ -1,90 +1,0 @@
-# - Find Tcl includes and libraries.
-# This module finds if TCL is installed and determines where the
-# include files and libraries are. It also determines what the name of
-# the library is. This code sets the following variables:
-#  TCL_LIBRARY        = path to Tcl library (tcl tcl80)
-#  TCL_LIBRARY_DEBUG  = path to Tcl library (debug)
-#  TCL_INCLUDE_PATH   = path to where tcl.h can be found
-#
-# Several changes and additions by Fabian 'x3n' Landau
-#                 > www.orxonox.net <
-
-IF (TCL_LIBRARY AND TCL_INCLUDE_PATH)
-  SET(TCL_FIND_QUIETLY TRUE)
-ENDIF (TCL_LIBRARY AND TCL_INCLUDE_PATH)
-
-SET (TCLTK_POSSIBLE_LIB_PATHS
-  "${TCL_TCLSH_PATH}/../lib"
-  "${TK_WISH_PATH}/../lib"
-  "${TCL_INCLUDE_PATH}/../lib"
-  "${TK_INCLUDE_PATH}/../lib"
-  "$ENV{ProgramFiles}/Tcl/Lib"
-  "C:/Program Files/Tcl/lib" 
-  "C:/Tcl/lib" 
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib
-  /usr/lib 
-  /usr/local/lib
-  /usr/pack/tcltk-8.4.9.linux-mo/lib
-  ../libs/tcl8.5.2/win
-  ../libs/tcl8.5.2/unix
-  ../libs/tcl8.5.2/macosx
-  ${DEPENDENCY_DIR}/tcl-8.5.2/lib
-)
-
-FIND_LIBRARY(TCL_LIBRARY
-  NAMES tcl tcl85 tcl8.5 tcl84 tcl8.4 tcl85t
-  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
-)
-
-FIND_LIBRARY(TCL_LIBRARY_DEBUG
-  NAMES tcld tcl85d tcl8.5d tcl84d tcl8.4d
-  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
-)
-
-SET (TCLTK_POSSIBLE_INCLUDE_PATHS
-  ${TCL_TCLSH_PATH}/../include
-  ${TK_WISH_PATH}/../include
-  "${TCL_LIBRARY_PATH}/../include"
-  "${TK_LIBRARY_PATH}/../include"
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include
-  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include
-  "$ENV{ProgramFiles}/Tcl/include"
-  "C:/Program Files/Tcl/include"
-  C:/Tcl/include
-  /usr/include
-  /usr/local/include
-  /usr/include/tcl8.5
-  /usr/include/tcl8.4
-  ../libs/tcl8.5.2/generic
-  ${DEPENDENCY_DIR}/tcl-8.5.2/include
-)
-
-FIND_PATH(TCL_INCLUDE_PATH tcl.h
-  ${TCL_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS}
-)
-
-
-IF (TCL_LIBRARY AND TCL_INCLUDE_PATH)
-  IF (NOT TCL_FIND_QUIETLY)
-    MESSAGE(STATUS "Tcl was found")
-    IF (VERBOSE_FIND)
-      MESSAGE (STATUS "  include path: ${TCL_INCLUDE_PATH}")
-      MESSAGE (STATUS "  library path: ${TCL_LIBRARY}")
-      MESSAGE (STATUS "  libraries:    tcld tcl85d tcl8.5d tcl84d tcl8.4d")
-    ENDIF (VERBOSE_FIND)
-  ENDIF (NOT TCL_FIND_QUIETLY)
-ELSE (TCL_LIBRARY AND TCL_INCLUDE_PATH)
-  IF (NOT TCL_INCLUDE_PATH)
-    MESSAGE(SEND_ERROR "Tcl include path was not found.")
-  ENDIF (NOT TCL_INCLUDE_PATH)
-  IF (NOT TCL_LIBRARY )
-    MESSAGE(SEND_ERROR "Tcl library was not found.")
-  ENDIF (NOT TCL_LIBRARY )
-ENDIF (TCL_LIBRARY AND TCL_INCLUDE_PATH)
-
-IF(TCL_INCLUDE_PATH)
-  IF(TCL_LIBRARY)
-    SET(TCL_FOUND 1)
-  ENDIF(TCL_LIBRARY)
-ENDIF(TCL_INCLUDE_PATH)
Index: code/branches/buildsystem2/cmake/FindZLIB.cmake
===================================================================
--- code/branches/buildsystem2/cmake/FindZLIB.cmake	(revision 2507)
+++ 	(revision )
@@ -1,76 +1,0 @@
-# - Find zlib
-# Find the native ZLIB includes and library
-#
-#  ZLIB_INCLUDE_DIR - where to find zlib.h, etc.
-#  ZLIB_LIBRARY     - List of libraries when using zlib.
-#  ZLIB_FOUND       - True if zlib found.
-#
-#  Modified by Nicolas Schlumberger, (c) 2007
-#  to make it work on the Tardis Infrastucture of the ETH Zurich
-#
-# Several changes and additions by Fabian 'x3n' Landau
-#                 > www.orxonox.net <
-
-IF (ZLIB_INCLUDE_DIR)
-  SET(ZLIB_FIND_QUIETLY TRUE)
-ENDIF (ZLIB_INCLUDE_DIR)
-
-IF(UNIX)
-  FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
-    /usr/pack/zziplib-0.13.49-sd/include/
-    /usr/local/include
-    /usr/include
-  )
-
-  SET(ZLIB_NAMES z zlib zdll)
-  FIND_LIBRARY(ZLIB_LIBRARY
-    NAMES ${ZLIB_NAMES}
-    PATHS /usr/pack/zziplib-0.13.49-sd/i686-debian-linux3.1/lib/ /usr/lib /usr/local/lib
-  )
-ENDIF(UNIX)
-
-IF(WIN32)
-  IF(EXISTS "../libs/zlib")
-    SET (ZLIB_LIBRARY_DIR "../libs/zlib")
-  ENDIF(EXISTS "../libs/zlib")
-
-  FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
-    ../libs/zlib/include
-    ${DEPENDENCY_DIR}/zlib-1.2.3/include
-  )
-
-  FIND_LIBRARY(ZLIB_LIBRARY
-    NAMES zlib
-    PATHS ${ZLIB_LIBRARY_DIR}
-    ${DEPENDENCY_DIR}/zlib-1.2.3/lib
-  )
-ENDIF(WIN32)
-
-SET(ZLIB_FOUND FALSE)
-IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
-  SET(ZLIB_FOUND TRUE)
-ENDIF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
-
-IF (ZLIB_FOUND)
-  IF (NOT ZLIB_FIND_QUIETLY)
-    MESSAGE(STATUS "ZLIB was found.")
-    IF (VERBOSE_FIND)
-      MESSAGE (STATUS "  include path: ${ZLIB_INCLUDE_DIR}")
-      MESSAGE (STATUS "  library path: ${ZLIB_LIBRARY}")
-      MESSAGE (STATUS "  libraries:    zlib")
-    ENDIF (VERBOSE_FIND)
-  ENDIF (NOT ZLIB_FIND_QUIETLY)
-ELSE (ZLIB_FOUND)
-  IF (NOT ZLIB_INCLUDE_DIR)
-    MESSAGE(SEND_ERROR "ZLIB include path was not found.")
-  ENDIF (NOT ZLIB_INCLUDE_DIR)
-  IF (NOT ZLIB_LIBRARY)
-    MESSAGE(SEND_ERROR "ZLIB was not found.")
-    MESSAGE(STATUS "Looked for Z libraries named ${ZLIBS_NAMES}.")
-  ENDIF (NOT ZLIB_LIBRARY)
-ENDIF (ZLIB_FOUND)
-
-MARK_AS_ADVANCED(
-  ZLIB_LIBRARY
-  ZLIB_INCLUDE_DIR
-)
Index: code/branches/buildsystem2/cmake/UseTolua.cmake
===================================================================
--- code/branches/buildsystem2/cmake/UseTolua.cmake	(revision 2509)
+++ code/branches/buildsystem2/cmake/UseTolua.cmake	(revision 2509)
@@ -0,0 +1,49 @@
+#    UseTolua.cmake - CMake Module to generate LUA Bindings with tolua
+#    Copyright (C) 2008  Adrian Friedli
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program; if not, write to the Free Software
+#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+SET(_tolua_executable_name toluaexe_orxonox)
+GET_TARGET_PROPERTY(TOLUA_EXECUTABLE "${_tolua_executable_name}" LOCATION)
+
+MACRO(TOLUA _tolua_package _tolua_srcfiles_varname)
+  # TODO: cleaner arguments handling
+  SET(_tolua_inputfiles ${ARGN})
+  LIST(REMOVE_ITEM _tolua_inputfiles "INPUTFILES")
+
+  SET(_tolua_pkgfile "${CMAKE_CURRENT_BINARY_DIR}/tolua.pkg")
+  SET(_tolua_cxxfile "${CMAKE_CURRENT_BINARY_DIR}/ToluaBind${_tolua_package}.cc")
+  SET(_tolua_hfile   "${CMAKE_CURRENT_BINARY_DIR}/ToluaBind${_tolua_package}.h")
+  SET(${_tolua_srcfiles_varname} ${${_tolua_srcfiles_varname}} "${_tolua_cxxfile}")
+
+  # TODO: check secureness of this temporary file
+  FILE(REMOVE "${_tolua_pkgfile}")
+  FOREACH(_tolua_inputfile ${_tolua_inputfiles})
+    FILE(APPEND "${_tolua_pkgfile}" "\$cfile \"${_tolua_inputfile}\"\n")
+  ENDFOREACH(_tolua_inputfile)
+
+  ADD_CUSTOM_COMMAND(
+    OUTPUT "${_tolua_cxxfile}" "${_tolua_hfile}"
+    COMMAND "${TOLUA_EXECUTABLE}" -n "${_tolua_package}"
+                                  -w "${CMAKE_CURRENT_SOURCE_DIR}"
+                                  -o "${_tolua_cxxfile}"
+                                  -H "${_tolua_hfile}"
+                                  -s "${TOLUA_PARSER_SOURCE}"
+                                     "${_tolua_pkgfile}"
+    DEPENDS "${_tolua_executable_name}" ${TOLUA_PARSER_DEPENDENCIES}
+    IMPLICIT_DEPENDS CXX ${_tolua_inputfiles}
+    WORKING_DIRECTORY "${LIBRARY_OUTPUT_PATH}"
+  )
+ENDMACRO(TOLUA)
