[2626] | 1 | # |
---|
| 2 | # ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | # > www.orxonox.net < |
---|
| 4 | # |
---|
| 5 | # This program is free software; you can redistribute it and/or |
---|
| 6 | # modify it under the terms of the GNU General Public License |
---|
| 7 | # as published by the Free Software Foundation; either version 2 |
---|
| 8 | # of the License, or (at your option) any later version. |
---|
| 9 | # |
---|
| 10 | # This program is distributed in the hope that it will be useful, |
---|
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 13 | # GNU General Public License for more details. |
---|
| 14 | # |
---|
| 15 | # You should have received a copy of the GNU General Public License along |
---|
| 16 | # with this program; if not, write to the Free Software Foundation, |
---|
| 17 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 18 | # |
---|
| 19 | # |
---|
| 20 | # Author: |
---|
| 21 | # Reto Grieder |
---|
| 22 | # Description: |
---|
[2709] | 23 | # Creates run scripts in the root directory of the build tree and |
---|
| 24 | # the runtime output directory. |
---|
[2626] | 25 | # |
---|
[2199] | 26 | |
---|
[2709] | 27 | # Create run scripts for Windows to manually add the DLL path when executing |
---|
[2745] | 28 | SET(RUN_SCRIPTS run client1 client2 server dedicated) |
---|
[2680] | 29 | IF(WIN32) |
---|
[2745] | 30 | FOREACH(_script ${RUN_SCRIPTS}) |
---|
| 31 | LIST(REMOVE_ITEM RUN_SCRIPTS ${_script}) |
---|
| 32 | LIST(APPEND RUN_SCRIPTS ${_script}.bat) |
---|
| 33 | ENDFOREACH(_script) |
---|
[2684] | 34 | ENDIF() |
---|
[2680] | 35 | |
---|
[2684] | 36 | IF(NOT CMAKE_CONFIGURATION_TYPES) |
---|
| 37 | SET(_subdirs .) |
---|
| 38 | SEt(_default_subdir .) |
---|
| 39 | ELSE() |
---|
| 40 | SET(_subdirs ${CMAKE_CONFIGURATION_TYPES}) |
---|
| 41 | SEt(_default_subdir Debug) |
---|
| 42 | ENDIF() |
---|
| 43 | STRING(REPLACE "/" "\\" ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}) |
---|
| 44 | FOREACH(_subdir ${_subdirs}) |
---|
| 45 | GET_FILENAME_COMPONENT(CURRENT_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_subdir} ABSOLUTE) |
---|
[2680] | 46 | |
---|
[2684] | 47 | # Note: Do not use FILE(TO_NATIVE_PATH) because it doesn't work for MinGW |
---|
| 48 | STRING(REGEX REPLACE "^([A-Z]\\:)\\/.*$" "\\1" WINDOWS_DRIVE_CHANGE ${CURRENT_RUNTIME_DIR}) |
---|
| 49 | STRING(REPLACE "/" "\\" CURRENT_RUNTIME_DIR_WINDOWS ${CURRENT_RUNTIME_DIR}) |
---|
| 50 | |
---|
[2709] | 51 | FOREACH(_script ${RUN_SCRIPTS}) |
---|
| 52 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${_script}.in ${CURRENT_RUNTIME_DIR}/${_script} @ONLY) |
---|
| 53 | IF(_subdir STREQUAL _default_subdir) |
---|
| 54 | # Convenience script to be used when sitting in the binary directory. Defaults to Debug for msvc. |
---|
| 55 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${_script}.in ${CMAKE_BINARY_DIR}/${_script} @ONLY) |
---|
| 56 | ENDIF() |
---|
| 57 | ENDFOREACH(_script) |
---|
[2685] | 58 | |
---|
| 59 | # In order to evaluate at run time whether it is a dev build in the build tree, |
---|
| 60 | # we plant a special file |
---|
| 61 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/orxonox_dev_build.keep_me ${CURRENT_RUNTIME_DIR}/orxonox_dev_build.keep_me) |
---|
[2684] | 62 | ENDFOREACH(_subdir) |
---|
[2723] | 63 | |
---|
| 64 | |
---|
| 65 | # Make a symlink to be able to run from the root directory when installing copyable on Unix |
---|
| 66 | IF(UNIX AND INSTALL_COPYABLE) |
---|
| 67 | INSTAll(CODE "EXECUTE_PROCESS(COMMAND ln -sf ${ORXONOX_RUNTIME_INSTALL_PATH}/${ORXONOX_EXECUTABLE_NAME} ${CMAKE_INSTALL_PREFIX}/orxonox)") |
---|
| 68 | ENDIF() |
---|