Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem3/config/CMakeLists.txt @ 2685

Last change on this file since 2685 was 2685, checked in by rgrieder, 15 years ago

Fixed install target:

  • log and config file go a to separate folder each
  • The SignalHandler crash log is now "orxonox_crash.log" to avoid opening the file twice which might result in problems
  • moved tcl scripts to media/tcl8.#/ as a temporary solution. I've also created a ticket to fix this.
  • UPDATE YOUR MEDIA REPOSITORY
  • orxonox.log pre-main gets written to either %TEMP% (windows) or /tmp (Unix) and when the path was set, the content is copied.
  • removed Settings class and moved media path to Core
  • media, log and config path are now all in Core where only the media path can be configured via ini file or command line
  • Core::isDevBuild() tells whether we are running in the build or the installation directory (determined by the presence of "orxonox_dev_build.kepp_me" in the binary dir)
  • renamed Settings::getDataPath to Core::getMediaPath
  • Property svn:eol-style set to native
File size: 3.5 KB
Line 
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 
20SET(ORXONOX_CONFIG_DEV_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
21
22SET(READ_ONLY_CONFIG_FILES
23  def_keybindings.ini
24  def_masterKeybindings.ini
25)
26
27SET(WRITABLE_CONFIG_FILES
28)
29
30IF(TARDIS)
31  # OGRE can't find fonts to display config screen on Tardis,
32  # so providing default config file here (bug).
33  LIST(APPEND WRITABLE_CONFIG_FILES ogre.cfg)
34ENDIF(TARDIS)
35
36# We need the same code for both READ_ONLY and WRITABLE config files
37MACRO(CONFIGURE_FILES _file_name _build_configs _read_only_arg)
38  SET(_read_only ${_read_only_arg})
39  FOREACH(_build_config ${_build_configs})
40    # Is there an extra file in bin/Debug or bin/Release?
41    IF(${_build_config} MATCHES "Rel")
42      SET(_build_config_short "Release")
43    ELSE()
44      SET(_build_config_short "Debug")
45    ENDIF()
46    IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
47      SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
48    ELSE()
49      SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file_name})
50    ENDIF()
51
52    # Copy to the folder named like the build config for Visual Studio
53    IF(CMAKE_CONFIGURATION_TYPES)
54      SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${_build_config}/${_file_name})
55    ELSE()
56      SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${_file_name})
57    ENDIF()
58    # Only copy if target file doesn't exist. This may result in problems but
59    # otherwise we might delete a user's config
60    IF(NOT EXISTS ${_out_file} OR _read_only)
61      CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY)
62    ENDIF()
63  ENDFOREACH(_build_config)
64ENDMACRO(CONFIGURE_FILES)
65
66# Copy config files to all Visual Studio output directories
67IF(CMAKE_CONFIGURATION_TYPES)
68  SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES})
69ELSE()
70  SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE})
71ENDIF()
72
73FOREACH(_file_name ${READ_ONLY_CONFIG_FILES})
74  CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" TRUE)
75ENDFOREACH(_file_name)
76FOREACH(_file_name ${WRITABLE_CONFIG_FILES})
77  CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" FALSE)
78ENDFOREACH(_file_name)
79
80
81################ Installation #################
82
83# Not using collective call to allow configuration with CMake.
84FOREACH(_file ${READ_ONLY_CONFIG_FILES} ${WRITABLE_CONFIG_FILES})
85  IF(CMAKE_CONFIGURATION_TYPES)
86    FOREACH(_configuration ${CMAKE_CONFIGURATION_TYPES})
87      INSTALL(
88        FILES ${CMAKE_CURRENT_BINARY_DIR}/${_configuration}/${_file}
89        DESTINATION ${ORXONOX_CONFIG_INSTALL_PATH}
90        CONFIGURATIONS ${_configuration}
91      )
92    ENDFOREACH(_configuration)
93  ELSE()
94    INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_file} DESTINATION ${ORXONOX_CONFIG_INSTALL_PATH})
95  ENDIF()
96ENDFOREACH(_file)
Note: See TracBrowser for help on using the repository browser.