Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 27, 2009, 2:13:29 PM (15 years ago)
Author:
rgrieder
Message:

Completed work on installation:

  • The CMake switch INSTALL_COPYABLE tells whether you will be able to move the installed directory or not. If TRUE then all folders, including log and config directory, will be put into the CMAKE_INSTALL_PREFIX. Furthermore, relative paths are used, which get resolved at run time.
  • If INSTALL_COPYABLE is set to FALSE, the standard operating system directories will be used. That also means on Windows files get written to the Application Data/.orxonox folder instead of Program Files/Orxonox
  • Default configuration is INSTALL_COPYABLE=TRUE for Windows and FALSE for Unix
  • Split OrxonoxConfig.h.in in two to avoid complete recompiles when changing only a path or INSTALL_COPYABLE
  • Added a global constant character: CP_SLASH which stands for cross platform slash, meaning '/' on Unix and '
    ' on Windows
  • Core class now has methods getFooPath(), getFooPathString() and getFooPathPOSIXString() where Foo can be Media, Log or Config
  • getFooPathPOSIXString() will always return a directory formatted with slashes, even on Windows
  • getFooPath() returns a reference to the boost::filesystem::path
  • boost/filesystem.hpp does not get included to Core.h because it has a very large rat tail
  • The platform specific directory stuff gets done in Core::postMainInitialisation()
  • Adjusted all classes using the media path
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem3/cmake/BuildConfig.cmake

    r2698 r2702  
    2727################# Misc Options ##################
    2828
    29 # Set binary output directories
    30 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
    31 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
    32 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
     29# Standard path suffixes, might not hold everywhere though
     30SET(DEFAULT_RUNTIME_PATH bin)
     31SET(DEFAULT_LIBRARY_PATH lib)
     32SET(DEFAULT_ARCHIVE_PATH lib/static)
     33SET(DEFAULT_DOC_PATH     doc)
     34SET(DEFAULT_MEDIA_PATH   media)
     35SET(DEFAULT_CONFIG_PATH  config)
     36SET(DEFAULT_LOG_PATH     log)
     37
     38# Set output directories
     39SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_RUNTIME_PATH})
     40SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH})
     41SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH})
     42# Do not set doc and media, rather check in the two subdirectories
     43# whether they concur with the DEFAULT_..._PATH
     44SET(CMAKE_CONFIG_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_CONFIG_PATH})
     45SET(CMAKE_LOG_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_LOG_PATH})
    3346
    3447# Take care of some CMake 2.6.0 leftovers
     
    117130############# Installation Settings #############
    118131
     132SET(_info_text "Puts all installed files in subfolders of the install prefix path. That root folder can then be moved, copied and renamed as you wish. The executable will not write to folders like ~/.orxonox or \"Applictation Data\"")
    119133IF(UNIX)
     134  OPTION(INSTALL_COPYABLE "${_info_text}" FALSE)
     135ELSE()
     136  OPTION(INSTALL_COPYABLE "${_info_text}" TRUE)
     137ENDIF()
     138
     139IF(INSTALL_COPYABLE)
     140  # Note the relative paths. They will be resolved at runtime.
     141  # For CMake operations CMAKE_INSTALL_PREFIX is always appended.
     142  SET(ORXONOX_RUNTIME_INSTALL_PATH ${DEFAULT_RUNTIME_PATH})
     143  SET(ORXONOX_LIBRARY_INSTALL_PATH ${DEFAULT_LIBRARY_PATH})
     144  SET(ORXONOX_ARCHIVE_INSTALL_PATH ${DEFAULT_ARCHIVE_PATH})
     145  SET(ORXONOX_DOC_INSTALL_PATH     ${DEFAULT_DOC_PATH})
     146  SET(ORXONOX_MEDIA_INSTALL_PATH   ${DEFAULT_MEDIA_PATH})
     147  SET(ORXONOX_CONFIG_INSTALL_PATH  ${DEFAULT_CONFIG_PATH})
     148  SET(ORXONOX_LOG_INSTALL_PATH     ${DEFAULT_LOG_PATH})
     149
     150ELSEIF(UNIX) # Apple too?
     151  # Using absolute paths
    120152  SET(ORXONOX_RUNTIME_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/bin)
    121153  SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox)
    122154  SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static)
     155  SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
    123156  SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/share/orxonox)
    124   SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
    125   GET_FILENAME_COMPONENT(USER_DIR ~ ABSOLUTE)
    126   SET(ORXONOX_LOG_INSTALL_PATH     ${USER_DIR}/.orxonox/log)
    127   SET(ORXONOX_CONFIG_INSTALL_PATH  ${USER_DIR}/.orxonox/config)
    128 
    129   # Execution paths, either relative to the binary dir or absolute
    130   # For Windows copy&paste installs relative paths are much better
    131   SET(ORXONOX_MEDIA_INSTALL_PATH_EXEC  ${ORXONOX_MEDIA_INSTALL_PATH})
    132   SET(ORXONOX_CONFIG_INSTALL_PATH_EXEC ${ORXONOX_CONFIG_INSTALL_PATH})
    133   SET(ORXONOX_LOG_INSTALL_PATH_EXEC    ${ORXONOX_LOG_INSTALL_PATH})
     157  # These two paths are user and therefore runtime dependent --> only set relatively
     158  SET(ORXONOX_CONFIG_INSTALL_PATH  ${DEFAULT_CONFIG_PATH})
     159  SET(ORXONOX_LOG_INSTALL_PATH     ${DEFAULT_LOG_PATH})
     160
    134161ELSEIF(WIN32)
    135   SET(ORXONOX_RUNTIME_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/bin)
    136   SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib)
    137   SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/static)
    138   SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/media)
    139   SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/doc)
    140   SET(ORXONOX_LOG_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/log)
    141   SET(ORXONOX_CONFIG_INSTALL_PATH  ${CMAKE_INSTALL_PREFIX}/config)
    142 
    143   # Execution paths, either relative to the binary dir or absolute
    144   # For Windows copy&paste installs relative paths are much better
    145   SET(ORXONOX_MEDIA_INSTALL_PATH_EXEC  ../media)
    146   SET(ORXONOX_CONFIG_INSTALL_PATH_EXEC ../config)
    147   SET(ORXONOX_LOG_INSTALL_PATH_EXEC    ../log)
     162  SET(ORXONOX_RUNTIME_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH})
     163  SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
     164  SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
     165  SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
     166  SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MEDIA_PATH})
     167  # Leave empty because it is user and therefore runtime dependent
     168  SET(ORXONOX_CONFIG_INSTALL_PATH  ${DEFAULT_CONFIG_PATH})
     169  SET(ORXONOX_LOG_INSTALL_PATH     ${DEFAULT_LOG_PATH})
    148170ENDIF()
    149171
Note: See TracChangeset for help on using the changeset viewer.