Index: /code/branches/resource2/CMakeLists.txt
===================================================================
--- /code/branches/resource2/CMakeLists.txt	(revision 5663)
+++ /code/branches/resource2/CMakeLists.txt	(revision 5664)
@@ -17,5 +17,11 @@
  #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  #
- 
+ #
+ #  Author:
+ #    Reto Grieder
+ #  Description:
+ #    Configures some basics and controls the configuration scripts
+ #
+
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
 
@@ -27,7 +33,9 @@
 ENDIF()
 
-
 PROJECT(Orxonox C CXX)
 
+################ General Config #################
+
+# Version info
 SET(ORXONOX_VERSION_MAJOR 0)
 SET(ORXONOX_VERSION_MINOR 0)
@@ -36,7 +44,50 @@
 SET(ORXONOX_VERSION_NAME "Arcturus")
 
+# Standard path suffixes
+SET(DEFAULT_RUNTIME_PATH bin)
+SET(DEFAULT_LIBRARY_PATH lib)
+SET(DEFAULT_ARCHIVE_PATH lib/static)
+SET(DEFAULT_DOC_PATH     doc)
+SET(DEFAULT_DATA_PATH    data)
+SET(DEFAULT_CONFIG_PATH  config)
+SET(DEFAULT_LOG_PATH     log)
 
