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 copied

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem3/src/SpecialConfig.h.in

    r2699 r2702  
    2525 *      ...
    2626 *
    27  *   Original code: OgrePlatform.h, licensed under the LGPL. The code
    28  *   has changed almost completely though.
    29  *
    30  *   Caution: Do not configure this file CMake configuration (Debug, Release, etc.)
    31  *            dependent! XCode and Visual Studio have the same file for all.
    32  *
    3327 */
    3428
     
    3630 @file
    3731 @brief
    38     Various constants for compiler, architecture and platform.
     32    Various constants and options that only affect very little code.
     33 @note
     34    This is merely to avoid recompiling everything when only a path changes.
    3935
    4036    @GENERATED_FILE_COMMENT@
    4137 */
    4238
    43 #ifndef _OrxonoxConfig_H__
    44 #define _OrxonoxConfig_H__
     39#ifndef _SpecialConfig_H__
     40#define _SpecialConfig_H__
    4541
    46 /*---------------------------------
    47  * Platform and compiler related options
    48  *-------------------------------*/
    49 #cmakedefine ORXONOX_PLATFORM_WINDOWS
    50 #cmakedefine ORXONOX_PLATFORM_LINUX
    51 #cmakedefine ORXONOX_PLATFORM_APPLE
    52 #cmakedefine ORXONOX_PLATFORM_UNIX /* Apple and Linux */
    53 
    54 /* Determine compiler and set ORXONOX_COMP_VER */
    55 #if defined( _MSC_VER )
    56 #  define ORXONOX_COMPILER_MSVC
    57 #  define ORXONOX_COMP_VER _MSC_VER
    58 
    59 #elif defined( __GNUC__ )
    60 #  define ORXONOX_COMPILER_GCC
    61 #  define ORXONOX_COMP_VER (((__GNUC__)*100) + \
    62         (__GNUC_MINOR__*10) + \
    63         __GNUC_PATCHLEVEL__)
    64 #  if defined(__MINGW32__)
    65 #    define ORXONOX_COMPILER_MINGW
    66 #  endif
    67 
    68 #elif defined( __BORLANDC__ )
    69 #  define ORXONOX_COMPILER_BORLAND
    70 #  define ORXONOX_COMP_VER __BCPLUSPLUS__
    71 
    72 #else
    73 #  pragma error "No known compiler. Abort!"
    74 
    75 #endif
    76 
    77 /* Endianness */
    78 #cmakedefine ORXONOX_BIG_ENDIAN
    79 #cmakedefine ORXONOX_LITTLE_ENDIAN
    80 
    81 /* Architecture */
    82 #cmakedefine ORXONOX_ARCH_32
    83 #cmakedefine ORXONOX_ARCH_64
    84 
    85 /* See if we can use __forceinline or if we need to use __inline instead */
    86 #cmakedefine HAVE_FORCEINLINE
    87 #ifdef HAVE_FORCEINLINE
    88 #  define FORCEINLINE __forceinline
    89 #else
    90 #  define FORCEINLINE __inline
    91 #endif
    92 
    93 /* Try to define function information */
    94 #ifndef __FUNCTIONNAME__
    95 #  ifdef ORXONOX_COMPILER_BORLAND
    96 #    define __FUNCTIONNAME__ __FUNC__
    97 #  elif defined(ORXONOX_COMPILER_GCC)
    98 #    define __FUNCTIONNAME__ __PRETTY_FUNCTION__
    99 #  elif defined(ORXONOX_COMPILER_MSVC)
    100 #    define __FUNCTIONNAME__ __FUNCTION__
    101 #  else
    102 #    define __FUNCTIONNAME__
    103 #  endif
    104 #endif
    105 
    106 
    107 /*---------------------------------
    108  * Version information
    109  *-------------------------------*/
    110 #define ORXONOX_VERSION_MAJOR @ORXONOX_VERSION_MAJOR@
    111 #define ORXONOX_VERSION_MINOR @ORXONOX_VERSION_MINOR@
    112 #define ORXONOX_VERSION_PATCH @ORXONOX_VERSION_PATCH@
    113 #define ORXONOX_VERSION_NAME "@ORXONOX_VERSION_NAME@"
    114 
    115 #define ORXONOX_VERSION ((ORXONOX_VERSION_MAJOR << 16) | (ORXONOX_VERSION_MINOR << 8) | ORXONOX_VERSION_PATCH)
    116 
    117 
    118 /*---------------------------------
    119  * Unix settings
    120  *-------------------------------*/
    121 #ifdef ORXONOX_PLATFORM_UNIX
    122 
    123 /* TODO: Check what this actually is and whether we need it or not */
    124 #if 0
    125 #  ifdef ORXONOX_PLATFORM_APPLE
    126 #    define ORXONOX_PLATFORM_LIB "OrxonoxPlatform.bundle"
    127 #  else
    128 /* ORXONOX_PLATFORM_LINUX */
    129 #    define ORXONOX_PLATFORM_LIB "libOrxonoxPlatform.so"
    130 #  endif
    131 #endif
    132 
    133 #endif /* Patform Unix */
    134 
    135 
    136 /*---------------------------------
    137  * Apple Settings
    138  *-------------------------------*/
    139 
    140 
    141 /*---------------------------------
    142  * Includes
    143  *-------------------------------*/
    144 /* Define the english written operators like and, or, xor
    145  * This is C++ standard, but the Microsoft compiler doesn't define them. */
    146 #cmakedefine HAVE_ISO646_H
    147 #ifdef HAVE_ISO646_H
    148 #  include <iso646.h>
    149 #endif
    150 
    151 #cmakedefine HAVE_STDINT_H
    152 #ifdef HAVE_STDINT_H
    153 #  include <stdint.h>
    154 #elif defined(ORXONOX_COMPILER_MSVC)
    155 typedef __int8            int8_t;
    156 typedef __int16           int16_t;
    157 typedef __int32           int32_t;
    158 typedef __int64           int64_t;
    159 typedef unsigned __int8   uint8_t;
    160 typedef unsigned __int16  uint16_t;
    161 typedef unsigned __int32  uint32_t;
    162 typedef unsigned __int64  uint64_t;
    163 #endif
    164 
    165 #cmakedefine HAVE_STDDEF_H
    166 /* Quite large, do not include unless necessary
    167 #ifdef HAVE_STDDEF_H
    168 #  include <stddef.h>
    169 #endif
    170 */
    171 
    172 /* Visual Leak Detector looks for memory leaks */
    173 #cmakedefine VISUAL_LEAK_DETECTOR_ENABLE
    174 #ifdef VISUAL_LEAK_DETECTOR_ENABLE
    175 #  include <vld.h>
    176 #endif
    177 
    178 
    179 /*---------------------------------
    180  * Various Settings
    181  *-------------------------------*/
    18242/* Set whether we must suffix "ceguilua/" for the CEGUILua.h include */
    18343#cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY
     
    18646   too when installing. */
    18747#cmakedefine DEPENDENCY_PACKAGE_ENABLE
     48
     49/* Orxonox either gets installed to the system or just into a folder.
     50   The latter uses relative paths. */
     51#cmakedefine INSTALL_COPYABLE
    18852
    18953/* Using MSVC or XCode IDE */
     
    19862namespace orxonox
    19963{
    200     const char* const ORXONOX_MEDIA_INSTALL_PATH ("@ORXONOX_MEDIA_INSTALL_PATH_EXEC@/");
    201     const char* const ORXONOX_CONFIG_INSTALL_PATH("@ORXONOX_CONFIG_INSTALL_PATH_EXEC@/");
    202     const char* const ORXONOX_LOG_INSTALL_PATH   ("@ORXONOX_LOG_INSTALL_PATH_EXEC@/");
     64    const char* const ORXONOX_RUNTIME_INSTALL_PATH("@ORXONOX_RUNTIME_INSTALL_PATH@");
     65    const char* const ORXONOX_MEDIA_INSTALL_PATH  ("@ORXONOX_MEDIA_INSTALL_PATH@");
     66    /* Config and Log path might be relative because they could be user and therefore runtime dependent */
     67    const char* const ORXONOX_CONFIG_INSTALL_PATH ("@ORXONOX_CONFIG_INSTALL_PATH@");
     68    const char* const ORXONOX_LOG_INSTALL_PATH    ("@ORXONOX_LOG_INSTALL_PATH@");
    20369
    204     const char* const ORXONOX_MEDIA_DEV_PATH     ("@ORXONOX_MEDIA_DEV_PATH@/");
     70    const char* const ORXONOX_MEDIA_DEV_PATH      ("@CMAKE_MEDIA_OUTPUT_DIRECTORY@");
    20571#ifdef CMAKE_CONFIGURATION_TYPES
    206     const char* const ORXONOX_CONFIG_DEV_PATH    ("@ORXONOX_CONFIG_DEV_PATH@/" MACRO_QUOTEME(CMAKE_BUILD_TYPE) "/");
    207     const char* const ORXONOX_LOG_DEV_PATH       ("@ORXONOX_LOG_DEV_PATH@/"    MACRO_QUOTEME(CMAKE_BUILD_TYPE) "/");
     72    const char* const ORXONOX_CONFIG_DEV_PATH     ("@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" MACRO_QUOTEME(CMAKE_BUILD_TYPE));
     73    const char* const ORXONOX_LOG_DEV_PATH        ("@CMAKE_LOG_OUTPUT_DIRECTORY@/"    MACRO_QUOTEME(CMAKE_BUILD_TYPE));
    20874#else
    209     const char* const ORXONOX_CONFIG_DEV_PATH    ("@ORXONOX_CONFIG_DEV_PATH@/");
    210     const char* const ORXONOX_LOG_DEV_PATH       ("@ORXONOX_LOG_DEV_PATH@/");
     75    const char* const ORXONOX_CONFIG_DEV_PATH     ("@CMAKE_CONFIG_OUTPUT_DIRECTORY@");
     76    const char* const ORXONOX_LOG_DEV_PATH        ("@CMAKE_LOG_OUTPUT_DIRECTORY@");
    21177#endif
    21278   
     
    22995}
    23096
    231 #endif /* _OrxonoxConfig_H__ */
     97#endif /* _SpecialConfig_H__ */
Note: See TracChangeset for help on using the changeset viewer.