Index: code/trunk/bin/bin_trunk/CMakeLists.txt
===================================================================
--- code/trunk/bin/bin_trunk/CMakeLists.txt	(revision 3021)
+++ code/trunk/bin/bin_trunk/CMakeLists.txt	(revision 3021)
@@ -0,0 +1,68 @@
+ #
+ #             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:
+ #    Creates run scripts in the root directory of the build tree and
+ #    the runtime output directory.
+ #
+
+# Create run scripts for Windows to manually add the DLL path when executing
+SET(RUN_SCRIPTS run standalone client1 client2 server dedicated)
+IF(WIN32)
+  FOREACH(_script ${RUN_SCRIPTS})
+    LIST(REMOVE_ITEM RUN_SCRIPTS ${_script})
+    LIST(APPEND RUN_SCRIPTS ${_script}.bat)
+  ENDFOREACH(_script)
+ENDIF()
+
+IF(NOT CMAKE_CONFIGURATION_TYPES)
+  SET(_subdirs .)
+  SEt(_default_subdir .)
+ELSE()
+  SET(_subdirs ${CMAKE_CONFIGURATION_TYPES})
+  SEt(_default_subdir Debug)
+ENDIF()
+STRING(REPLACE "/" "\\" ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY})
+FOREACH(_subdir ${_subdirs})
+  GET_FILENAME_COMPONENT(CURRENT_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_subdir} ABSOLUTE)
+
+  # Note: Do not use FILE(TO_NATIVE_PATH) because it doesn't work for MinGW
+  STRING(REGEX REPLACE "^([A-Z]\\:)\\/.*$" "\\1" WINDOWS_DRIVE_CHANGE ${CURRENT_RUNTIME_DIR})
+  STRING(REPLACE "/" "\\" CURRENT_RUNTIME_DIR_WINDOWS ${CURRENT_RUNTIME_DIR})
+
+  FOREACH(_script ${RUN_SCRIPTS})
+    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${_script}.in ${CURRENT_RUNTIME_DIR}/${_script} @ONLY)
+    IF(_subdir STREQUAL _default_subdir)
+      # Convenience script to be used when sitting in the binary directory. Defaults to Debug for msvc.
+      CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${_script}.in ${CMAKE_BINARY_DIR}/${_script} @ONLY)
+    ENDIF()
+  ENDFOREACH(_script)
+
+  # In order to evaluate at run time whether it is a dev build in the build tree,
+  # we plant a special file
+  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/orxonox_dev_build.keep_me ${CURRENT_RUNTIME_DIR}/orxonox_dev_build.keep_me)
+ENDFOREACH(_subdir)
+
+
+# Make a symlink to be able to run from the root directory when installing copyable on Unix
+IF(UNIX AND INSTALL_COPYABLE)
+  INSTAll(CODE "EXECUTE_PROCESS(COMMAND ln -sf ${ORXONOX_RUNTIME_INSTALL_PATH}/${ORXONOX_EXECUTABLE_NAME} ${CMAKE_INSTALL_PREFIX}/orxonox)")
+ENDIF()
Index: code/trunk/bin/bin_trunk/client1.bat.in
===================================================================
--- code/trunk/bin/bin_trunk/client1.bat.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/client1.bat.in	(revision 3021)
@@ -0,0 +1,4 @@
+title @PROJECT_NAME@
+path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
+@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --client --writingPathSuffix client1
+pause
Index: code/trunk/bin/bin_trunk/client1.in
===================================================================
--- code/trunk/bin/bin_trunk/client1.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/client1.in	(revision 3021)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# convenience script for starting orxonox on Linux
+
+exec @CURRENT_RUNTIME_DIR@/@ORXONOX_EXECUTABLE_NAME@ --client --writingPathSuffix client1 $@
Index: code/trunk/bin/bin_trunk/client2.bat.in
===================================================================
--- code/trunk/bin/bin_trunk/client2.bat.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/client2.bat.in	(revision 3021)
@@ -0,0 +1,4 @@
+title @PROJECT_NAME@
+path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
+@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --client --writingPathSuffix client2
+pause
Index: code/trunk/bin/bin_trunk/client2.in
===================================================================
--- code/trunk/bin/bin_trunk/client2.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/client2.in	(revision 3021)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# convenience script for starting orxonox on Linux
+
+exec @CURRENT_RUNTIME_DIR@/@ORXONOX_EXECUTABLE_NAME@ --client --writingPathSuffix client2 $@
Index: code/trunk/bin/bin_trunk/dedicated.bat.in
===================================================================
--- code/trunk/bin/bin_trunk/dedicated.bat.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/dedicated.bat.in	(revision 3021)
@@ -0,0 +1,4 @@
+title @PROJECT_NAME@
+path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
+@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --dedicated --writingPathSuffix dedicated
+pause
Index: code/trunk/bin/bin_trunk/dedicated.in
===================================================================
--- code/trunk/bin/bin_trunk/dedicated.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/dedicated.in	(revision 3021)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# convenience script for starting orxonox on Linux
+
+exec @CURRENT_RUNTIME_DIR@/@ORXONOX_EXECUTABLE_NAME@ --dedicated --writingPathSuffix dedicated $@
Index: code/trunk/bin/bin_trunk/run.bat.in
===================================================================
--- code/trunk/bin/bin_trunk/run.bat.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/run.bat.in	(revision 3021)
@@ -0,0 +1,4 @@
+title @PROJECT_NAME@
+path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
+@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@
+pause
Index: code/trunk/bin/bin_trunk/run.in
===================================================================
--- code/trunk/bin/bin_trunk/run.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/run.in	(revision 3021)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# convenience script for starting orxonox on Linux
+
+exec @CURRENT_RUNTIME_DIR@/@ORXONOX_EXECUTABLE_NAME@ $@
Index: code/trunk/bin/bin_trunk/server.bat.in
===================================================================
--- code/trunk/bin/bin_trunk/server.bat.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/server.bat.in	(revision 3021)
@@ -0,0 +1,4 @@
+title @PROJECT_NAME@
+path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
+@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --server --writingPathSuffix server
+pause
Index: code/trunk/bin/bin_trunk/server.in
===================================================================
--- code/trunk/bin/bin_trunk/server.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/server.in	(revision 3021)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# convenience script for starting orxonox on Linux
+
+exec @CURRENT_RUNTIME_DIR@/@ORXONOX_EXECUTABLE_NAME@ --server --writingPathSuffix server $@
Index: code/trunk/bin/bin_trunk/standalone.bat.in
===================================================================
--- code/trunk/bin/bin_trunk/standalone.bat.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/standalone.bat.in	(revision 3021)
@@ -0,0 +1,4 @@
+title @PROJECT_NAME@
+path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
+@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --standalone --writingPathSuffix standalone
+pause
Index: code/trunk/bin/bin_trunk/standalone.in
===================================================================
--- code/trunk/bin/bin_trunk/standalone.in	(revision 3021)
+++ code/trunk/bin/bin_trunk/standalone.in	(revision 3021)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# convenience script for starting orxonox on Linux
+
+exec @CURRENT_RUNTIME_DIR@/@ORXONOX_EXECUTABLE_NAME@ --standalone --writingPathSuffix standalone $@
