Index: code/branches/kicklib/bin/mac/OrxonoxMac
===================================================================
--- code/branches/kicklib/bin/mac/OrxonoxMac	(revision 8176)
+++ 	(revision )
@@ -1,31 +1,0 @@
-#!/bin/sh
-#
-#             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:
-#    Kevin Young
-#  Description:
-#    Prepares the Mac OS X app for running orxonox
-#
-
-# TODO: Currently this script will only call the orxonox run script.
-# But we actually need it to set the paths (eg. DYLD_LIBRARY_PATH) properly
-# for otherwise, Orxonox won't run in an App Bundle. Other solution might be:
-# to use install_name_tool at packaging time --> cleaner, but nasty to code.
-../run
Index: code/branches/kicklib/cmake/PrepareDevBundle.cmake
===================================================================
--- code/branches/kicklib/cmake/PrepareDevBundle.cmake	(revision 8176)
+++ code/branches/kicklib/cmake/PrepareDevBundle.cmake	(revision 8216)
@@ -25,8 +25,19 @@
 
 IF(APPLE)
+  IF(NOT CMAKE_CONFIGURATION_TYPES)
+  SET(_subdirs .)
+  SET(_default_subdir .)
+ELSE()
+  SET(_subdirs ${CMAKE_CONFIGURATION_TYPES})
+  SET(_default_subdir) # No default subdir
+ENDIF()
+
+FOREACH(_subdir ${_subdirs})
+  GET_FILENAME_COMPONENT(CURRENT_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_subdir} ABSOLUTE)
+
   # Convenience variables
-  # Note that this is just an empty bundle! It will be copied into the
-  # corresponding directory at build time
-  SET(DEVBUNDLE_CURRENT_DIR "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/Dummy/${PROJECT_NAME}.app/Contents")
+  # Note that this is just an empty bundle! The executable itself will
+  # be added at build time
+  SET(DEVBUNDLE_CURRENT_DIR "${CURRENT_RUNTIME_DIR}/${PROJECT_NAME}.app/Contents")
   SET(DEVBUNDLE_CURRENT_BIN "${DEVBUNDLE_CURRENT_DIR}/MacOS")
   SET(DEVBUNDLE_CURRENT_RESOURCES "${DEVBUNDLE_CURRENT_DIR}/Resources")
@@ -46,3 +57,5 @@
   CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/${DEFAULT_DATA_PATH}/mac/${DEVBUNDLE_DEFAULT_LANGFILE}/${DEVBUNDLE_NIB_FILE}/keyedobjects.nib" "${DEVBUNDLE_CURRENT_RESOURCES}/${DEVBUNDLE_DEFAULT_LANGFILE}/${DEVBUNDLE_NIB_FILE}/keyedobjects.nib" COPYONLY)
   CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/${DEFAULT_DATA_PATH}/mac/${DEVBUNDLE_DEFAULT_LANGFILE}/InfoPlist.strings" "${DEVBUNDLE_CURRENT_RESOURCES}/${DEVBUNDLE_DEFAULT_LANGFILE}/InfoPlist.strings")
+
+ENDFOREACH(_subdir)
 ENDIF(APPLE)
Index: code/branches/kicklib/src/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/CMakeLists.txt	(revision 8176)
+++ code/branches/kicklib/src/CMakeLists.txt	(revision 8216)
@@ -198,12 +198,10 @@
     TARGET orxonox-main
     POST_BUILD 
-    # Copy the Orxonox.app from the dummy location to the correct one
-    COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/Dummy/${PROJECT_NAME}.app" "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app"
     # Copy the executable into the Orxonox.app
-    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${ORXONOX_EXECUTABLE_NAME}" "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"
+    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${ORXONOX_EXECUTABLE_NAME}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"
     # Copy the dev-build marker file to Orxonox.app
-    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/orxonox_dev_build.keep_me" "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"
-    # Create a shortcut of the application to the Desktop
-    COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app" "$ENV{HOME}/Desktop/${PROJECT_NAME}.app"
+    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/orxonox_dev_build.keep_me" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"
+    # Create a shortcut of the application to the root of the build tree
+    COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app" 
   ) 
 ENDIF(APPLE)