-# This sets where to look for modules (e.g. "Find*.cmake" files)
+# Set output directories
+SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_RUNTIME_PATH})
+SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH})
+SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH})
+SET(CMAKE_DOC_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_DOC_PATH})
+# Data directories are only inputs, no delclaration here
+SET(CMAKE_CONFIG_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_CONFIG_PATH})
+SET(CMAKE_LOG_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_LOG_PATH})
+
+# Sets where to find the external libraries like OgreMain.dll at runtime
+# On Unix you should not have to change this at all.
+# This only applies to development runs in the build tree
+SET(RUNTIME_LIBRARY_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+
+# Take care of some CMake 2.6.0 leftovers
+MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
+
+# This sets where to look for CMake modules (e.g. "Find*.cmake" files)
 SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+
+# Set Debug build to default when not having multi-config generator like msvc
+IF(NOT CMAKE_CONFIGURATION_TYPES)
+  IF(NOT CMAKE_BUILD_TYPE)
+    SET(CMAKE_BUILD_TYPE Debug CACHE STRING
+        "Build types are: Debug, Release, MinSizeRel, RelWithDebInfo" FORCE)
+  ENDIF()
+  MARK_AS_ADVANCED(CLEAR CMAKE_BUILD_TYPE)
+
+  MESSAGE(STATUS "*** Build type is ${CMAKE_BUILD_TYPE} ***")
+ELSE()
+  IF(CMAKE_BUILD_TYPE)
+    SET(CMAKE_BUILD_TYPE CACHE STRING FORCE)
+  ENDIF()
+  MARK_AS_ADVANCED(CMAKE_BUILD_TYPE)
+ENDIF()
+
+########### Subfolders and Subscripts ###########
 
 # Library finding
@@ -44,5 +95,8 @@
 
 # General build and compiler options and configurations
-INCLUDE(BuildConfig)
+INCLUDE(CompilerConfig)
+
+# Configure installation paths and options
+INCLUDE(InstallConfig)
 
 # Configure data directory location and installation
@@ -55,4 +109,4 @@
 ADD_SUBDIRECTORY(bin)
 
-# Last but not least: Try to make doxygen target
+# Last but not least: Try to make a doc target with Doxygen
 ADD_SUBDIRECTORY(doc)
Index: de/branches/resource2/cmake/BuildConfig.cmake
===================================================================
--- /code/branches/resource2/cmake/BuildConfig.cmake	(revision 5663)
+++ 	(revision )
@@ -1,208 +1,0 @@
- #
- #             ORXONOX - the hottest 3D action shooter ever to exist
- #                             > www.orxonox.net <
- #
- #        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
- #  Description:
- #    Configures the compilers and sets build options.
- #    This also includes handling the OGRE plugins and the data directory.
- #
-
-################# Misc Settings #################
-
-# Standard path suffixes, might not hold everywhere though
-SET(DEFAULT_RUNTIME_PATH bin)
-SET(DEFAULT_LIBRARY_PATH lib)
-SET(DEFAULT_ARCHIVE_PATH lib/static)
-SET(DEFAULT_DOC_PATH     doc)
-SET(DEFAULT_DATA_PATH    data)
-SET(DEFAULT_CONFIG_PATH  config)
-SET(DEFAULT_LOG_PATH     log)
-
-# Set output directories
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_RUNTIME_PATH})
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH})
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH})
-SET(CMAKE_DOC_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_DOC_PATH})
-# Data directories are only inputs
-SET(CMAKE_CONFIG_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_CONFIG_PATH})
-SET(CMAKE_LOG_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_LOG_PATH})
-
-# Take care of some CMake 2.6.0 leftovers
-MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
-
-# Sets where to find the external libraries like OgreMain.dll at runtime
-# On Unix you should not have to change this at all.
-IF(NOT RUNTIME_LIBRARY_DIRECTORY)
-  SET(RUNTIME_LIBRARY_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-ENDIF()
-
-# Set Debug build to default when not having multi-config generator like msvc
-IF(NOT CMAKE_CONFIGURATION_TYPES)
-  IF(NOT CMAKE_BUILD_TYPE)
-    SET(CMAKE_BUILD_TYPE Debug CACHE STRING
-        "Build types are: Debug, Release, MinSizeRel, RelWithDebInfo" FORCE)
-  ENDIF()
-  MARK_AS_ADVANCED(CLEAR CMAKE_BUILD_TYPE)
-
-  MESSAGE(STATUS "*** Build type is ${CMAKE_BUILD_TYPE} ***")
-ELSE()
-  IF(CMAKE_BUILD_TYPE)
-    SET(CMAKE_BUILD_TYPE CACHE STRING FORCE)
-  ENDIF()
-  MARK_AS_ADVANCED(CMAKE_BUILD_TYPE)
-ENDIF()
-
-
-################# OGRE Plugins ##################
-
-# More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager
-SET(OGRE_PLUGINS_INT Plugin_ParticleFX)
-IF(WIN32)
-  # CG program manager is probably DirectX related (not available under unix)
-  LIST(APPEND OGRE_PLUGINS_INT Plugin_CgProgramManager)
-ENDIF(WIN32)
-SET(OGRE_PLUGINS ${OGRE_PLUGINS_INT} CACHE STRING
-   "Specify which OGRE plugins to load. Existance check is performed.")
-
-# Check the plugins and determine the plugin folder
-# You can give a hint by setting the environment variable ENV{OGRE_PLUGIN_DIR}
-INCLUDE(CheckOGREPlugins)
-CHECK_OGRE_PLUGINS(${OGRE_PLUGINS})
-
-
-################ Compiler Config ################
-
-OPTION(EXTRA_COMPILER_WARNINGS "Enable some extra warnings (heavily pollutes the output)" FALSE)
-
-INCLUDE(FlagUtilities)
-
-# Configure the compiler specific build options
-IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
-  INCLUDE(BuildConfigGCC)
-ELSEIF(MSVC)
-  INCLUDE(BuildConfigMSVC)
-ELSE()
-  MESSAGE(STATUS "Warning: Your compiler is not officially supported.")
-ENDIF()
-
-SET(USER_SCRIPT_BUILD_CONFIG "" CACHE FILEPATH
-    "Specify a CMake script if you wish to write your own build config.
-     See BuildConfigGCC.cmake or BuildConfigMSVC.cmake for examples.")
-IF(USER_SCRIPT_BUILD_CONFIG)
-  IF(EXISTS ${CMAKE_MODULE_PATH}/${USER_SCRIPT_BUILD_CONFIG}.cmake)
-    INCLUDE(${USER_SCRIPT_BUILD_CONFIG})
-  ELSEIF(EXISTS ${USER_SCRIPT_BUILD_CONFIG})
-    INCLUDE(${USER_SCRIPT_BUILD_CONFIG})
-  ELSEIF(EXISTS ${CMAKE_MODULE_PATH}/${USER_SCRIPT_BUILD_CONFIG})
-    INCLUDE(${CMAKE_MODULE_PATH}/${USER_SCRIPT_BUILD_CONFIG})
-  ENDIF()
-ENDIF(USER_SCRIPT_BUILD_CONFIG)
-
-
-############# Installation Settings #############
-
-SET(_info_text "Puts all installed files in subfolders of the install prefix path. That root folder can then be moved, copied and renamed as you wish. The executable will not write to folders like ~/.orxonox or \"Applictation Data\"")
-IF(UNIX)
-  OPTION(INSTALL_COPYABLE "${_info_text}" FALSE)
-ELSE()
-  OPTION(INSTALL_COPYABLE "${_info_text}" TRUE)
-ENDIF()
-
-# Default installation paths
-SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH})
-SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
-SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
-SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
-SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DATA_PATH})
-SET(CONFIG_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_CONFIG_PATH})
-SET(LOG_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LOG_PATH})
-
-IF(NOT INSTALL_COPYABLE)
-  IF(UNIX) # Apple too?
-    # Using absolute paths
-    SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)
-    SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/orxonox)
-    SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static)
-    SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
-    SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/share/orxonox)
-  ENDIF()
-
-  # Leave empty because it is user and therefore runtime dependent
-  SET(CONFIG_INSTALL_DIRECTORY)
-  SET(LOG_INSTALL_DIRECTORY)
-ENDIF()
-
-
-################## Unix rpath ###################
-
-# use, i.e. don't skip the full RPATH for the build tree
-SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
-
-# when building, don't use the install RPATH already
-# (but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 
-
-# the RPATH to be used when installing
-IF(INSTALL_COPYABLE)
-  SET(CMAKE_INSTALL_RPATH ${DEFAULT_LIBRARY_PATH})
-ELSE()
-  SET(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_DIRECTORY})
-ENDIF()
-
-# add the automatically determined parts of the RPATH
-# which point to directories outside the build tree to the install RPATH
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-
-
-################ Various options ################
-
-# Enable expensive optimisations: Use this for a binary release build
-OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
-
-# Use WinMain() or main()?
-IF(WIN32)
-  OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)
-ENDIF()
-
-# Global switch to disable Precompiled Header Files
-IF(PCH_COMPILER_SUPPORT)
-  OPTION(PCH_ENABLE "Global PCH switch" TRUE)
-ENDIF()
-
-
-############ Static/Dynamic linking #############
-
-# Default linking is SHARED
-SET(ORXONOX_DEFAULT_LINK SHARED)
-
-# Disable Boost auto linking completely
-ADD_COMPILER_FLAGS("-DBOOST_ALL_NO_LIB")
-
-# If no defines are specified, these libs get linked statically
-ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC)
-ADD_COMPILER_FLAGS("-DENET_DLL"           WIN32 LINK_ENET_DYNAMIC)
-ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL"   WIN32 LINK_LUA_DYNAMIC)
-ADD_COMPILER_FLAGS("-DZLIB_DLL"           WIN32 LINK_ZLIB_DYNAMIC)
-
-# If no defines are specified, these libs get linked dynamically
-# You can change that optionally in the Cache.
-ADD_COMPILER_FLAGS("-DCEGUI_STATIC"       WIN32 NOT LINK_CEGUI_DYNAMIC)
-ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB"    WIN32 NOT LINK_OGRE_DYNAMIC)
-ADD_COMPILER_FLAGS("-DSTATIC_BUILD"       WIN32 NOT LINK_TCL_DYNAMIC)
Index: de/branches/resource2/cmake/BuildConfigGCC.cmake
===================================================================
--- /code/branches/resource2/cmake/BuildConfigGCC.cmake	(revision 5663)
+++ 	(revision )
@@ -1,91 +1,0 @@
- #
- #             ORXONOX - the hottest 3D action shooter ever to exist
- #                             > www.orxonox.net <
- #
- #        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, Adrian Friedli
- #  Description:
- #    Sets the right compiler and linker flags for GCC.
- #
-
-# Shortcut for CMAKE_COMPILER_IS_GNUCXX and ..._GNUC
-SET(CMAKE_COMPILER_IS_GNU TRUE)
-
-# Determine compiler version
-EXEC_PROGRAM(
-  ${CMAKE_CXX_COMPILER}
-  ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
-  OUTPUT_VARIABLE GCC_VERSION
-)
-
-# GCC may not support #pragma GCC system_header correctly when using
-# templates. According to Bugzilla, it was fixed March 07 but tests
-# have confirmed that GCC 4.0.0 does not pose a problem for our cases.
-INCLUDE(CompareVersionStrings)
-COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.0.0" _compare_result)
-IF(_compare_result LESS 0)
-  SET(GCC_NO_SYSTEM_HEADER_SUPPORT TRUE)
-ENDIF()
-
-# GCC only supports PCH in versions 3.4 and above
-INCLUDE(CompareVersionStrings)
-COMPARE_VERSION_STRINGS("${GCC_VERSION}" "3.4.0" _compare_result)
-IF(_compare_result GREATER -1)
-  SET(PCH_COMPILER_SUPPORT TRUE)
-ENDIF()
-
-# Also include environment flags. Could cause conflicts though
-SET_COMPILER_FLAGS("$ENV{CXXFLAGS}" CXX CACHE)
-SET_COMPILER_FLAGS("$ENV{CFLAGS}"   C   CACHE)
-
-# These flags get added to the flags above
-SET_COMPILER_FLAGS("    -g -ggdb -D_DEBUG" Debug          CACHE)
-SET_COMPILER_FLAGS("             -DNDEBUG" ReleaseAll     CACHE)
-ADD_COMPILER_FLAGS("-O3"                   Release        CACHE)
-ADD_COMPILER_FLAGS("-O2 -g -ggdb"          RelWithDebInfo CACHE)
-ADD_COMPILER_FLAGS("-Os"                   MinSizeRel     CACHE)
-
-# CMake doesn't seem to set the PIC flags right on certain 64 bit systems
-IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
-  ADD_COMPILER_FLAGS("-fPIC" CACHE)
-ENDIF()
-
-# We have some uncoformant code, disable an optimisation feature
-ADD_COMPILER_FLAGS("-fno-strict-aliasing" CACHE)
-
-# For GCC older than version 4, do not display sign compare warings
-# because of boost::filesystem (which creates about a hundred per include)
-ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE)
-
-# For newer GCC (4.3 and above), don't display hundreds of annoying deprecated
-# messages. Other versions don't seem to show any such warnings at all.
-ADD_COMPILER_FLAGS("-Wno-deprecated" CXX CACHE)
-
-# Always show why a precompiled header file could not be used
-ADD_COMPILER_FLAGS("-Winvalid-pch" CXX CACHE)
-
-# Increase warning level if requested
-IF(EXTRA_COMPILER_WARNINGS)
-  ADD_COMPILER_FLAGS("-Wall -Wextra -Wno-unused-parameter" CACHE)
-ELSE()
-  REMOVE_COMPILER_FLAGS("-Wextra -Wno-unused-parameter" CACHE)
-  ADD_COMPILER_FLAGS("-Wall" CACHE)
-ENDIF()
-
-# General linker flags
-SET_LINKER_FLAGS("--no-undefined" CACHE)
Index: de/branches/resource2/cmake/BuildConfigMSVC.cmake
===================================================================
--- /code/branches/resource2/cmake/BuildConfigMSVC.cmake	(revision 5663)
+++ 	(revision )
@@ -1,148 +1,0 @@
- #
- #             ORXONOX - the hottest 3D action shooter ever to exist
- #                             > www.orxonox.net <
- #
- #        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
- #  Description:
- #    Sets the right compiler and linker flags for the Microsoft Compiler.
- #
-
-################### Compiler Version ####################
-
-# We make use of variadic macros, which is only supported by MSVC 8 and above
-IF(MSVC_VERSION LESS 1400)
-  MESSAGE(FATAL_ERROR "Microsoft Visual Studio versions below 8 (2005) are not supported because of missing compiler extensions.")
-ENDIF()
-
-
-######################## Options ########################
-
-# Currently VLD has a problem with MSVC9 although it actually is supported
-IF(MSVC80)
-  OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" off)
-ENDIF()
-# Make sure the value is "on" or "off" for vld.ini
-IF(VISUAL_LEAK_DETECTOR_ENABLE)
-  SET(VISUAL_LEAK_DETECTOR_ENABLE on)
-ELSE()
-  SET(VISUAL_LEAK_DETECTOR_ENABLE off)
-ENDIF()
-
-# Orxonox only supports MSVC 8 and above, which gets asserted above
-SET(PCH_COMPILER_SUPPORT 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    General warning Level X
-# -wdX   Disable specific warning X
-# -wnX   Set warning level of specific warning X to level n
-
-# Overwrite CMake default flags first. Be careful with this
-# Only add (not set) the general compiler flags.
-# CMake default flags : -DWIN32 -D_WINDOWS -W3 -Zm1000
-# additionally for CXX: -EHsc -GR
-ADD_COMPILER_FLAGS("-D__WIN32__ -D_WIN32"      CACHE)
-ADD_COMPILER_FLAGS("-D_CRT_SECURE_NO_WARNINGS" CACHE)
-
-# Overwrite CMake default flags here.
-SET_COMPILER_FLAGS("-MDd -Od -Zi -D_DEBUG -Gm -RTC1" Debug          CACHE)
-SET_COMPILER_FLAGS("-MD  -O2     -DNDEBUG -MP2"      Release        CACHE)
-SET_COMPILER_FLAGS("-MD  -O2 -Zi -DNDEBUG -MP2"      RelWithDebInfo CACHE)
-SET_COMPILER_FLAGS("-MD  -O1     -DNDEBUG -MP2"      MinSizeRel     CACHE)
-
-# Microsoft unfortunately couldn't integrate a fix issued while VS 2008 beta 2
-# was being tested into the final release even though a fix existed...
-# And it's actually quite a big issue, you simple can't compile anything.
-# Fortunately for us, disabling Minimal Rebuild solves the problem.
-REMOVE_COMPILER_FLAGS("-Gm" Debug MSVC09 CACHE)
-# And since we have to remove /Gm, let's add /MP2 to speed things up
-ADD_COMPILER_FLAGS("-MP2" Debug MSVC09 CACHE)
-
-
-####################### Warnings ########################
-
-# Increase warning level if requested
-IF(EXTRA_COMPILER_WARNINGS)
-  REMOVE_COMPILER_FLAGS("-W1 -W2 -W3" CACHE)
-  ADD_COMPILER_FLAGS   ("-W4" CACHE)
-ELSE()
-  REMOVE_COMPILER_FLAGS("-W1 -W2 -W4" CACHE)
-  ADD_COMPILER_FLAGS   ("-W3" CACHE)
-ENDIF()
-
-# "<type> needs to have dll-interface to be used by clients'
-# Happens on STL member variables which are not public
-ADD_COMPILER_FLAGS("-w44251" CACHE)
-ADD_COMPILER_FLAGS("-w44275" CACHE) # For inheritance
-
-# Multiple assignment operators specified
-ADD_COMPILER_FLAGS("-w44522" CACHE)
-
-# Forcing values to bool
-ADD_COMPILER_FLAGS("-w44800" CACHE)
-
-# This warns about truncation to 255 characters in debug/browse info
-# ADD_COMPILER_FLAGS("-w44786 -w44503" CACHE)
-
-# conversion from 'double' to 'float', possible loss of data
-# conversion from 'ogg_int64_t' to 'long', possible loss of data
-# ADD_COMPILER_FLAGS("-w44244" CACHE)
-
-# "conversion from 'size_t' to 'unsigned int', possible loss of data
-# ADD_COMPILER_FLAGS("-w44267" CACHE)
-
-# "truncation from 'double' to 'float'
-# ADD_COMPILER_FLAGS("-w44305" CACHE)
-
-# "non dll-interface class used as base for dll-interface class"
-# ADD_COMPILER_FLAGS("-w44275" CACHE)
-
-# "C++ Exception Specification ignored"
-# This is because MSVC 6 did not implement all the C++ exception
-# specifications in the ANSI C++ draft.
-# ADD_COMPILER_FLAGS("-w44290" CACHE)
-
-# "no suitable definition provided for explicit template
-# instantiation request" Occurs in VC7 for no justifiable reason.
-# ADD_COMPILER_FLAGS("-w44661" CACHE)
-
-# Deprecation warnings when using CRT calls in VC8
-# These show up on all C runtime lib code in VC8, disable since they clutter
-# the warnings with things we may not be able to do anything about (e.g.
-# generated code from nvparse etc). I doubt very much that these calls
-# will ever be actually removed from VC anyway, it would break too much code.
-# Note: Probably handled by "-DCRT_SECURE_NO_WARNINGS"
-# ADD_COMPILER_FLAGS("-w44996" CACHE)
-
-# "conditional expression constant"
-# ADD_COMPILER_FLAGS("-w4201" CACHE)
-
-
-##################### Linker Flags ######################
-
-# CMake default flags: -MANIFEST -STACK:10000000 -machine:I386
-# and INCREMENTAL and DEBUG for debug versions
-ADD_LINKER_FLAGS("-OPT:REF -OPT:ICF" Release MinSizeRel CACHE)
-ADD_LINKER_FLAGS("-OPT:NOWIN98" MSVC80 CACHE)
Index: /code/branches/resource2/cmake/CheckOGREPlugins.cmake
===================================================================
--- /code/branches/resource2/cmake/CheckOGREPlugins.cmake	(revision 5663)
+++ /code/branches/resource2/cmake/CheckOGREPlugins.cmake	(revision 5664)
@@ -32,6 +32,6 @@
  #    OGRE_PLUGINS_RELEASE        Names of the release plugins without ext.
  #  Note:
- #    You must not specify render systems as input, but the ones found will be
- #    present in the output variables.
+ #    You must not specify render systems as input. That will be taken care of
+ #    automatically.
  #
 
Index: /code/branches/resource2/cmake/CompilerConfig.cmake
===================================================================
--- /code/branches/resource2/cmake/CompilerConfig.cmake	(revision 5664)
+++ /code/branches/resource2/cmake/CompilerConfig.cmake	(revision 5664)
@@ -0,0 +1,44 @@
+ #
+ #             ORXONOX - the hottest 3D action shooter ever to exist
+ #                             > www.orxonox.net <
+ #
+ #        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
+ #  Description:
+ #    Calls a compiler specific script and sets some options.
+ #
+
+OPTION(EXTRA_COMPILER_WARNINGS "Enable some extra warnings (heavily pollutes the output)" FALSE)
+
+# Configure the compiler specific build options
+IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
+  INCLUDE(CompilerConfigGCC)
+ELSEIF(MSVC)
+  INCLUDE(CompilerConfigMSVC)
+ELSE()
+  MESSAGE(STATUS "Warning: Your compiler is not officially supported.")
+ENDIF()
+
+SET(COMPILER_CONFIG_USER_SCRIPT "" CACHE FILEPATH
+    "Specify a CMake script if you wish to write your own compiler config.
+     See CompilerConfigGCC.cmake or CompilerConfigMSVC.cmake for examples.")
+IF(COMPILER_CONFIG_USER_SCRIPT)
+  IF(EXISTS ${CMAKE_MODULE_PATH}/${COMPILER_CONFIG_USER_SCRIPT})
+    INCLUDE(${CMAKE_MODULE_PATH}/${COMPILER_CONFIG_USER_SCRIPT})
+  ENDIF()
+ENDIF(COMPILER_CONFIG_USER_SCRIPT)
Index: /code/branches/resource2/cmake/CompilerConfigGCC.cmake
===================================================================
--- /code/branches/resource2/cmake/CompilerConfigGCC.cmake	(revision 5664)
+++ /code/branches/resource2/cmake/CompilerConfigGCC.cmake	(revision 5664)
@@ -0,0 +1,93 @@
+ #
+ #             ORXONOX - the hottest 3D action shooter ever to exist
+ #                             > www.orxonox.net <
+ #
+ #        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, Adrian Friedli
+ #  Description:
+ #    Sets the right compiler and linker flags for GCC.
+ #
+
+INCLUDE(FlagUtilities)
+
+# Shortcut for CMAKE_COMPILER_IS_GNUCXX and ..._GNUC
+SET(CMAKE_COMPILER_IS_GNU TRUE)
+
+# Determine compiler version
+EXEC_PROGRAM(
+  ${CMAKE_CXX_COMPILER}
+  ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
+  OUTPUT_VARIABLE GCC_VERSION
+)
+
+# GCC may not support #pragma GCC system_header correctly when using
+# templates. According to Bugzilla, it was fixed March 07 but tests
+# have confirmed that GCC 4.0.0 does not pose a problem for our cases.
+INCLUDE(CompareVersionStrings)
+COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.0.0" _compare_result)
+IF(_compare_result LESS 0)
+  SET(GCC_NO_SYSTEM_HEADER_SUPPORT TRUE)
+ENDIF()
+
+# GCC only supports PCH in versions 3.4 and above
+INCLUDE(CompareVersionStrings)
+COMPARE_VERSION_STRINGS("${GCC_VERSION}" "3.4.0" _compare_result)
+IF(_compare_result GREATER -1)
+  SET(PCH_COMPILER_SUPPORT TRUE)
+ENDIF()
+
+# Also include environment flags. Could cause conflicts though
+SET_COMPILER_FLAGS("$ENV{CXXFLAGS}" CXX CACHE)
+SET_COMPILER_FLAGS("$ENV{CFLAGS}"   C   CACHE)
+
+# These flags get added to the flags above
+SET_COMPILER_FLAGS("    -g -ggdb -D_DEBUG" Debug          CACHE)
+SET_COMPILER_FLAGS("             -DNDEBUG" ReleaseAll     CACHE)
+ADD_COMPILER_FLAGS("-O3"                   Release        CACHE)
+ADD_COMPILER_FLAGS("-O2 -g -ggdb"          RelWithDebInfo CACHE)
+ADD_COMPILER_FLAGS("-Os"                   MinSizeRel     CACHE)
+
+# CMake doesn't seem to set the PIC flags right on certain 64 bit systems
+IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+  ADD_COMPILER_FLAGS("-fPIC" CACHE)
+ENDIF()
+
+# We have some uncoformant code, disable an optimisation feature
+ADD_COMPILER_FLAGS("-fno-strict-aliasing" CACHE)
+
+# For GCC older than version 4, do not display sign compare warings
+# because of boost::filesystem (which creates about a hundred per include)
+ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE)
+
+# For newer GCC (4.3 and above), don't display hundreds of annoying deprecated
+# messages. Other versions don't seem to show any such warnings at all.
+ADD_COMPILER_FLAGS("-Wno-deprecated" CXX CACHE)
+
+# Always show why a precompiled header file could not be used
+ADD_COMPILER_FLAGS("-Winvalid-pch" CXX CACHE)
+
+# Increase warning level if requested
+IF(EXTRA_COMPILER_WARNINGS)
+  ADD_COMPILER_FLAGS("-Wall -Wextra -Wno-unused-parameter" CACHE)
+ELSE()
+  REMOVE_COMPILER_FLAGS("-Wextra -Wno-unused-parameter" CACHE)
+  ADD_COMPILER_FLAGS("-Wall" CACHE)
+ENDIF()
+
+# General linker flags
+SET_LINKER_FLAGS("--no-undefined" CACHE)
Index: /code/branches/resource2/cmake/CompilerConfigMSVC.cmake
===================================================================
--- /code/branches/resource2/cmake/CompilerConfigMSVC.cmake	(revision 5664)
+++ /code/branches/resource2/cmake/CompilerConfigMSVC.cmake	(revision 5664)
@@ -0,0 +1,150 @@
+ #
+ #             ORXONOX - the hottest 3D action shooter ever to exist
+ #                             > www.orxonox.net <
+ #
+ #        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
+ #  Description:
+ #    Sets the right compiler and linker flags for the Microsoft Compiler.
+ #
+
+INCLUDE(FlagUtilities)
+
+################### Compiler Version ####################
+
+# We make use of variadic macros, which is only supported by MSVC 8 and above
+IF(MSVC_VERSION LESS 1400)
+  MESSAGE(FATAL_ERROR "Microsoft Visual Studio versions below 8 (2005) are not supported because of missing compiler extensions.")
+ENDIF()
+
+
+######################## Options ########################
+
+# Currently VLD has a problem with MSVC9 although it actually is supported
+IF(MSVC80)
+  OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" off)
+ENDIF()
+# Make sure the value is "on" or "off" for vld.ini
+IF(VISUAL_LEAK_DETECTOR_ENABLE)
+  SET(VISUAL_LEAK_DETECTOR_ENABLE on)
+ELSE()
+  SET(VISUAL_LEAK_DETECTOR_ENABLE off)
+ENDIF()
+
+# Orxonox only supports MSVC 8 and above, which gets asserted above
+SET(PCH_COMPILER_SUPPORT 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    General warning Level X
+# -wdX   Disable specific warning X
+# -wnX   Set warning level of specific warning X to level n
+
+# Overwrite CMake default flags first. Be careful with this
+# Only add (not set) the general compiler flags.
+# CMake default flags : -DWIN32 -D_WINDOWS -W3 -Zm1000
+# additionally for CXX: -EHsc -GR
+ADD_COMPILER_FLAGS("-D__WIN32__ -D_WIN32"      CACHE)
+ADD_COMPILER_FLAGS("-D_CRT_SECURE_NO_WARNINGS" CACHE)
+
+# Overwrite CMake default flags here.
+SET_COMPILER_FLAGS("-MDd -Od -Zi -D_DEBUG -Gm -RTC1" Debug          CACHE)
+SET_COMPILER_FLAGS("-MD  -O2     -DNDEBUG -MP2"      Release        CACHE)
+SET_COMPILER_FLAGS("-MD  -O2 -Zi -DNDEBUG -MP2"      RelWithDebInfo CACHE)
+SET_COMPILER_FLAGS("-MD  -O1     -DNDEBUG -MP2"      MinSizeRel     CACHE)
+
+# Microsoft unfortunately couldn't integrate a fix issued while VS 2008 beta 2
+# was being tested into the final release even though a fix existed...
+# And it's actually quite a big issue, you simple can't compile anything.
+# Fortunately for us, disabling Minimal Rebuild solves the problem.
+REMOVE_COMPILER_FLAGS("-Gm" Debug MSVC09 CACHE)
+# And since we have to remove /Gm, let's add /MP2 to speed things up
+ADD_COMPILER_FLAGS("-MP2" Debug MSVC09 CACHE)
+
+
+####################### Warnings ########################
+
+# Increase warning level if requested
+IF(EXTRA_COMPILER_WARNINGS)
+  REMOVE_COMPILER_FLAGS("-W1 -W2 -W3" CACHE)
+  ADD_COMPILER_FLAGS   ("-W4" CACHE)
+ELSE()
+  REMOVE_COMPILER_FLAGS("-W1 -W2 -W4" CACHE)
+  ADD_COMPILER_FLAGS   ("-W3" CACHE)
+ENDIF()
+
+# "<type> needs to have dll-interface to be used by clients'
+# Happens on STL member variables which are not public
+ADD_COMPILER_FLAGS("-w44251" CACHE)
+ADD_COMPILER_FLAGS("-w44275" CACHE) # For inheritance
+
+# Multiple assignment operators specified
+ADD_COMPILER_FLAGS("-w44522" CACHE)
+
+# Forcing values to bool
+ADD_COMPILER_FLAGS("-w44800" CACHE)
+
+# This warns about truncation to 255 characters in debug/browse info
+# ADD_COMPILER_FLAGS("-w44786 -w44503" CACHE)
+
+# conversion from 'double' to 'float', possible loss of data
+# conversion from 'ogg_int64_t' to 'long', possible loss of data
+# ADD_COMPILER_FLAGS("-w44244" CACHE)
+
+# "conversion from 'size_t' to 'unsigned int', possible loss of data
+# ADD_COMPILER_FLAGS("-w44267" CACHE)
+
+# "truncation from 'double' to 'float'
+# ADD_COMPILER_FLAGS("-w44305" CACHE)
+
+# "non dll-interface class used as base for dll-interface class"
+# ADD_COMPILER_FLAGS("-w44275" CACHE)
+
+# "C++ Exception Specification ignored"
+# This is because MSVC 6 did not implement all the C++ exception
+# specifications in the ANSI C++ draft.
+# ADD_COMPILER_FLAGS("-w44290" CACHE)
+
+# "no suitable definition provided for explicit template
+# instantiation request" Occurs in VC7 for no justifiable reason.
+# ADD_COMPILER_FLAGS("-w44661" CACHE)
+
+# Deprecation warnings when using CRT calls in VC8
+# These show up on all C runtime lib code in VC8, disable since they clutter
+# the warnings with things we may not be able to do anything about (e.g.
+# generated code from nvparse etc). I doubt very much that these calls
+# will ever be actually removed from VC anyway, it would break too much code.
+# Note: Probably handled by "-DCRT_SECURE_NO_WARNINGS"
+# ADD_COMPILER_FLAGS("-w44996" CACHE)
+
+# "conditional expression constant"
+# ADD_COMPILER_FLAGS("-w4201" CACHE)
+
+
+##################### Linker Flags ######################
+
+# CMake default flags: -MANIFEST -STACK:10000000 -machine:I386
+# and INCREMENTAL and DEBUG for debug versions
+ADD_LINKER_FLAGS("-OPT:REF -OPT:ICF" Release MinSizeRel CACHE)
+ADD_LINKER_FLAGS("-OPT:NOWIN98" MSVC80 CACHE)
Index: /code/branches/resource2/cmake/InstallConfig.cmake
===================================================================
--- /code/branches/resource2/cmake/InstallConfig.cmake	(revision 5664)
+++ /code/branches/resource2/cmake/InstallConfig.cmake	(revision 5664)
@@ -0,0 +1,72 @@
+ #
+ #             ORXONOX - the hottest 3D action shooter ever to exist
+ #                             > www.orxonox.net <
+ #
+ #        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
+ #  Description:
+ #    Configures the installation (paths, rpaths, options)
+ #
+
+SET(_info_text "Puts all installed files in subfolders of the install prefix path. That root folder can then be moved, copied and renamed as you wish. The executable will not write to folders like ~/.orxonox or \"Applictation Data\"")
+IF(UNIX)
+  OPTION(INSTALL_COPYABLE "${_info_text}" FALSE)
+ELSE()
+  OPTION(INSTALL_COPYABLE "${_info_text}" TRUE)
+ENDIF()
+
+# Default installation paths
+SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH})
+SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
+SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
+SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
+SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DATA_PATH})
+SET(CONFIG_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_CONFIG_PATH})
+SET(LOG_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LOG_PATH})
+
+IF(NOT INSTALL_COPYABLE)
+  IF(UNIX) # Apple too?
+    # Using absolute paths
+    SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)
+    SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/orxonox)
+    SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static)
+    SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
+    SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/share/orxonox)
+  ENDIF()
+
+  # Leave empty because it is user and therefore runtime dependent
+  SET(CONFIG_INSTALL_DIRECTORY)
+  SET(LOG_INSTALL_DIRECTORY)
+ENDIF()
+
+################## Unix rpath ###################
+
+# When building, don't use the install RPATH already
+# (but later on when installing)
+SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 
+
+# The RPATH to be used when installing
+IF(INSTALL_COPYABLE)
+  SET(CMAKE_INSTALL_RPATH ${DEFAULT_LIBRARY_PATH})
+ELSE()
+  SET(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_DIRECTORY})
+ENDIF()
+
+# Add the automatically determined parts of the RPATH
+# which point to directories outside the build tree to the install RPATH
+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
Index: /code/branches/resource2/cmake/LibraryConfig.cmake
===================================================================
--- /code/branches/resource2/cmake/LibraryConfig.cmake	(revision 5663)
+++ /code/branches/resource2/cmake/LibraryConfig.cmake	(revision 5664)
@@ -31,5 +31,5 @@
 # Prevent CMake from finding libraries in the installation folder on Windows.
 # There might already be an installation from another compiler
