Changeset 2690 for code/branches/buildsystem3/config
- Timestamp:
- Feb 23, 2009, 8:57:42 PM (16 years ago)
- Location:
- code/branches/buildsystem3/config
- Files:
-
- 2 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem3/config/CMakeLists.txt
r2685 r2690 20 20 SET(ORXONOX_CONFIG_DEV_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) 21 21 22 SET(READ_ONLY_CONFIG_FILES23 def_keybindings.ini24 def_masterKeybindings.ini25 )26 27 SET(WRITABLE_CONFIG_FILES28 )29 30 22 IF(TARDIS) 31 23 # OGRE can't find fonts to display config screen on Tardis, 32 24 # so providing default config file here (bug). 33 LIST(APPEND WRITABLE_CONFIG_FILES ogre.cfg) 25 # Cause: Ogre 1.4.5 was compiled for an older debian version 26 IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ogre.cfg) 27 CONFIGURE_FILE(ogre.cfg ${CMAKE_CURRENT_BINARY_DIR}/ogre.cfg COPYONLY) 28 ENDIF() 34 29 ENDIF(TARDIS) 35 36 # We need the same code for both READ_ONLY and WRITABLE config files37 MACRO(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 Studio53 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 but59 # otherwise we might delete a user's config60 IF(NOT EXISTS ${_out_file} OR _read_only)61 CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY)62 ENDIF()63 ENDFOREACH(_build_config)64 ENDMACRO(CONFIGURE_FILES)65 66 # Copy config files to all Visual Studio output directories67 IF(CMAKE_CONFIGURATION_TYPES)68 SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES})69 ELSE()70 SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE})71 ENDIF()72 73 FOREACH(_file_name ${READ_ONLY_CONFIG_FILES})74 CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" TRUE)75 ENDFOREACH(_file_name)76 FOREACH(_file_name ${WRITABLE_CONFIG_FILES})77 CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" FALSE)78 ENDFOREACH(_file_name)79 80 81 ################ Installation #################82 83 # Not using collective call to allow configuration with CMake.84 FOREACH(_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()96 ENDFOREACH(_file)
Note: See TracChangeset
for help on using the changeset viewer.