Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 12, 2009, 5:06:56 PM (16 years ago)
Author:
rgrieder
Message:

Added ${ORXONOX_LIBRARY_BIN_DIR} which represents the binary directory for the external dlls on windows.
Restructured concepts in bin/ dir:

  • All files in bin/Release or bin/Debug get configured and copied to the output directory. Configure means setting all the variables marked with @Var@.
  • MinSizeRel and RelWithDebInfo are considered Release versions.
  • If there is not specialised file in bin/Debug resp. bin/Release, the file in bin/ is configured and copied.
  • orxonox.ini gets configured with the available plugins (release and debug), the plugins folder and the media directory.
  • Also the debug levels have been adjusted for Debug resp. Release versions of orxonox.ini
  • When not using multi-config (debug, release, etc.) generator (like msvc or xcode), a run script called run (unix) or run.bat (windows) is configured in the root directory.
  • For tardis, ogre.cfg is copied as well due to a yet unknown bug with fonts for the ogre gui
  • moved all old style msvc project files to visual_studio folder (that only includes configured output files)
  • This commit also makes the visual studio files run in all configurations (tested only on my box).
File:
1 edited

Legend:

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

    r2584 r2590  
    1 SET(CONFIG_FILES
     1SET(COMMON_CONFIG_FILES
     2  orxonox.ini
    23  def_keybindings.ini
    34  def_masterKeybindings.ini
     
    1112  # OGRE can't find fonts to display config screen on Tardis,
    1213  # so providing default config file here (bug).
    13   SET(CONFIG_FILES ${CONFIG_FILES}
    14     linux/run-script
    15     tardis/orxonox.ini
    16     tardis/ogre.cfg
    17   )
    18 
    19 ELSEIF(UNIX)
    20   SET(CONFIG_FILES ${CONFIG_FILES}
    21     linux/run-script
    22     linux/orxonox.ini
    23   )
     14  SET(ADDITIONAL_CONFIG_FILES "ogre.cfg")
    2415ENDIF(TARDIS)
    2516
    26 IF(MINGW)
    27   SET(CONFIG_FILES ${CONFIG_FILES}
    28     "mingw/orxonox.ini"
    29     "mingw/orxonox.bat"
    30   )
    31 ENDIF(MINGW)
     17SET(CONFIG_FILES ${COMMON_CONFIG_FILES} ${ADDITIONAL_CONFIG_FILES})
    3218
    33 FOREACH(_FILE ${CONFIG_FILES})
    34   GET_FILENAME_COMPONENT(_filename ${_FILE} NAME)
    35   IF (NOT EXISTS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_filename})
    36     CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${_FILE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_filename} COPYONLY)
    37   ENDIF (NOT EXISTS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_filename})
    38 ENDFOREACH(_FILE)
     19# Copy config files to all Visual Studio output directories
     20IF(CMAKE_CONFIGURATION_TYPES)
     21  SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES})
     22ELSE(CMAKE_CONFIGURATION_TYPES)
     23  SET(CONFIG_OUT_PATHS_REL ".")
     24  SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE})
     25ENDIF(CMAKE_CONFIGURATION_TYPES)
     26
     27FOREACH(_build_config ${BUILD_CONFIGS})
     28  FOREACH(_file_name ${CONFIG_FILES})
     29    # Is there an extra file in bin/Debug or bin/Release?
     30    IF(${_build_config} MATCHES "Rel")
     31      SET(_build_config_short "Release")
     32    ELSE(${_build_config} MATCHES "Rel")
     33      SET(_build_config_short "Debug")
     34    ENDIF(${_build_config} MATCHES "Rel")
     35    IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
     36      SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
     37    ELSE(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
     38      SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file_name})
     39    ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
     40
     41    # Copy to the folder named like the build config for Visual Studio
     42    IF(CMAKE_CONFIGURATION_TYPES)
     43      SET(_out_file ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_build_config}/${_file_name})
     44    ELSE(CMAKE_CONFIGURATION_TYPES)
     45      SET(_out_file ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_file_name})
     46    ENDIF(CMAKE_CONFIGURATION_TYPES)
     47    # 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})
     50      CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY)
     51    ENDIF (NOT EXISTS ${_out_file})
     52  ENDFOREACH(_file_name)
     53ENDFOREACH(_build_config)
     54
     55# Create a run script for both Windows and Linux in the source root path if
     56# CMake is not used to create multi-configuration project files
     57IF(NOT CMAKE_CONFIGURATION_TYPES)
     58  IF(WIN32)
     59    SET(RUN_SCRIPT ${ADDITIONAL_CONFIG_FILES} "run.bat")
     60  ELSE(UNIX)
     61    SET(RUN_SCRIPT ${ADDITIONAL_CONFIG_FILES} "run")
     62  ENDIF(WIN32)
     63  IF (NOT EXISTS ${CMAKE_SOURCE_DIR}/${RUN_SCRIPT})
     64    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${RUN_SCRIPT} ${CMAKE_SOURCE_DIR}/${RUN_SCRIPT} @ONLY)
     65  ENDIF (NOT EXISTS ${CMAKE_SOURCE_DIR}/${RUN_SCRIPT})
     66ENDIF(NOT CMAKE_CONFIGURATION_TYPES)
Note: See TracChangeset for help on using the changeset viewer.