- Timestamp:
- Jan 29, 2009, 6:40:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/bin-config/CMakeLists.txt
r2595 r2598 1 SET(COMMON_CONFIG_FILES 2 orxonox.ini 1 SET(READ_ONLY_CONFIG_FILES 3 2 def_keybindings.ini 4 3 def_masterKeybindings.ini … … 9 8 ) 10 9 10 SET(WRITABLE_CONFIG_FILES 11 orxonox.ini 12 ) 13 11 14 IF(TARDIS) 12 15 # OGRE can't find fonts to display config screen on Tardis, 13 16 # so providing default config file here (bug). 14 SET(ADDITIONAL_CONFIG_FILES ogre.cfg)17 LIST(APPEND WRITABLE_CONFIG_FILES ogre.cfg) 15 18 ENDIF(TARDIS) 16 19 17 SET(CONFIG_FILES ${COMMON_CONFIG_FILES} ${ADDITIONAL_CONFIG_FILES}) 18 19 # Copy config files to all Visual Studio output directories 20 IF(CMAKE_CONFIGURATION_TYPES) 21 SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES}) 22 ELSE(CMAKE_CONFIGURATION_TYPES) 23 SET(CONFIG_OUT_PATHS_REL ".") 24 SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE}) 25 ENDIF(CMAKE_CONFIGURATION_TYPES) 26 27 FOREACH(_build_config ${BUILD_CONFIGS}) 28 FOREACH(_file_name ${CONFIG_FILES}) 20 # We need the same code for both READ_ONLY and WRITABLE config files 21 MACRO(CONFIGURE_FILES _file_name _build_configs _read_only_arg) 22 SET(_read_only ${_read_only_arg}) 23 FOREACH(_build_config ${_build_configs}) 29 24 # Is there an extra file in bin/Debug or bin/Release? 30 25 IF(${_build_config} MATCHES "Rel") … … 46 41 ENDIF(CMAKE_CONFIGURATION_TYPES) 47 42 # Only copy if target file doesn't exist. This may result in problems but 48 # otherwise we might delete thea user's config49 IF (NOT EXISTS ${_out_file} )43 # otherwise we might delete a user's config 44 IF (NOT EXISTS ${_out_file} OR _read_only) 50 45 CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY) 51 ENDIF (NOT EXISTS ${_out_file}) 52 ENDFOREACH(_file_name) 53 ENDFOREACH(_build_config) 46 ENDIF (NOT EXISTS ${_out_file} OR _read_only) 47 ENDFOREACH(_build_config) 48 ENDMACRO(CONFIGURE_FILES) 49 50 # Copy config files to all Visual Studio output directories 51 IF(CMAKE_CONFIGURATION_TYPES) 52 SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES}) 53 ELSE(CMAKE_CONFIGURATION_TYPES) 54 SET(CONFIG_OUT_PATHS_REL ".") 55 SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE}) 56 ENDIF(CMAKE_CONFIGURATION_TYPES) 57 58 FOREACH(_file_name ${READ_ONLY_CONFIG_FILES}) 59 CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" TRUE) 60 ENDFOREACH(_file_name) 61 FOREACH(_file_name ${WRITABLE_CONFIG_FILES}) 62 CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" FALSE) 63 ENDFOREACH(_file_name) 64 65 ################ Run Scripts ################## 54 66 55 67 # Create a run script for both Windows and Linux in the source root path if … … 58 70 IF(WIN32) 59 71 SET(RUN_SCRIPT run.bat) 72 # Note: Do not use FILE(TO_NATIVE_PATH) because it doesn't work for MinGW 60 73 STRING(REGEX REPLACE "^([A-Z]\\:)\\/.*$" "\\1" WINDOWS_DRIVE_CHANGE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) 61 74 STRING(REPLACE "/" "\\" CMAKE_RUNTIME_OUTPUT_DIRECTORY_WINDOWS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
Note: See TracChangeset
for help on using the changeset viewer.