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
Location:
code/branches/buildsystem3/src/orxonox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem3/src/orxonox/Main.cc

    r2690 r2702  
    9292    using namespace orxonox;
    9393
    94     // First, determine whether we have an installed or a binary dir run
    95     // The latter occurs when simply running from the build directory
    96     Core::checkDevBuild();
    97 
    98     // Make sure the directories we write in exist or else make them
    99     Core::createDirectories();
     94    Core::postMainInitialisation();
    10095
    10196    // create a signal handler (only active for linux)
    10297    SignalHandler signalHandler;
    103     signalHandler.doCatch(argv[0], Core::getLogPath() + "orxonox_crash.log");
     98    signalHandler.doCatch(argv[0], Core::getLogPathString() + "orxonox_crash.log");
    10499
    105100    // Parse command line arguments
  • code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc

    r2699 r2702  
    4545#include <OgreWindowEventUtilities.h>
    4646
     47#include "SpecialConfig.h"
    4748#include "util/Debug.h"
    4849#include "util/Exception.h"
     
    135136        // load debug overlay
    136137        COUT(3) << "Loading Debug Overlay..." << std::endl;
    137         this->debugOverlay_ = new XMLFile(Core::getMediaPath() + "overlay/debug.oxo");
     138        this->debugOverlay_ = new XMLFile((Core::getMediaPath() / "overlay" / "debug.oxo").file_string());
    138139        Loader::open(debugOverlay_);
    139140
     
    293294        }
    294295
    295         boost::filesystem::path ogreConfigFilepath(Core::getConfigPath());
    296         ogreConfigFilepath /= this->ogreConfigFile_;
    297         boost::filesystem::path ogreLogFilepath(Core::getLogPath());
    298         ogreLogFilepath /= this->ogreLogFile_;
     296        boost::filesystem::path ogreConfigFilepath(Core::getConfigPath() / this->ogreConfigFile_);
     297        boost::filesystem::path ogreLogFilepath(Core::getLogPath() / this->ogreLogFile_);
    299298
    300299        // create a new logManager
     
    357356        try
    358357        {
    359             cf.load(Core::getMediaPath() + resourceFile_);
     358            cf.load((Core::getMediaPath() / resourceFile_).file_string());
    360359        }
    361360        catch (...)
     
    383382
    384383                    Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
    385                         std::string(Core::getMediaPath() + archName), typeName, secName);
     384                        (Core::getMediaPath() / archName).directory_string(), typeName, secName);
    386385                }
    387386            }
  • code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.cc

    r2690 r2702  
    202202        std::string levelName;
    203203        CommandLine::getValue("level", &levelName);
    204         startFile_ = new XMLFile(Core::getMediaPath() + std::string("levels/") + levelName);
     204        startFile_ = new XMLFile(Core::getMediaPathString() + "levels" + CP_SLASH + levelName);
    205205        Loader::open(startFile_);
    206206    }
  • code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.cc

    r2693 r2702  
    111111
    112112        // initialise TCL
    113         this->tclBind_ = new TclBind(Core::getMediaPath());
     113        this->tclBind_ = new TclBind(Core::getMediaPathPOSIXString());
    114114        this->tclThreadManager_ = new TclThreadManager(tclBind_->getTclInterpreter());
    115115
  • code/branches/buildsystem3/src/orxonox/gui/GUIManager.cc

    r2687 r2702  
    4242#include <CEGUIDefaultLogger.h>
    4343#include <ogreceguirenderer/OgreCEGUIRenderer.h>
     44#include "SpecialConfig.h" // Configures the macro below
    4445#ifdef CEGUILUA_USE_INTERNAL_LIBRARY
    4546#   include <ceguilua/CEGUILua.h>
     
    151152
    152153                // Create our own logger to specify the filepath
    153                 boost::filesystem::path ceguiLogFilepath(Core::getLogPath() + "cegui.log");
     154                boost::filesystem::path ceguiLogFilepath(Core::getLogPath() / "cegui.log");
    154155                this->ceguiLogger_ = new DefaultLogger();
    155156                this->ceguiLogger_->setLogFilename(ceguiLogFilepath.file_string());
  • code/branches/buildsystem3/src/orxonox/objects/Level.cc

    r2685 r2702  
    5555        this->xmlfilename_ = this->getFilename();
    5656
    57         if (this->xmlfilename_.length() >= Core::getMediaPath().length())
    58             this->xmlfilename_ = this->xmlfilename_.substr(Core::getMediaPath().length());
     57        if (this->xmlfilename_.length() >= Core::getMediaPathString().length())
     58            this->xmlfilename_ = this->xmlfilename_.substr(Core::getMediaPathString().length());
    5959    }
    6060
     
    9797        mask.include(Class(OverlayGroup)); // HACK to include the ChatOverlay
    9898
    99         this->xmlfile_ = new XMLFile(Core::getMediaPath() + this->xmlfilename_, mask);
     99        this->xmlfile_ = new XMLFile(Core::getMediaPathString() + this->xmlfilename_, mask);
    100100
    101101        Loader::open(this->xmlfile_);
Note: See TracChangeset for help on using the changeset viewer.