Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2598 for code


Ignore:
Timestamp:
Jan 29, 2009, 6:40:20 PM (16 years ago)
Author:
rgrieder
Message:

Divided init files in bi-config into two groups:

  • The ones that always overwrite the old files (def_keybindings.ini tcl scripts, etc.)
  • The ones that only get copied when the file doesn't exist yet (orxonox.ini, ogre.cfg for tardis)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/bin-config/CMakeLists.txt

    r2595 r2598  
    1 SET(COMMON_CONFIG_FILES
    2   orxonox.ini
     1SET(READ_ONLY_CONFIG_FILES
    32  def_keybindings.ini
    43  def_masterKeybindings.ini
     
    98)
    109
     10SET(WRITABLE_CONFIG_FILES
     11  orxonox.ini
     12)
     13
    1114IF(TARDIS)
    1215  # OGRE can't find fonts to display config screen on Tardis,
    1316  # so providing default config file here (bug).
    14   SET(ADDITIONAL_CONFIG_FILES ogre.cfg)
     17  LIST(APPEND WRITABLE_CONFIG_FILES ogre.cfg)
    1518ENDIF(TARDIS)
    1619
    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
     21MACRO(CONFIGURE_FILES _file_name _build_configs _read_only_arg)
     22  SET(_read_only ${_read_only_arg})
     23  FOREACH(_build_config ${_build_configs})
    2924    # Is there an extra file in bin/Debug or bin/Release?
    3025    IF(${_build_config} MATCHES "Rel")
     
    4641    ENDIF(CMAKE_CONFIGURATION_TYPES)
    4742    # Only copy if target file doesn't exist. This may result in problems but
    48     # otherwise we might delete the a user's config
    49     IF (NOT EXISTS ${_out_file})
     43    # otherwise we might delete a user's config
     44    IF (NOT EXISTS ${_out_file} OR _read_only)
    5045      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)
     48ENDMACRO(CONFIGURE_FILES)
     49
     50# Copy config files to all Visual Studio output directories
     51IF(CMAKE_CONFIGURATION_TYPES)
     52  SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES})
     53ELSE(CMAKE_CONFIGURATION_TYPES)
     54  SET(CONFIG_OUT_PATHS_REL ".")
     55  SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE})
     56ENDIF(CMAKE_CONFIGURATION_TYPES)
     57
     58FOREACH(_file_name ${READ_ONLY_CONFIG_FILES})
     59  CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" TRUE)
     60ENDFOREACH(_file_name)
     61FOREACH(_file_name ${WRITABLE_CONFIG_FILES})
     62  CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" FALSE)
     63ENDFOREACH(_file_name)
     64
     65################ Run Scripts ##################
    5466
    5567# Create a run script for both Windows and Linux in the source root path if
     
    5870  IF(WIN32)
    5971    SET(RUN_SCRIPT run.bat)
     72    # Note: Do not use FILE(TO_NATIVE_PATH) because it doesn't work for MinGW
    6073    STRING(REGEX REPLACE "^([A-Z]\\:)\\/.*$" "\\1" WINDOWS_DRIVE_CHANGE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
    6174    STRING(REPLACE "/" "\\" CMAKE_RUNTIME_OUTPUT_DIRECTORY_WINDOWS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
Note: See TracChangeset for help on using the changeset viewer.