-IF(DEPENDENCY_PACKAGE_ENABLE)
+IF(WIN32)
   LIST(REMOVE_ITEM CMAKE_SYSTEM_PREFIX_PATH  "${CMAKE_INSTALL_PREFIX}")
   LIST(REMOVE_ITEM CMAKE_SYSTEM_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/bin")
@@ -72,16 +72,12 @@
 
 # User script
-SET(USER_SCRIPT_LIBRARY_CONFIG "" CACHE FILEPATH
+SET(LIBRARY_CONFIG_USER_SCRIPT "" CACHE FILEPATH
     "Specify a CMake script if you wish to write your own library path config.
-     See LibraryConfigTardis.cmake or LibraryConfigMinGW.cmake for examples.")
-IF(USER_SCRIPT_LIBRARY_CONFIG)
-  IF(EXISTS ${CMAKE_MODULE_PATH}/${USER_SCRIPT_LIBRARY_CONFIG}.cmake)
-    INCLUDE(${USER_SCRIPT_LIBRARY_CONFIG})
-  ELSEIF(EXISTS ${USER_SCRIPT_LIBRARY_CONFIG})
-    INCLUDE(${USER_SCRIPT_LIBRARY_CONFIG})
-  ELSEIF(EXISTS ${CMAKE_MODULE_PATH}/${USER_SCRIPT_LIBRARY_CONFIG})
-    INCLUDE(${CMAKE_MODULE_PATH}/${USER_SCRIPT_LIBRARY_CONFIG})
-  ENDIF()
-ENDIF(USER_SCRIPT_LIBRARY_CONFIG)
+     See LibraryConfigTardis.cmake for an example.")
+IF(LIBRARY_CONFIG_USER_SCRIPT)
+  IF(EXISTS ${CMAKE_MODULE_PATH}/${LIBRARY_CONFIG_USER_SCRIPT})
+    INCLUDE(${CMAKE_MODULE_PATH}/${LIBRARY_CONFIG_USER_SCRIPT})
+  ENDIF()
+ENDIF(LIBRARY_CONFIG_USER_SCRIPT)
 
 
@@ -185,2 +181,20 @@
   ENDIF()
 ENDIF(WIN32)
+
+
+################# OGRE Plugins ##################
+
+# More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager
+SET(OGRE_PLUGINS_INT Plugin_ParticleFX)
+IF(WIN32)
+  # CG program manager is probably DirectX related (not available under unix)
+  LIST(APPEND OGRE_PLUGINS_INT Plugin_CgProgramManager)
+ENDIF(WIN32)
+SET(OGRE_PLUGINS ${OGRE_PLUGINS_INT} CACHE STRING
+   "Specify which OGRE plugins to load. Existance check is performed.")
+
+# Check the plugins and determine the plugin folder
+# You can give a hint by setting the environment variable ENV{OGRE_PLUGIN_DIR}
+INCLUDE(CheckOGREPlugins)
+CHECK_OGRE_PLUGINS(${OGRE_PLUGINS})
+
Index: /code/branches/resource2/src/CMakeLists.txt
===================================================================
--- /code/branches/resource2/src/CMakeLists.txt	(revision 5663)
+++ /code/branches/resource2/src/CMakeLists.txt	(revision 5664)
@@ -17,72 +17,36 @@
  #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  #
+ #
+ #  Author:
+ #    Reto Grieder
+ #  Description:
+ #    Configures the compilers and sets build options.
+ #
 
-################ Various Options ################
-
-# various macro includes
+# Required macros and functions
 INCLUDE(FlagUtilities)
 INCLUDE(TargetUtilities)
 
+# Configure the two headers and set some options
+INCLUDE(OrxonoxConfig.cmake)
+
+################ Library Defines ################
+
+# Disable Boost auto linking completely
+ADD_COMPILER_FLAGS("-DBOOST_ALL_NO_LIB")
+
+# If no defines are specified, these libs get linked statically
+ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC)
+ADD_COMPILER_FLAGS("-DENET_DLL"           WIN32 LINK_ENET_DYNAMIC)
+ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL"   WIN32 LINK_LUA_DYNAMIC)
+ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB")
+ADD_COMPILER_FLAGS("-DZLIB_DLL"           WIN32 LINK_ZLIB_DYNAMIC)
+# If no defines are specified, these libs get linked dynamically
+ADD_COMPILER_FLAGS("-DCEGUI_STATIC"       WIN32 NOT LINK_CEGUI_DYNAMIC)
+ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB"    WIN32 NOT LINK_OGRE_DYNAMIC)
+ADD_COMPILER_FLAGS("-DSTATIC_BUILD"       WIN32 NOT LINK_TCL_DYNAMIC)
+
 # Use TinyXML++
 ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP")
-# OIS dynamic linking requires macro definition, at least for Windows
-ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB")
-
-################ OrxonoxConfig.h ################
-
-# Check endianness
-INCLUDE(TestBigEndian)
-TEST_BIG_ENDIAN(ORXONOX_BIG_ENDIAN)
-IF(NOT ORXONOX_BIG_ENDIAN)
-  SET(ORXONOX_LITTLE_ENDIAN TRUE)
-ENDIF()
-
-# 32/64 bit system check
-IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
-  SET(ORXONOX_ARCH_64 TRUE)
-ELSE()
-  SET(ORXONOX_ARCH_32 TRUE)
-ENDIF()
-
-# Platforms
-SET(ORXONOX_PLATFORM_WINDOWS ${WIN32})
-SET(ORXONOX_PLATFORM_APPLE ${APPLE})
-SET(ORXONOX_PLATFORM_UNIX ${UNIX})
-IF(UNIX AND NOT APPLE)
-  SET(ORXONOX_PLATFORM_LINUX TRUE)
-ENDIF()
-
-# Check __forceinline
-IF(MSVC)
-  INCLUDE(CheckCXXSourceCompiles)
-  SET(_source "int main() { return 0; } __forceinline void test() { return; }")
-  CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE)
-ENDIF(MSVC)
-
-# Check ciso646 include (literal operators)
-INCLUDE(CheckIncludeFileCXX)
-CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
-
-# XCode and Visual Studio support multiple configurations. In order to tell the
-# which one we have to define the macros separately for each configuration
-ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
-ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release"        Release)
-ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
-ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
-
-SET(GENERATED_FILE_COMMENT
-   "DO NOT EDIT THIS FILE! <br>
-    It has been automatically generated by CMake from OrxonoxConfig.h.in")
-# Copy and configure OrxonoxConfig which gets included in every file
-CONFIGURE_FILE(OrxonoxConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h)
-# This file only gets included by very few classes to avoid a large recompilation
-CONFIGURE_FILE(SpecialConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h)
-
-SET(ORXONOX_CONFIG_FILES
-  ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/OrxonoxConfig.h.in
-  ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/SpecialConfig.h.in
-)
 
 ############## Include Directories ##############
Index: /code/branches/resource2/src/OrxonoxConfig.cmake
===================================================================
--- /code/branches/resource2/src/OrxonoxConfig.cmake	(revision 5664)
+++ /code/branches/resource2/src/OrxonoxConfig.cmake	(revision 5664)
@@ -0,0 +1,106 @@
+ #
+ #             ORXONOX - the hottest 3D action shooter ever to exist
+ #                             > www.orxonox.net <
+ #
+ #        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
+ #  Description:
+ #    Configures the header files OrxonoxConfig.h and SpecialConfig.h
+ #    and sets some other options. All the build related options should be
+ #    found and set here if possible.
+ #
+
+#################### Options ####################
+
+# Default linking is SHARED
+SET(ORXONOX_DEFAULT_LINK SHARED)
+
+# Use, i.e. don't skip the full RPATH for the build tree
+SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
+
+# Global switch to disable Precompiled Header Files
+IF(PCH_COMPILER_SUPPORT)
+  OPTION(PCH_ENABLE "Global PCH switch" TRUE)
+ENDIF()
+
+# Enable expensive optimisations: use this for a binary release build
+OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
+
+# Use WinMain() or main()?
+IF(WIN32)
+  OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)
+ENDIF()
+
+################ Platform Config ################
+
+# Check endianness
+INCLUDE(TestBigEndian)
+TEST_BIG_ENDIAN(ORXONOX_BIG_ENDIAN)
+IF(NOT ORXONOX_BIG_ENDIAN)
+  SET(ORXONOX_LITTLE_ENDIAN TRUE)
+ENDIF()
+
+# 32/64 bit system check
+IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+  SET(ORXONOX_ARCH_64 TRUE)
+ELSE()
+  SET(ORXONOX_ARCH_32 TRUE)
+ENDIF()
+
+# Platforms
+SET(ORXONOX_PLATFORM_WINDOWS ${WIN32})
+SET(ORXONOX_PLATFORM_APPLE ${APPLE})
+SET(ORXONOX_PLATFORM_UNIX ${UNIX})
+IF(UNIX AND NOT APPLE)
+  SET(ORXONOX_PLATFORM_LINUX TRUE)
+ENDIF()
+
+# Check __forceinline
+IF(MSVC)
+  INCLUDE(CheckCXXSourceCompiles)
+  SET(_source "int main() { return 0; } __forceinline void test() { return; }")
+  CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE)
+ENDIF(MSVC)
+
+# Check iso646.h include (literal operators)
+INCLUDE(CheckIncludeFileCXX)
+CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
+
+# XCode and Visual Studio support multiple configurations. In order to tell
+# about the active one we have to define the macro for each configuration
+ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
+ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release"        Release)
+ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
+ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
+
+############## Configured Headers ###############
+
+SET(GENERATED_FILE_COMMENT
+   "DO NOT EDIT THIS FILE! <br>
+    It has been automatically generated by CMake from OrxonoxConfig.h.in")
+# Copy and configure OrxonoxConfig which gets included in every file
+CONFIGURE_FILE(OrxonoxConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h)
+# This file only gets included by very few classes to avoid a large recompilation
+CONFIGURE_FILE(SpecialConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h)
+
+SET(ORXONOX_CONFIG_FILES
+  ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/OrxonoxConfig.h.in
+  ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/SpecialConfig.h.in
+)
