Index: /code/branches/buildsystem2/CMakeLists.txt
===================================================================
--- /code/branches/buildsystem2/CMakeLists.txt	(revision 2611)
+++ /code/branches/buildsystem2/CMakeLists.txt	(revision 2612)
@@ -16,81 +16,11 @@
 SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
 
-# Set binary output directories
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+# Library Config
+INCLUDE(LibraryConfig)
 
-# Set Debug build to default when not having multi-config generator like msvc
-IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
-  SET(CMAKE_BUILD_TYPE "Debug")
-ENDIF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+# Build Config
+INCLUDE(BuildConfig)
 
-############## Platform Config ##################
-
-# Configure platform specific options
-INCLUDE(ConfigPlatforms)
-
-################ Test options ###################
-
-OPTION(ENABLE_TESTS "Enable build tests.")
-IF(ENABLE_TESTS)
-  ENABLE_TESTING()
-ENDIF(ENABLE_TESTS)
-
-OPTION(NETWORK_TESTING_ENABLED "Build network testing tools: i.e. chatclient chatserver and alike.")
-OPTION(NETWORKTRAFFIC_TESTING_ENABLED "Build dummyserver4 and dummyclient4.")
-
-############### Library finding #################
-
-# Performs the search and sets the variables
-
-# Expand the next statement if newer boost versions than 1.36.1 are released
-SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 CACHE STRING "")
-FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem)
-# With MSVC, automatic linking is performed for boost. So wee need to tell
-# the linker where to find them. Also note that when running FindBoost for the
-# first time, it will set ${Boost_LIBRARIES} to "" but afterwards to the libs.
-IF (MSVC)
-  LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
-ENDIF (MSVC)
-FIND_PACKAGE(OGRE REQUIRED)
-FIND_PACKAGE(CEGUI REQUIRED)
-FIND_PACKAGE(ENet REQUIRED)
-FIND_PACKAGE(OpenAL REQUIRED)
-FIND_PACKAGE(ALUT REQUIRED)
-FIND_PACKAGE(OggVorbis REQUIRED)
-FIND_PACKAGE(ZLIB REQUIRED)
-FIND_PACKAGE(DirectX REQUIRED)
-
-# 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}")
-
-# QUIET: Don't require the whole tcl rat tail
-FIND_PACKAGE(TCL QUIET)
-IF(NOT TCL_FOUND)
-  MESSAGE(FATAL_ERROR "Tcl was not found.")
-ENDIF(NOT TCL_FOUND)
-
-# Hide variables created by CMake FindXX scripts
-MARK_AS_ADVANCED(
-  LUA_LIBRARY_lua
-  LUA_LIBRARY_lualib
-  OPENAL_INCLUDE_DIR
-  OPENAL_LIBRARY
-)
-
-############### Orxonox Source ##################
-
+# Creates the actual project
 ADD_SUBDIRECTORY(src)
 
