Index: code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake	(revision 8071)
@@ -53,10 +53,10 @@
       NAMES ${_plugin}
       PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
-      PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin
+      PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin Ogre.framework/Resources
     )
     FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_DEBUG
       NAMES ${_plugin}d ${_plugin}_d ${_plugin}
       PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
-      PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin
+      PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin Ogre.framework/Resources
     )
     # We only need at least one render system. Check at the end.
Index: code/branches/kicklib/cmake/tools/CheckPackageVersion.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/CheckPackageVersion.cmake	(revision 8071)
+++ code/branches/kicklib/cmake/tools/CheckPackageVersion.cmake	(revision 8071)
@@ -0,0 +1,66 @@
+ #
+ #             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:
+ #    Check package version info
+ #    MAJOR: Breaking change
+ #    MINOR: No breaking changes by the dependency package
+ #           For example any code running on 3.0 should still run on 3.1
+ #           But you can specify that the code only runs on 3.1 and higher
+ #           or 4.0 and higher (so both 3.1 and 4.0 will work).
+
+MACRO(CHECK_PACKAGE_VERSION)
+  SET(_allowed_minimum_versions ${ARGN})
+
+  IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)
+    SET(DEPENDENCY_VERSION 1.0)
+  ELSE()
+    # Get version from file
+    FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content)
+    SET(_match)
+    STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content})
+    IF(_match)
+      SET(DEPENDENCY_VERSION ${_match})
+    ELSE()
+      MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.")
+    ENDIF()
+  ENDIF()
+  
+  INCLUDE(CompareVersionStrings)
+  SET(_version_match FALSE)
+  FOREACH(_version ${_allowed_minimum_versions})
+    # Get major version
+    STRING(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _major_version "${_version}")
+    COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_major_version} _result TRUE)
+    IF(_result EQUAL 0)
+      COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_version} _result FALSE)
+      IF(NOT _result LESS 0)
+        SET(_version_match TRUE)
+      ENDIF()
+    ENDIF()
+  ENDFOREACH(_version)
+  IF(NOT _version_match)
+    MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n"
+            "Possible required versions: ${_allowed_minimum_versions}\n"
+            "You can get a new version from www.orxonox.net")
+  ENDIF()
+  
+ENDMACRO(CHECK_PACKAGE_VERSION)
Index: code/branches/kicklib/cmake/tools/FindALUT.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/FindALUT.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/tools/FindALUT.cmake	(revision 8071)
@@ -1,72 +1,44 @@
-# - Locate FreeAlut
+# Find ALUT includes and library
+#
 # This module defines
-#  ALUT_LIBRARY
-#  ALUT_FOUND, if false, do not try to link against Alut
-#  ALUT_INCLUDE_DIR, where to find the headers
+#  ALUT_INCLUDE_DIR
+#  ALUT_LIBRARY, the library to link against to use ALUT.
+#  ALUT_FOUND, If false, do not try to use ALUT
 #
-# $ALUTDIR is an environment variable that would
-# correspond to the ./configure --prefix=$ALUTDIR
-# used in building Alut.
+# Copyright © 2007, Matt Williams
+# Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture
+# of the ETH Zurich (removed later on)
 #
-# Created by Eric Wing. This was influenced by the FindSDL.cmake module.
-# On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of
-# ALUT_LIBRARY to override this selection.
-# Tiger will include OpenAL as part of the System.
-# But for now, we have to look around.
-# Other (Unix) systems should be able to utilize the non-framework paths.
+# Redistribution and use is allowed according to the terms of the BSD license.
 #
 # Several changes and additions by Fabian 'x3n' Landau
-# Some simplifications by Adrian Friedli and Reto Grieder
+# Lots of simplifications by Adrian Friedli
+# Version checking by Reto Grieder
+# Adaption of the OGRE find script to ALUT by Kevin Young
 #                 > www.orxonox.net <
 
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(FindPackageHandleAdvancedArgs)
 INCLUDE(HandleLibraryTypes)
 
-FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
-  PATHS
-  $ENV{ALUTDIR}
-  ~/Library/Frameworks/OpenAL.framework
-  /Library/Frameworks/OpenAL.framework
-  /System/Library/Frameworks/OpenAL.framework # Tiger
-  PATH_SUFFIXES include include/OpenAL include/AL Headers
+FIND_PATH(ALUT_INCLUDE_DIR alut.h
+  PATHS $ENV{ALUTDIR}
+  PATH_SUFFIXES include include/AL ALUT
+)
+FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
+  NAMES ALUT alut
+  PATHS $ENV{ALUTDIR}
+  PATH_SUFFIXES lib bin/Release bin/release Release release ALUT
+)
+FIND_LIBRARY(ALUT_LIBRARY_DEBUG
+  NAMES ALUTD alutd alut_d alutD alut_D
+  PATHS $ENV{ALUTDIR}
+  PATH_SUFFIXES lib bin/Debug bin/debug Debug debug ALUT
 )
 
-# I'm not sure if I should do a special casing for Apple. It is
-# unlikely that other Unix systems will find the framework path.
-# But if they do ([Next|Open|GNU]Step?),
-# do they want the -framework option also?
-IF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
-
-  STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR})
-  IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
-      OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
-      )
-    # String is in default search path, don't need to use -F
-    SET (ALUT_LIBRARY_OPTIMIZED "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
-  ELSE()
-    # String is not /Library/Frameworks, need to use -F
-    SET(ALUT_LIBRARY_OPTIMIZED "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
-  ENDIF()
-  # Clear the temp variable so nobody can see it
-  SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
-
-ELSE()
-  FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
-    NAMES alut
-    PATHS $ENV{ALUTDIR}
-    PATH_SUFFIXES lib libs
-  )
-  FIND_LIBRARY(ALUT_LIBRARY_DEBUG
-    NAMES alutd alut_d alutD alut_D
-    PATHS $ENV{ALUTDIR}
-    PATH_SUFFIXES lib libs
-  )
-ENDIF()
-
 # Handle the REQUIRED argument and set ALUT_FOUND
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG
-    ALUT_LIBRARY_OPTIMIZED
-    ALUT_INCLUDE_DIR
+# Also check the version requirements
+FIND_PACKAGE_HANDLE_ADVANCED_ARGS(ALUT DEFAULT_MSG
+  ALUT_LIBRARY_OPTIMIZED
+  ALUT_INCLUDE_DIR
 )
 
@@ -75,6 +47,6 @@
 
 MARK_AS_ADVANCED(
-    ALUT_INCLUDE_DIR
-    ALUT_LIBRARY_OPTIMIZED
-    ALUT_LIBRARY_DEBUG
+  ALUT_INCLUDE_DIR
+  ALUT_LIBRARY_OPTIMIZED
+  ALUT_LIBRARY_DEBUG
 )
Index: code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake	(revision 8071)
@@ -32,4 +32,14 @@
  #    RUNTIME_LIBRARY_DIRECTORY - Working directory
  #
+
+# Workaround for XCode: The folder where the bind files are written to has
+# to be present beforehand.
+# We have to do this here because the header files are all stored in a single
+# location per configuration.
+IF(CMAKE_CONFIGURATION_TYPES)
+  FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
+    FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/src/toluabind/${_dir}")
+  ENDFOREACH(_dir)
+ENDIF()
 
 FUNCTION(GENERATE_TOLUA_BINDINGS _tolua_package _target_source_files)
Index: code/branches/kicklib/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/branches/kicklib/cmake/tools/TargetUtilities.cmake	(revision 8068)
+++ code/branches/kicklib/cmake/tools/TargetUtilities.cmake	(revision 8071)
@@ -169,4 +169,11 @@
     GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files
                             INPUTFILES ${_arg_TOLUA_FILES})
+    # Workaround for XCode: The folder where the bind files are written to has
+    # to be present beforehand.
+    IF(CMAKE_CONFIGURATION_TYPES)
+      FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
+        FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_dir})
+      ENDFOREACH(_dir)
+    ENDIF()
   ENDIF()
 
