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/src/core/Core.h

    r2690 r2702  
    4444#include "util/OutputHandler.h"
    4545
    46 // Only allow main to access setDevBuild, so we need a forward declaration
     46// Only allow main to access postMainInitialisation, so we need a forward declaration
    4747int main(int, char**);
     48// boost::filesystem header has quite a large tail, use forward declaration
     49namespace boost { namespace filesystem
     50{
     51    struct path_traits;
     52    template<class String, class Traits> class basic_path;
     53    typedef basic_path< std::string, path_traits> path;
     54} }
    4855
    4956namespace orxonox
     
    7077            static void tsetMediaPath(const std::string& path)
    7178            { assert(singletonRef_s); singletonRef_s->_tsetMediaPath(path); }
    72             static const std::string& getMediaPath()  { return mediaPath_s; }
    73             static const std::string& getConfigPath() { return configPath_s; }
    74             static const std::string& getLogPath()    { return logPath_s; }
     79            static const boost::filesystem::path& getMediaPath();
     80            static const boost::filesystem::path& getConfigPath();
     81            static const boost::filesystem::path& getLogPath();
     82            static std::string getMediaPathString();
     83            static std::string getConfigPathString();
     84            static std::string getLogPathString();
     85            static std::string getMediaPathPOSIXString();
     86            static std::string getConfigPathPOSIXString();
     87            static std::string getLogPathPOSIXString();
    7588
    7689            // fast access global variables.
     
    95108            void _tsetMediaPath(const std::string& path);
    96109
     110            static void postMainInitialisation();
     111            static void checkDevBuild();
     112            static void setExecutablePath();
    97113            static void createDirectories();
    98             static void checkDevBuild();
    99114
    100115            int softDebugLevel_;                            //!< The debug level
     
    104119            std::string language_;                          //!< The language
    105120            bool bInitializeRandomNumberGenerator_;         //!< If true, srand(time(0)) is called
     121            std::string mediaPathString_;                   //!< Path to the data/media file folder as string
    106122
    107123            static bool bShowsGraphics_s;                   //!< global variable that tells whether to show graphics
     
    112128
    113129            static bool isDevBuild_s;                       //!< True for builds in the build directory (not installed)
    114             static std::string configPath_s;                //!< Path to the config file folder
    115             static std::string logPath_s;                   //!< Path to the log file folder
    116             static std::string mediaPath_s;                 //!< Path to the data/media file folder
    117130
    118131            static Core* singletonRef_s;
Note: See TracChangeset for help on using the changeset viewer.