Index: /code/branches/buildsystem2/cmake/BuildConfig.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/BuildConfig.cmake	(revision 2612)
+++ /code/branches/buildsystem2/cmake/BuildConfig.cmake	(revision 2612)
@@ -0,0 +1,101 @@
+ #
+ #   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:
+ #      Reto Grieder
+ #   Co-authors:
+ #      ...
+ #
+
+################ Misc Options ###################
+
+# Set binary output directories
+SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
+# Set Debug build to default when not having multi-config generator like msvc
+IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  SET(CMAKE_BUILD_TYPE "Debug")
+ENDIF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+
+# When searching for debug libraries, this is appended to the libarary name
+SET(LIBRARY_DEBUG_POSTFIX "_d")
+# Sets where to find the binary directory of external libraries
+SET(ORXONOX_LIBRARY_BIN_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+# Working directory for the tolua parser. Adjust for windows because lua.dll has to be there!
+SET(TOLUA_PARSER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+
+OPTION(EXTRA_WARNINGS "Enable some extra warnings (heavily pollutes the output)")
+IF(EXTRA_WARNINGS)
+  SET(ORXONOX_WARNING_FLAGS "-Wextra --Wno-unsued-parameter")
+ELSE(EXTRA_WARNINGS)
+  SET(ORXONOX_WARNING_FLAGS "-Wall")
+ENDIF(EXTRA_WARNINGS)
+
+SET(ORXONOX_MEDIA_DIRECTORY "${CMAKE_SOURCE_DIR}/../media")
+# More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager
+# Render systems may be optional, but at least one has to be found in FindOgre
+SET(OGRE_PLUGINS RenderSystem_GL RenderSystem_Direct3D9 Plugin_ParticleFX)
+IF(WIN32)
+  # CG program manager is probably DirectX related (not available under unix)
+  LIST(APPEND OGRE_PLUGINS Plugin_CgProgramManager)
+ENDIF(WIN32)
+
+# Check the plugins and determine the plugin folder
+# You can give a hint by setting the environment variable ENV{OGRE_PLUGIN_DIR}
+INCLUDE(CheckOGREPlugins)
+
+
+############## Compiler Config ##################
+INCLUDE(BuildConfigGCC)
+INCLUDE(BuildConfigMSVC)
+# User can create his own file if required
+IF(EXISTS ${CMAKE_BINARY_DIR}/BuildConfigUser.cmake)
+  INCLUDE(${CMAKE_BINARY_DIR}/BuildConfigUser)
+ENDIF(EXISTS ${CMAKE_BINARY_DIR}/BuildConfigUser.cmake)
+
+
+################ Test options ###################
+
+OPTION(ENABLE_TESTS "Enable build tests.")
+IF(ENABLE_TESTS)
+  ENABLE_TESTING()
+ENDIF(ENABLE_TESTS)
+
+OPTION(NETWORK_TESTING_ENABLED "Build network testing tools: i.e. chatclient chatserver and alike.")
+OPTION(NETWORKTRAFFIC_TESTING_ENABLED "Build dummyserver4 and dummyclient4.")
+
+
+################### Macros ######################
+
+# Also define macros to easily extend the compiler flags
+# Additional argument is a condition
+MACRO(ADD_CXX_FLAGS _flag _cond)
+  IF(${_cond})
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
+  ENDIF(${_cond})
+ENDMACRO(ADD_CXX_FLAGS _flag)
+MACRO(ADD_C_FLAGS _flag)
+  IF(${_cond})
+    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}")
+  ENDIF(${_cond})
+ENDMACRO(ADD_C_FLAGS _flag)
Index: /code/branches/buildsystem2/cmake/BuildConfigGCC.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/BuildConfigGCC.cmake	(revision 2612)
+++ /code/branches/buildsystem2/cmake/BuildConfigGCC.cmake	(revision 2612)
@@ -0,0 +1,46 @@
+ #
+ #   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:
+ #      Reto Grieder
+ #   Co-authors:
+ #      ...
+ #
+
+###### Default Compiler/Linker Options ##########
+# Most people use GCC to compile orxonox, so use that as default
+
+SET(CMAKE_C_FLAGS   "$ENV{CFLAGS}   ${ORXONOX_WARNING_FLAGS} -fPIC")
+SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC")
+# These flags are added to the flags above
+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 -g -ggdb -DNDEBUG")
+SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG")
+SET(CMAKE_C_FLAGS_MINSIZEREL       "-Os          -DNDEBUG")
+SET(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os          -DNDEBUG")
+
+SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
+SET(CMAKE_EXE_LINKER_FLAGS    " --no-undefined")
+SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
+SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
Index: /code/branches/buildsystem2/cmake/BuildConfigMSVC.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/BuildConfigMSVC.cmake	(revision 2612)
+++ /code/branches/buildsystem2/cmake/BuildConfigMSVC.cmake	(revision 2612)
@@ -0,0 +1,90 @@
+ #
+ #   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:
+ #      Reto Grieder
+ #   Co-authors:
+ #      ...
+ #
+ 
+###################### MSVC config ########################
+# Set the library directories and special options when
+# using Visual Studio.
+###########################################################
+
+IF (MSVC)
+
+  #################### Compiler Flags #####################
+
+  # /MD    Minimal Rebuild
+  # /RTC1  Both basic runtime checks
+  # /MD[d] Multithreaded [debug] DLL
+  # /Zi    Program Database
+  # /ZI    Program Database for Edit & Continue
+  # /WX    Warning Level X
+  # /wdX   Disable specific warning X
+  SET(MSVC_CL_FLAGS "
+    /D WIN32 /D __WIN32__ /D _WIN32 /D _WINDOWS
+    /D BOOST_ALL_DYN_LINK
+    /D OIS_DYNAMIC_LIB
+    /D ZLIB_WINAPI
+    /D LUA_BUILD_AS_DLL
+    /D _CRT_SECURE_NO_WARNINGS
+    /W3
+    /EHsc
+    /wd4522
+    /wd4251
+    /wd4800
+  ")
+  SET(CMAKE_C_FLAGS                  "${MSVC_CL_FLAGS}")
+  SET(CMAKE_CXX_FLAGS                "${MSVC_CL_FLAGS}")
+
+  # Note: ${CMAKE_C_FLAGS} get added to the specific ones
+  SET(MSVC_CL_FLAGS_DEBUG            "/MDd /Od  /Zi /Gm /RTC1")
+  SET(MSVC_CL_FLAGS_RELEASE          "/MD  /MP2 /D TOLUA_RELEASE")
+  SET(CMAKE_C_FLAGS_DEBUG            "${MSVC_CL_FLAGS_DEBUG}")
+  SET(CMAKE_CXX_FLAGS_DEBUG          "${MSVC_CL_FLAGS_DEBUG}")
+  SET(CMAKE_C_FLAGS_RELEASE          "${MSVC_CL_FLAGS_RELEASE} /O2")
+  SET(CMAKE_CXX_FLAGS_RELEASE        "${MSVC_CL_FLAGS_RELEASE} /O2")
+  SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "${MSVC_CL_FLAGS_RELEASE} /O2 /Zi")
+  SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${MSVC_CL_FLAGS_RELEASE} /O2 /Zi")
+  SET(CMAKE_C_FLAGS_MINSIZEREL       "${MSVC_CL_FLAGS_RELEASE} /O1")
+  SET(CMAKE_CXX_FLAGS_MINSIZEREL     "${MSVC_CL_FLAGS_RELEASE} /O1")
+
+  ##################### Linker Flags ######################
+
+  SET(MSVC_LINKER_FLAGS                        "")
+  SET(CMAKE_EXE_LINKER_FLAGS                   "${MSVC_LINKER_FLAGS}")
+  SET(CMAKE_SHARED_LINKER_FLAGS                "${MSVC_LINKER_FLAGS}")
+
+  # Note: ${CMAKE_EXE_LINKER_FLAGS} get added to the specific ones
+  SET(MSVC_LINKER_FLAGS_DEBUG                  "/INCREMENTAL:YES")
+  SET(MSVC_LINKER_FLAGS_RELEASE                "/INCREMENTAL:NO /OPT:REF /OPT:ICF")
+  SET(CMAKE_EXE_LINKER_FLAGS_DEBUG             "${MSVC_LINKER_FLAGS_DEBUG}")
+  SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG          "${MSVC_LINKER_FLAGS_DEBUG}")
+  SET(CMAKE_EXE_LINKER_FLAGS_RELEASE           "${MSVC_LINKER_FLAGS_RELEASE}")
+  SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE        "${MSVC_LINKER_FLAGS_RELEASE}")
+  SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO    "${MSVC_LINKER_FLAGS_RELEASE}")
+  SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${MSVC_LINKER_FLAGS_RELEASE}")
+  SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL        "${MSVC_LINKER_FLAGS_RELEASE}")
+  SET(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL     "${MSVC_LINKER_FLAGS_RELEASE}")
+
+ENDIF (MSVC)
Index: /code/branches/buildsystem2/cmake/CheckOGREPlugins.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/CheckOGREPlugins.cmake	(revision 2612)
+++ /code/branches/buildsystem2/cmake/CheckOGREPlugins.cmake	(revision 2612)
@@ -0,0 +1,70 @@
+IF(WIN32)
+    # On Windows we need only *.dll, not *.lib. Especially the MSVC generator doesn't look for *.dll
+    SET(CMAKE_FIND_LIBRARY_SUFFIXES_STORED ${CMAKE_FIND_LIBRARY_SUFFIXES})
+    SET(CMAKE_FIND_LIBRARY_SUFFIXES .dll)
+ENDIF(WIN32)
+SET(CMAKE_FIND_LIBRARY_PREFIXES_STORED "${CMAKE_FIND_LIBRARY_PREFIXES}")
+SET(CMAKE_FIND_LIBRARY_PREFIXES "")
+
+SET(OGRE_RENDER_SYSTEM_FOUND FALSE)
+FOREACH(_plugin ${OGRE_PLUGINS})
+    FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_OPTIMIZED
+        NAMES ${_plugin}
+        PATHS $ENV{OGRE_HOME} /usr/local /usr
+        PATH_SUFFIXES lib lib/OGRE bin bin/Release bin/release Release release
+    )
+    FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_DEBUG
+        NAMES ${_plugin}${LIBRARY_DEBUG_POSTFIX}
+        PATHS $ENV{OGRE_HOME} /usr/local /usr
+        PATH_SUFFIXES lib lib/OGRE bin bin/Debug bin/debug Debug debug
+    )
+    # We only need at least one render system. Check at the end
+    IF(NOT ${_plugin} MATCHES "RenderSystem")
+        IF(NOT OGRE_PLUGIN_${_plugin}_OPTIMIZED)
+            MESSAGE(FATAL_ERROR "Could not find OGRE plugin named ${_plugin}")
+        ENDIF(NOT OGRE_PLUGIN_${_plugin}_OPTIMIZED)
+    ELSEIF(OGRE_PLUGIN_${_plugin}_OPTIMIZED)
+      SET(OGRE_RENDER_SYSTEM_FOUND TRUE)
+    ENDIF(NOT ${_plugin} MATCHES "RenderSystem")
+
+    IF(OGRE_PLUGIN_${_plugin}_OPTIMIZED)
+        # If debug version is not available, release will do as well
+        IF(NOT OGRE_PLUGIN_${_plugin}_DEBUG)
+            SET(OGRE_PLUGIN_${_plugin}_DEBUG ${OGRE_PLUGIN_${_plugin}_OPTIMIZED} CACHE STRING "" FORCE)
+        ENDIF(NOT OGRE_PLUGIN_${_plugin}_DEBUG)
+        MARK_AS_ADVANCED(OGRE_PLUGIN_${_plugin}_OPTIMIZED OGRE_PLUGIN_${_plugin}_DEBUG)
+
+        ### Set variables to configure orxonox.ini correctly afterwards in bin/ ###
+        # Check and set the folders
+        GET_FILENAME_COMPONENT(_release_folder ${OGRE_PLUGIN_${_plugin}_OPTIMIZED} PATH)
+        IF(OGRE_PLUGINS_FOLDER_RELEASE AND NOT OGRE_PLUGINS_FOLDER_RELEASE STREQUAL _release_folder)
+            MESSAGE(FATAL_ERROR "Ogre release plugins have to be in the same folder!")
+        ENDIF(OGRE_PLUGINS_FOLDER_RELEASE AND NOT OGRE_PLUGINS_FOLDER_RELEASE STREQUAL _release_folder)
+        SET(OGRE_PLUGINS_FOLDER_RELEASE ${_release_folder})
+        GET_FILENAME_COMPONENT(_debug_folder ${OGRE_PLUGIN_${_plugin}_DEBUG} PATH)
+        IF(OGRE_PLUGINS_FOLDER_DEBUG AND NOT OGRE_PLUGINS_FOLDER_DEBUG STREQUAL _debug_folder)
+            MESSAGE(FATAL_ERROR "Ogre debug plugins have to be in the same folder!")
+        ENDIF(OGRE_PLUGINS_FOLDER_DEBUG AND NOT OGRE_PLUGINS_FOLDER_DEBUG STREQUAL _debug_folder)
+        SET(OGRE_PLUGINS_FOLDER_DEBUG ${_debug_folder})
+
+        # Create a list with the plugins for relase and debug configurations
+        LIST(APPEND OGRE_PLUGINS_RELEASE ${_plugin})
+        IF(OGRE_PLUGIN_${_plugin}_DEBUG)
+            LIST(APPEND OGRE_PLUGINS_DEBUG ${_plugin}${LIBRARY_DEBUG_POSTFIX})
+        ELSE(OGRE_PLUGIN_${_plugin}_DEBUG)
+            LIST(APPEND OGRE_PLUGINS_DEBUG ${_plugin})
+        ENDIF(OGRE_PLUGIN_${_plugin}_DEBUG)
+    ENDIF(OGRE_PLUGIN_${_plugin}_OPTIMIZED)
+ENDFOREACH(_plugin)
+IF(NOT OGRE_RENDER_SYSTEM_FOUND)
+    MESSAGE(FATAL_ERROR "Could not find an OGRE render system plugin")
+ENDIF(NOT OGRE_RENDER_SYSTEM_FOUND)
+IF(WIN32)
+    # Restore previous settings (see above before FOREACH)
+    SET(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES_STORED}")
+ENDIF(WIN32)
+SET(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES_STORED}")
+
+# List has to be comma separated for orxonox.ini
+STRING(REPLACE ";" ", " OGRE_PLUGINS_RELEASE "${OGRE_PLUGINS_RELEASE}")
+STRING(REPLACE ";" ", " OGRE_PLUGINS_DEBUG   "${OGRE_PLUGINS_DEBUG}")
Index: de/branches/buildsystem2/cmake/ConfigMSVC.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/ConfigMSVC.cmake	(revision 2611)
+++ 	(revision )
@@ -1,128 +1,0 @@
- #
- #   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:
- #      Reto Grieder
- #   Co-authors:
- #      ...
- #
- 
-###################### MSVC config ########################
-# Set the library directories and special options when
-# using Visual Studio.
-###########################################################
-
-IF (MSVC)
-  MESSAGE(STATUS "Running on MSVC. Using customized paths and options.")
-
-  ###################### Libraries ########################
-
-  # Determine library directory
-  IF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)
-    SET(MSVC_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8")
-  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../lib_dist/vc8/dependencies/orxonox_vc8)
-    SET(MSVC_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/../lib_dist/vc8/dependencies/orxonox_vc8")
-  ELSE(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)
-    MESSAGE(FATAL_ERROR "Could not find dependency directory for the Visual Studio libraries")
-  ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)
-  SET(ORXONOX_LIBRARY_BIN_DIR ${MSVC_LIBRARY_DIR}/bin)
-
-  # Set variables for the include directories and the libraries
-  # Note: When setting ENV${} variables, make sure to use quotes when
-  #       having multiple directories.
-  SET(ENV{BOOST_ROOT}        ${MSVC_LIBRARY_DIR}/boost-1.35.0)
-  SET(ENV{CEGUIDIR}          ${MSVC_LIBRARY_DIR}/cegui-0.6.1)
-  SET(ENV{ENETDIR}           ${MSVC_LIBRARY_DIR}/enet-1.2)
-  SET(ENV{ALUTDIR}           ${MSVC_LIBRARY_DIR}/freealut-1.1.0)
-  SET(ENV{OGGDIR}            ${MSVC_LIBRARY_DIR}/libogg-1.1.3)
-  SET(ENV{VORBISDIR}         ${MSVC_LIBRARY_DIR}/libvorbis-1.2.0)
-  SET(ENV{OPENALDIR}         ${MSVC_LIBRARY_DIR}/openal-1.1)
-  SET(ENV{LUA_DIR}           ${MSVC_LIBRARY_DIR}/lua-5.1.3)
-  SET(ENV{OGRE_HOME}        "${MSVC_LIBRARY_DIR}/ogre-1.4.9;${ORXONOX_LIBRARY_BIN_DIR}")
-  SET(TCL_INCLUDE_PATH       ${MSVC_LIBRARY_DIR}/tcl-8.5.2/include)
-  SET(TCL_LIBRARY            ${MSVC_LIBRARY_DIR}/tcl-8.5.2/lib/tcl85t.lib)
-  # Do some hacking to avoid "Tclsh not found" message
-  SET(TCL_TCLSH              ${MSVC_LIBRARY_DIR}/tcl-8.5.2/lib/tcl85t.lib)
-  SET(ZLIB_INCLUDE_DIR       ${MSVC_LIBRARY_DIR}/zlib-1.2.3/include)
-  SET(ZLIB_LIBRARY optimized ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib.lib
-                   debug     ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib_d.lib)
-  SET(ZLIB_FOUND TRUE)
-
-  #################### Compiler Flags #####################
-
-  # /MD    Minimal Rebuild
-  # /RTC1  Both basic runtime checks
-  # /MD[d] Multithreaded [debug] DLL
-  # /Zi    Program Database
-  # /ZI    Program Database for Edit & Continue
-  # /WX    Warning Level X
-  # /wdX   Disable specific warning X
-  SET(MSVC_CL_FLAGS "
-    /D WIN32 /D __WIN32__ /D _WIN32 /D _WINDOWS
-    /D BOOST_ALL_DYN_LINK
-    /D OIS_DYNAMIC_LIB
-    /D ZLIB_WINAPI
-    /D LUA_BUILD_AS_DLL
-    /D _CRT_SECURE_NO_WARNINGS
-    /W3
-    /EHsc
-    /wd4522
-    /wd4251
-    /wd4800
-  ")
-  SET(CMAKE_C_FLAGS                  "${MSVC_CL_FLAGS}")
-  SET(CMAKE_CXX_FLAGS                "${MSVC_CL_FLAGS}")
-
-  # Note: ${CMAKE_C_FLAGS} get added to the specific ones
-  SET(MSVC_CL_FLAGS_DEBUG            "/MDd /Od  /Zi /Gm /RTC1")
-  SET(MSVC_CL_FLAGS_RELEASE          "/MD  /MP2 /D TOLUA_RELEASE")
-  SET(CMAKE_C_FLAGS_DEBUG            "${MSVC_CL_FLAGS_DEBUG}")
-  SET(CMAKE_CXX_FLAGS_DEBUG          "${MSVC_CL_FLAGS_DEBUG}")
-  SET(CMAKE_C_FLAGS_RELEASE          "${MSVC_CL_FLAGS_RELEASE} /O2")
-  SET(CMAKE_CXX_FLAGS_RELEASE        "${MSVC_CL_FLAGS_RELEASE} /O2")
-  SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "${MSVC_CL_FLAGS_RELEASE} /O2 /Zi")
-  SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${MSVC_CL_FLAGS_RELEASE} /O2 /Zi")
-  SET(CMAKE_C_FLAGS_MINSIZEREL       "${MSVC_CL_FLAGS_RELEASE} /O1")
-  SET(CMAKE_CXX_FLAGS_MINSIZEREL     "${MSVC_CL_FLAGS_RELEASE} /O1")
-
-  ##################### Linker Flags ######################
-
-  SET(MSVC_LINKER_FLAGS                        "")
-  SET(CMAKE_EXE_LINKER_FLAGS                   "${MSVC_LINKER_FLAGS}")
-  SET(CMAKE_SHARED_LINKER_FLAGS                "${MSVC_LINKER_FLAGS}")
-
-  # Note: ${CMAKE_EXE_LINKER_FLAGS} get added to the specific ones
-  SET(MSVC_LINKER_FLAGS_DEBUG                  "/INCREMENTAL:YES")
-  SET(MSVC_LINKER_FLAGS_RELEASE                "/INCREMENTAL:NO /OPT:REF /OPT:ICF")
-  SET(CMAKE_EXE_LINKER_FLAGS_DEBUG             "${MSVC_LINKER_FLAGS_DEBUG}")
-  SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG          "${MSVC_LINKER_FLAGS_DEBUG}")
-  SET(CMAKE_EXE_LINKER_FLAGS_RELEASE           "${MSVC_LINKER_FLAGS_RELEASE}")
-  SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE        "${MSVC_LINKER_FLAGS_RELEASE}")
-  SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO    "${MSVC_LINKER_FLAGS_RELEASE}")
-  SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${MSVC_LINKER_FLAGS_RELEASE}")
-  SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL        "${MSVC_LINKER_FLAGS_RELEASE}")
-  SET(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL     "${MSVC_LINKER_FLAGS_RELEASE}")
-
-  ######################### Misc ##########################
-
-  # Set tolua working directory because lua.dll is not where tolua is
-  SET(TOLUA_PARSER_WORKING_DIRECTORY ${ORXONOX_LIBRARY_BIN_DIR})
-ENDIF (MSVC)
Index: de/branches/buildsystem2/cmake/ConfigMinGW.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/ConfigMinGW.cmake	(revision 2611)
+++ 	(revision )
@@ -1,74 +1,0 @@
- #
- #   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:
- #      Reto Grieder
- #   Co-authors:
- #      ...
- #
- 
-################# MinGW config ####################
-# Set the library directory when using precompiled
-# tarballs for the dependencies under windows
-###################################################
-
-IF (MINGW)
-  MESSAGE(STATUS "Running on MinGW. Using customized paths and options.")
-
-  # Determine library directory
-  IF(EXISTS ${CMAKE_SOURCE_DIR}/libs)
-    SET(MINGW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/libs")
-  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../lis)
-    SET(MINGW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/../libs")
-  ELSE(EXISTS ${CMAKE_SOURCE_DIR}/libs)
-    MESSAGE(FATAL_ERROR "Could not find dependency directory for the MinGW libraries")
-  ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/libs)
-  SET(ORXONOX_LIBRARY_BIN_DIR ${MINGW_LIBRARY_DIR})
-
-  # Note: When setting ENV${} variables, make sure to use quotes when
-  #       having multiple directories.
-  SET(ENV{BOOST_ROOT}    "${MINGW_LIBRARY_DIR}/boost_1_34_1")
-  SET(ENV{CEGUIDIR}      "${MINGW_LIBRARY_DIR}/cegui-0.6.1")
-  SET(ENV{ENETDIR}       "${MINGW_LIBRARY_DIR}/enet-1.1")
-  SET(ENV{ALUTDIR}       "${MINGW_LIBRARY_DIR}/freealut-1.1.0")
-  SET(ENV{OGGDIR}        "${MINGW_LIBRARY_DIR}/libogg-1.1.3;${MINGW_LIBRARY_DIR}/libogg-1.1.3/src/.libs")
-  SET(ENV{VORBISDIR}     "${MINGW_LIBRARY_DIR}/libvorbis-1.2.0;${MINGW_LIBRARY_DIR}/libvorbis-1.2.0/lib/.libs")
-  SET(ENV{OPENALDIR}     "${MINGW_LIBRARY_DIR}/openal-0.0.8/common;${MINGW_LIBRARY_DIR}/openal-0.0.8/src/.libs")
-  SET(ENV{LUA_DIR}       "${MINGW_LIBRARY_DIR}/lua-5.1.3")
-  SET(ENV{OGRE_HOME}     "${MINGW_LIBRARY_DIR}/ogre/OgreMain;${MINGW_LIBRARY_DIR}/ogre/Samples/Common")
-  SET(TCL_INCLUDE_PATH   "${MINGW_LIBRARY_DIR}/tcl8.5.2/generic")
-  SET(TCL_LIBRARY        "${MINGW_LIBRARY_DIR}/tcl8.5.2/win/tcl85.dll")
-  # Do some hacking to avoid "Tclsh not found" message
-  SET(TCL_TCLSH          "${MINGW_LIBRARY_DIR}/tcl8.5.2/win/tcl85.dll")
-  SET(ZLIB_INCLUDE_DIR   "${MINGW_LIBRARY_DIR}/zlib/include")
-  SET(ZLIB_LIBRARY       "${MINGW_LIBRARY_DIR}/zlib/libzlib.a")
-  IF ($ENV{DXSDK_DIR} STREQUAL "")
-    SET(ENV{DXSDK_DIR} "${MINGW_LIBRARY_DIR}/DXSDK")
-  ENDIF ($ENV{DXSDK_DIR} STREQUAL "")
-
-  # MINGW doesn't like the -fPIC flag, reconfigure flags
-  SET(CMAKE_C_FLAGS   "$ENV{CFLAGS}   ${ORXONOX_WARNING_FLAGS}")
-  SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${ORXONOX_WARNING_FLAGS}")
-
-  # Also set the tolua working directory because lua.dll is not where tolua ia
-  SET(TOLUA_PARSER_WORKING_DIRECTORY "${MNGW_LIBRARY_DIR}/lua-5.1.3/lib")
-
-ENDIF (MINGW)
Index: de/branches/buildsystem2/cmake/ConfigPlatforms.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/ConfigPlatforms.cmake	(revision 2611)
+++ 	(revision )
@@ -1,100 +1,0 @@
- #
- #   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:
- #      Reto Grieder
- #   Co-authors:
- #      ...
- #
- 
-# If you want to set specific options for your platform, simply
-# create a file called "ConfigUser.cmake" in the binary folder
-# (see at the bottom of the file)
-
-############ Misc Default Options ###############
-
-# When searching for debug libraries, this is appended to the libarary name
-SET(LIBRARY_DEBUG_POSTFIX "_d")
-# Sets where to find the binary directory of external libraries
-SET(ORXONOX_LIBRARY_BIN_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-# Working directory for the tolua parser. Adjust for windows because lua.dll has to be there!
-SET(TOLUA_PARSER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-
-OPTION(EXTRA_WARNINGS "Enable some extra warnings (heavily pollutes the output)")
-IF(EXTRA_WARNINGS)
-  SET(ORXONOX_WARNING_FLAGS "-Wextra --Wno-unsued-parameter")
-ELSE(EXTRA_WARNINGS)
-  SET(ORXONOX_WARNING_FLAGS "-Wall")
-ENDIF(EXTRA_WARNINGS)
-
-SET(ORXONOX_MEDIA_DIRECTORY "${CMAKE_SOURCE_DIR}/../media")
-# More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager
-# Render systems may be optional, but at least one has to be found in FindOgre
-SET(OGRE_PLUGINS RenderSystem_GL RenderSystem_Direct3D9 Plugin_ParticleFX)
-IF(WIN32)
-  # CG program manager is probably DirectX related (not available under unix)
-  LIST(APPEND OGRE_PLUGINS Plugin_CgProgramManager)
-ENDIF(WIN32)
-
-
-###### Default Compiler/Linker Options ##########
-# Most people use GCC to compile orxonox, so use that as default
-
-SET(CMAKE_C_FLAGS   "$ENV{CFLAGS}   ${ORXONOX_WARNING_FLAGS} -fPIC")
-SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC")
-# These flags are added to the flags above
-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 -g -ggdb -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG")
-SET(CMAKE_C_FLAGS_MINSIZEREL       "-Os          -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os          -DNDEBUG")
-
-SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
-SET(CMAKE_EXE_LINKER_FLAGS    " --no-undefined")
-SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
-SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
-
-# Also define macros to easily extend the compiler flags
-# Additional argument is a condition
-MACRO(ADD_CXX_FLAGS _flag _cond)
-  IF(${_cond})
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
-  ENDIF(${_cond})
-ENDMACRO(ADD_CXX_FLAGS _flag)
-MACRO(ADD_C_FLAGS _flag)
-  IF(${_cond})
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}")
-  ENDIF(${_cond})
-ENDMACRO(ADD_C_FLAGS _flag)
-
-########## Plaform Specific Config ##############
-
-# Set the platform specific options and paths
-INCLUDE(ConfigTardis)
-INCLUDE(ConfigMSVC)
-INCLUDE(ConfigMinGW)
-# User can create his own file if required
-IF(EXISTS ${CMAKE_BINARY_DIR}/ConfigUser.cmake)
-  INCLUDE(${CMAKE_BINARY_DIR}/ConfigUser)
-ENDIF(EXISTS ${CMAKE_BINARY_DIR}/ConfigUser.cmake)
Index: de/branches/buildsystem2/cmake/ConfigTardis.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/ConfigTardis.cmake	(revision 2611)
+++ 	(revision )
@@ -1,31 +1,0 @@
-################# Tardis config #################
-# This code checks whether the current machine  #
-# is an ETH tardis box.                         #
-#################################################
-
-IF (UNIX)
-  FILE(STRINGS /etc/hostname HOSTNAME LIMIT_COUNT 1)
-  IF (${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$")
-    SET (TARDIS ON)
-  ENDIF (${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$")
-ENDIF (UNIX)
-
-IF (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")
-
-  # Note: When setting ENV${} variables, make sure to use quotes when
-  #       having multiple directories.
-  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{CEGUIDIR}    "/usr/pack/cegui-0.5.0-sd;/usr/pack/cegui-0.5.0-sd/i686-debian-linux3.1")
-  SET(ENV{ENETDIR}     "/usr/pack/enet-2007-sd;/usr/pack/enet-2007-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{OGGDIR}      "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
-  SET(ENV{VORBISDIR}   "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
-  SET(ENV{LUA_DIR}     "/usr/pack/lua-5.0.3-sd;/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1")
-  SET(ENV{OGRE_HOME}   "/usr/pack/ogre-1.4.5-sd;/usr/pack/ogre-1.4.5-sd/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(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")
-ENDIF (TARDIS)
Index: /code/branches/buildsystem2/cmake/FindOGRE.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/FindOGRE.cmake	(revision 2611)
+++ /code/branches/buildsystem2/cmake/FindOGRE.cmake	(revision 2612)
@@ -42,80 +42,4 @@
 HandleLibraryTypes(OGRE)
 
-###############################################
-# Also make sure we have the required plugins #
-###############################################
-
-IF(WIN32)
-    # On Windows we need only *.dll, not *.lib. Especially the MSVC generator doesn't look for *.dll
-    SET(CMAKE_FIND_LIBRARY_SUFFIXES_STORED ${CMAKE_FIND_LIBRARY_SUFFIXES})
-    SET(CMAKE_FIND_LIBRARY_SUFFIXES .dll)
-ENDIF(WIN32)
-SET(CMAKE_FIND_LIBRARY_PREFIXES_STORED "${CMAKE_FIND_LIBRARY_PREFIXES}")
-SET(CMAKE_FIND_LIBRARY_PREFIXES "")
-
-SET(OGRE_RENDER_SYSTEM_FOUND FALSE)
-FOREACH(_plugin ${OGRE_PLUGINS})
-    FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_OPTIMIZED
-        NAMES ${_plugin}
-        PATHS $ENV{OGRE_HOME} /usr/local /usr
-        PATH_SUFFIXES lib lib/OGRE bin bin/Release bin/release Release release
-    )
-    FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_DEBUG
-        NAMES ${_plugin}${LIBRARY_DEBUG_POSTFIX}
-        PATHS $ENV{OGRE_HOME} /usr/local /usr
-        PATH_SUFFIXES lib lib/OGRE bin bin/Debug bin/debug Debug debug
-    )
-    # We only need at least one render system. Check at the end
-    IF(NOT ${_plugin} MATCHES "RenderSystem")
-        IF(NOT OGRE_PLUGIN_${_plugin}_OPTIMIZED)
-            MESSAGE(FATAL_ERROR "Could not find OGRE plugin named ${_plugin}")
-        ENDIF(NOT OGRE_PLUGIN_${_plugin}_OPTIMIZED)
-    ELSEIF(OGRE_PLUGIN_${_plugin}_OPTIMIZED)
-      SET(OGRE_RENDER_SYSTEM_FOUND TRUE)
-    ENDIF(NOT ${_plugin} MATCHES "RenderSystem")
-
-    IF(OGRE_PLUGIN_${_plugin}_OPTIMIZED)
-        # If debug version is not available, release will do as well
-        IF(NOT OGRE_PLUGIN_${_plugin}_DEBUG)
-            SET(OGRE_PLUGIN_${_plugin}_DEBUG ${OGRE_PLUGIN_${_plugin}_OPTIMIZED} CACHE STRING "" FORCE)
-        ENDIF(NOT OGRE_PLUGIN_${_plugin}_DEBUG)
-        MARK_AS_ADVANCED(OGRE_PLUGIN_${_plugin}_OPTIMIZED OGRE_PLUGIN_${_plugin}_DEBUG)
-
-        ### Set variables to configure orxonox.ini correctly afterwards in bin/ ###
-        # Check and set the folders
-        GET_FILENAME_COMPONENT(_release_folder ${OGRE_PLUGIN_${_plugin}_OPTIMIZED} PATH)
-        IF(OGRE_PLUGINS_FOLDER_RELEASE AND NOT OGRE_PLUGINS_FOLDER_RELEASE STREQUAL _release_folder)
-            MESSAGE(FATAL_ERROR "Ogre release plugins have to be in the same folder!")
-        ENDIF(OGRE_PLUGINS_FOLDER_RELEASE AND NOT OGRE_PLUGINS_FOLDER_RELEASE STREQUAL _release_folder)
-        SET(OGRE_PLUGINS_FOLDER_RELEASE ${_release_folder})
-        GET_FILENAME_COMPONENT(_debug_folder ${OGRE_PLUGIN_${_plugin}_DEBUG} PATH)
-        IF(OGRE_PLUGINS_FOLDER_DEBUG AND NOT OGRE_PLUGINS_FOLDER_DEBUG STREQUAL _debug_folder)
-            MESSAGE(FATAL_ERROR "Ogre debug plugins have to be in the same folder!")
-        ENDIF(OGRE_PLUGINS_FOLDER_DEBUG AND NOT OGRE_PLUGINS_FOLDER_DEBUG STREQUAL _debug_folder)
-        SET(OGRE_PLUGINS_FOLDER_DEBUG ${_debug_folder})
-
-        # Create a list with the plugins for relase and debug configurations
-        LIST(APPEND OGRE_PLUGINS_RELEASE ${_plugin})
-        IF(OGRE_PLUGIN_${_plugin}_DEBUG)
-            LIST(APPEND OGRE_PLUGINS_DEBUG ${_plugin}${LIBRARY_DEBUG_POSTFIX})
-        ELSE(OGRE_PLUGIN_${_plugin}_DEBUG)
-            LIST(APPEND OGRE_PLUGINS_DEBUG ${_plugin})
-        ENDIF(OGRE_PLUGIN_${_plugin}_DEBUG)
-    ENDIF(OGRE_PLUGIN_${_plugin}_OPTIMIZED)
-ENDFOREACH(_plugin)
-IF(NOT OGRE_RENDER_SYSTEM_FOUND)
-    MESSAGE(FATAL_ERROR "Could not find an OGRE render system plugin")
-ENDIF(NOT OGRE_RENDER_SYSTEM_FOUND)
-IF(WIN32)
-    # Restore previous settings (see above before FOREACH)
-    SET(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES_STORED}")
-ENDIF(WIN32)
-SET(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES_STORED}")
-
-# List has to be comma separated for orxonox.ini
-STRING(REPLACE ";" ", " OGRE_PLUGINS_RELEASE "${OGRE_PLUGINS_RELEASE}")
-STRING(REPLACE ";" ", " OGRE_PLUGINS_DEBUG   "${OGRE_PLUGINS_DEBUG}")
-
-
 MARK_AS_ADVANCED(
     OGRE_LIBRARY
Index: /code/branches/buildsystem2/cmake/LibraryConfig.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/LibraryConfig.cmake	(revision 2612)
+++ /code/branches/buildsystem2/cmake/LibraryConfig.cmake	(revision 2612)
@@ -0,0 +1,51 @@
+INCLUDE(LibraryConfigMinGW)
+INCLUDE(LibraryConfigMSVC)
+INCLUDE(LibraryConfigTardis)
+
+# Performs the search and sets the variables
+
+# Expand the next statement if newer boost versions than 1.36.1 are released
+SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 CACHE STRING "")
+FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem)
+# With MSVC, automatic linking is performed for boost. So wee need to tell
+# the linker where to find them. Also note that when running FindBoost for the
+# first time, it will set ${Boost_LIBRARIES} to "" but afterwards to the libs.
+IF (MSVC)
+  LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
+ENDIF (MSVC)
+FIND_PACKAGE(OGRE REQUIRED)
+FIND_PACKAGE(CEGUI REQUIRED)
+FIND_PACKAGE(ENet REQUIRED)
+FIND_PACKAGE(OpenAL REQUIRED)
+FIND_PACKAGE(ALUT REQUIRED)
+FIND_PACKAGE(OggVorbis REQUIRED)
+FIND_PACKAGE(ZLIB REQUIRED)
+FIND_PACKAGE(DirectX REQUIRED)
+
+# 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}")
+
+# QUIET: Don't require the whole tcl rat tail
+FIND_PACKAGE(TCL QUIET)
+IF(NOT TCL_FOUND)
+  MESSAGE(FATAL_ERROR "Tcl was not found.")
+ENDIF(NOT TCL_FOUND)
+
+# Hide variables created by CMake FindXX scripts
+MARK_AS_ADVANCED(
+  LUA_LIBRARY_lua
+  LUA_LIBRARY_lualib
+  OPENAL_INCLUDE_DIR
+  OPENAL_LIBRARY
+)
Index: /code/branches/buildsystem2/cmake/LibraryConfigMSVC.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/LibraryConfigMSVC.cmake	(revision 2612)
+++ /code/branches/buildsystem2/cmake/LibraryConfigMSVC.cmake	(revision 2612)
@@ -0,0 +1,73 @@
+ #
+ #   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:
+ #      Reto Grieder
+ #   Co-authors:
+ #      ...
+ #
+ 
+###################### MSVC config ########################
+# Set the library directories and special options when
+# using Visual Studio.
+###########################################################
+
+IF (MSVC)
+  MESSAGE(STATUS "Running on MSVC. Using customized paths and options.")
+
+  ###################### Libraries ########################
+
+  # Determine library directory
+  IF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)
+    SET(MSVC_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8")
+  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../lib_dist/vc8/dependencies/orxonox_vc8)
+    SET(MSVC_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/../lib_dist/vc8/dependencies/orxonox_vc8")
+  ELSE(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)
+    MESSAGE(FATAL_ERROR "Could not find dependency directory for the Visual Studio libraries")
+  ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)
+  SET(ORXONOX_LIBRARY_BIN_DIR ${MSVC_LIBRARY_DIR}/bin)
+
+  # Set variables for the include directories and the libraries
+  # Note: When setting ENV${} variables, make sure to use quotes when
+  #       having multiple directories.
+  SET(ENV{BOOST_ROOT}        ${MSVC_LIBRARY_DIR}/boost-1.35.0)
+  SET(ENV{CEGUIDIR}          ${MSVC_LIBRARY_DIR}/cegui-0.6.1)
+  SET(ENV{ENETDIR}           ${MSVC_LIBRARY_DIR}/enet-1.2)
+  SET(ENV{ALUTDIR}           ${MSVC_LIBRARY_DIR}/freealut-1.1.0)
+  SET(ENV{OGGDIR}            ${MSVC_LIBRARY_DIR}/libogg-1.1.3)
+  SET(ENV{VORBISDIR}         ${MSVC_LIBRARY_DIR}/libvorbis-1.2.0)
+  SET(ENV{OPENALDIR}         ${MSVC_LIBRARY_DIR}/openal-1.1)
+  SET(ENV{LUA_DIR}           ${MSVC_LIBRARY_DIR}/lua-5.1.3)
+  SET(ENV{OGRE_HOME}        "${MSVC_LIBRARY_DIR}/ogre-1.4.9;${ORXONOX_LIBRARY_BIN_DIR}")
+  SET(TCL_INCLUDE_PATH       ${MSVC_LIBRARY_DIR}/tcl-8.5.2/include)
+  SET(TCL_LIBRARY            ${MSVC_LIBRARY_DIR}/tcl-8.5.2/lib/tcl85t.lib)
+  # Do some hacking to avoid "Tclsh not found" message
+  SET(TCL_TCLSH              ${MSVC_LIBRARY_DIR}/tcl-8.5.2/lib/tcl85t.lib)
+  SET(ZLIB_INCLUDE_DIR       ${MSVC_LIBRARY_DIR}/zlib-1.2.3/include)
+  SET(ZLIB_LIBRARY optimized ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib.lib
+                   debug     ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib_d.lib)
+  SET(ZLIB_FOUND TRUE)
+
+  ######################### Misc ##########################
+
+  # Set tolua working directory because lua.dll is not where tolua is
+  SET(TOLUA_PARSER_WORKING_DIRECTORY ${ORXONOX_LIBRARY_BIN_DIR})
+ENDIF (MSVC)
Index: /code/branches/buildsystem2/cmake/LibraryConfigMinGW.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/LibraryConfigMinGW.cmake	(revision 2612)
+++ /code/branches/buildsystem2/cmake/LibraryConfigMinGW.cmake	(revision 2612)
@@ -0,0 +1,74 @@
+ #
+ #   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:
+ #      Reto Grieder
+ #   Co-authors:
+ #      ...
+ #
+ 
+################# MinGW config ####################
+# Set the library directory when using precompiled
+# tarballs for the dependencies under windows
+###################################################
+
+IF (MINGW)
+  MESSAGE(STATUS "Running on MinGW. Using customized paths and options.")
+
+  # Determine library directory
+  IF(EXISTS ${CMAKE_SOURCE_DIR}/libs)
+    SET(MINGW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/libs")
+  ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../lis)
+    SET(MINGW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/../libs")
+  ELSE(EXISTS ${CMAKE_SOURCE_DIR}/libs)
+    MESSAGE(FATAL_ERROR "Could not find dependency directory for the MinGW libraries")
+  ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/libs)
+  SET(ORXONOX_LIBRARY_BIN_DIR ${MINGW_LIBRARY_DIR})
+
+  # Note: When setting ENV${} variables, make sure to use quotes when
+  #       having multiple directories.
+  SET(ENV{BOOST_ROOT}    "${MINGW_LIBRARY_DIR}/boost_1_34_1")
+  SET(ENV{CEGUIDIR}      "${MINGW_LIBRARY_DIR}/cegui-0.6.1")
+  SET(ENV{ENETDIR}       "${MINGW_LIBRARY_DIR}/enet-1.1")
+  SET(ENV{ALUTDIR}       "${MINGW_LIBRARY_DIR}/freealut-1.1.0")
+  SET(ENV{OGGDIR}        "${MINGW_LIBRARY_DIR}/libogg-1.1.3;${MINGW_LIBRARY_DIR}/libogg-1.1.3/src/.libs")
+  SET(ENV{VORBISDIR}     "${MINGW_LIBRARY_DIR}/libvorbis-1.2.0;${MINGW_LIBRARY_DIR}/libvorbis-1.2.0/lib/.libs")
+  SET(ENV{OPENALDIR}     "${MINGW_LIBRARY_DIR}/openal-0.0.8/common;${MINGW_LIBRARY_DIR}/openal-0.0.8/src/.libs")
+  SET(ENV{LUA_DIR}       "${MINGW_LIBRARY_DIR}/lua-5.1.3")
+  SET(ENV{OGRE_HOME}     "${MINGW_LIBRARY_DIR}/ogre/OgreMain;${MINGW_LIBRARY_DIR}/ogre/Samples/Common")
+  SET(TCL_INCLUDE_PATH   "${MINGW_LIBRARY_DIR}/tcl8.5.2/generic")
+  SET(TCL_LIBRARY        "${MINGW_LIBRARY_DIR}/tcl8.5.2/win/tcl85.dll")
+  # Do some hacking to avoid "Tclsh not found" message
+  SET(TCL_TCLSH          "${MINGW_LIBRARY_DIR}/tcl8.5.2/win/tcl85.dll")
+  SET(ZLIB_INCLUDE_DIR   "${MINGW_LIBRARY_DIR}/zlib/include")
+  SET(ZLIB_LIBRARY       "${MINGW_LIBRARY_DIR}/zlib/libzlib.a")
+  IF ($ENV{DXSDK_DIR} STREQUAL "")
+    SET(ENV{DXSDK_DIR} "${MINGW_LIBRARY_DIR}/DXSDK")
+  ENDIF ($ENV{DXSDK_DIR} STREQUAL "")
+
+  # MINGW doesn't like the -fPIC flag, reconfigure flags
+  SET(CMAKE_C_FLAGS   "$ENV{CFLAGS}   ${ORXONOX_WARNING_FLAGS}")
+  SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${ORXONOX_WARNING_FLAGS}")
+
+  # Also set the tolua working directory because lua.dll is not where tolua ia
+  SET(TOLUA_PARSER_WORKING_DIRECTORY "${MNGW_LIBRARY_DIR}/lua-5.1.3/lib")
+
+ENDIF (MINGW)
Index: /code/branches/buildsystem2/cmake/LibraryConfigTardis.cmake
===================================================================
--- /code/branches/buildsystem2/cmake/LibraryConfigTardis.cmake	(revision 2612)
+++ /code/branches/buildsystem2/cmake/LibraryConfigTardis.cmake	(revision 2612)
@@ -0,0 +1,31 @@
+################# Tardis config #################
+# This code checks whether the current machine  #
+# is an ETH tardis box.                         #
+#################################################
+
+IF (UNIX)
+  FILE(STRINGS /etc/hostname HOSTNAME LIMIT_COUNT 1)
+  IF (${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$")
+    SET (TARDIS ON)
+  ENDIF (${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$")
+ENDIF (UNIX)
+
+IF (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")
+
+  # Note: When setting ENV${} variables, make sure to use quotes when
+  #       having multiple directories.
+  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{CEGUIDIR}    "/usr/pack/cegui-0.5.0-sd;/usr/pack/cegui-0.5.0-sd/i686-debian-linux3.1")
+  SET(ENV{ENETDIR}     "/usr/pack/enet-2007-sd;/usr/pack/enet-2007-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{OGGDIR}      "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
+  SET(ENV{VORBISDIR}   "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
+  SET(ENV{LUA_DIR}     "/usr/pack/lua-5.0.3-sd;/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1")
+  SET(ENV{OGRE_HOME}   "/usr/pack/ogre-1.4.5-sd;/usr/pack/ogre-1.4.5-sd/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(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")
+ENDIF (TARDIS)
