Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5679 for code/branches


Ignore:
Timestamp:
Aug 24, 2009, 8:17:56 PM (15 years ago)
Author:
rgrieder
Message:

Merged revision 5641 to resource3:

  • Prepared build system for an external media directory.
Location:
code/branches/resource3
Files:
1 added
31 edited
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/resource3/CMakeLists.txt

    r3316 r5679  
    4747
    4848# Configure media directory location and installation
    49 INCLUDE(Media)
     49ADD_SUBDIRECTORY(media)
    5050
    5151# Create the actual project
  • code/branches/resource3/bin/CMakeLists.txt

    r3196 r5679  
    4545  SEt(_default_subdir) # No default subdir
    4646ENDIF()
    47 STRING(REPLACE "/" "\\" ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY})
     47STRING(REPLACE "/" "\\" RUNTIME_LIBRARY_DIRECTORY_WINDOWS ${RUNTIME_LIBRARY_DIRECTORY})
    4848FOREACH(_subdir ${_subdirs})
    4949  GET_FILENAME_COMPONENT(CURRENT_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_subdir} ABSOLUTE)
     
    6969# Make a symlink to be able to run from the root directory when installing copyable on Unix
    7070IF(UNIX AND INSTALL_COPYABLE)
    71   INSTAll(CODE "EXECUTE_PROCESS(COMMAND ln -sf ${ORXONOX_RUNTIME_INSTALL_PATH}/${ORXONOX_EXECUTABLE_NAME} ${CMAKE_INSTALL_PREFIX}/orxonox)")
     71  INSTAll(CODE "EXECUTE_PROCESS(COMMAND ln -sf ${RUNTIME_INSTALL_DIRECTORY}/${ORXONOX_EXECUTABLE_NAME} ${CMAKE_INSTALL_PREFIX}/orxonox)")
    7272ENDIF()
  • code/branches/resource3/bin/client1.bat.in

    r3068 r5679  
    11title @PROJECT_NAME@
    2 path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
     2path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    33@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --client --writingPathSuffix client1
    44pause
  • code/branches/resource3/bin/client2.bat.in

    r3068 r5679  
    11title @PROJECT_NAME@
    2 path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
     2path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    33@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --client --writingPathSuffix client2
    44pause
  • code/branches/resource3/bin/dedicated.bat.in

    r3068 r5679  
    11title @PROJECT_NAME@
    2 path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
     2path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    33@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --dedicated --writingPathSuffix dedicated
    44pause
  • code/branches/resource3/bin/run.bat.in

    r3068 r5679  
    11title @PROJECT_NAME@
    2 path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
     2path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    33@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@
    44pause
  • code/branches/resource3/bin/server.bat.in

    r3068 r5679  
    11title @PROJECT_NAME@
    2 path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
     2path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    33@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --server --writingPathSuffix server
    44pause
  • code/branches/resource3/bin/standalone.bat.in

    r3068 r5679  
    11title @PROJECT_NAME@
    2 path @ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
     2path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    33@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --standalone --writingPathSuffix standalone
    44pause
  • code/branches/resource3/cmake/BuildConfig.cmake

    r3330 r5679  
    4040SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH})
    4141SET(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
     42SET(CMAKE_DOC_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_DOC_PATH})
     43# Media directories are only inputs
    4444SET(CMAKE_CONFIG_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_CONFIG_PATH})
    4545SET(CMAKE_LOG_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_LOG_PATH})
     
    5050# Sets where to find the external libraries like OgreMain.dll at runtime
    5151# On Unix you should not have to change this at all.
    52 IF(NOT ORXONOX_RUNTIME_LIBRARY_DIRECTORY)
    53   SET(ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
     52IF(NOT RUNTIME_LIBRARY_DIRECTORY)
     53  SET(RUNTIME_LIBRARY_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
    5454ENDIF()
    5555
     
    126126ENDIF()
    127127
    128 IF(INSTALL_COPYABLE)
    129   # Note the relative paths. They will be resolved at runtime.
    130   # For CMake operations CMAKE_INSTALL_PREFIX is always appended.
    131   SET(ORXONOX_RUNTIME_INSTALL_PATH ${DEFAULT_RUNTIME_PATH})
    132   SET(ORXONOX_LIBRARY_INSTALL_PATH ${DEFAULT_LIBRARY_PATH})
    133   SET(ORXONOX_ARCHIVE_INSTALL_PATH ${DEFAULT_ARCHIVE_PATH})
    134   SET(ORXONOX_DOC_INSTALL_PATH     ${DEFAULT_DOC_PATH})
    135   SET(ORXONOX_MEDIA_INSTALL_PATH   ${DEFAULT_MEDIA_PATH})
    136   SET(ORXONOX_CONFIG_INSTALL_PATH  ${DEFAULT_CONFIG_PATH})
    137   SET(ORXONOX_LOG_INSTALL_PATH     ${DEFAULT_LOG_PATH})
    138 
    139 ELSEIF(UNIX) # Apple too?
    140   # Using absolute paths
    141   SET(ORXONOX_RUNTIME_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/bin)
    142   SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox)
    143   SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static)
    144   SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
    145   SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/share/orxonox)
    146   # These two paths are user and therefore runtime dependent --> only set relatively
    147   SET(ORXONOX_CONFIG_INSTALL_PATH  ${DEFAULT_CONFIG_PATH})
    148   SET(ORXONOX_LOG_INSTALL_PATH     ${DEFAULT_LOG_PATH})
    149 
    150 ELSEIF(WIN32)
    151   SET(ORXONOX_RUNTIME_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH})
    152   SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
    153   SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
    154   SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
    155   SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MEDIA_PATH})
     128# Default installation paths
     129SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH})
     130SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
     131SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
     132SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
     133SET(MEDIA_INSTALL_DIRECTORY   ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MEDIA_PATH})
     134SET(CONFIG_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_CONFIG_PATH})
     135SET(LOG_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LOG_PATH})
     136
     137IF(NOT INSTALL_COPYABLE)
     138  IF(UNIX) # Apple too?
     139    # Using absolute paths
     140    SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)
     141    SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/orxonox)
     142    SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static)
     143    SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
     144    SET(MEDIA_INSTALL_DIRECTORY   ${CMAKE_INSTALL_PREFIX}/share/orxonox)
     145  ENDIF()
     146
    156147  # Leave empty because it is user and therefore runtime dependent
    157   SET(ORXONOX_CONFIG_INSTALL_PATH  ${DEFAULT_CONFIG_PATH})
    158   SET(ORXONOX_LOG_INSTALL_PATH     ${DEFAULT_LOG_PATH})
     148  SET(CONFIG_INSTALL_DIRECTORY)
     149  SET(LOG_INSTALL_DIRECTORY)
    159150ENDIF()
    160151
     
    170161
    171162# the RPATH to be used when installing
    172 SET(CMAKE_INSTALL_RPATH ${ORXONOX_LIBRARY_INSTALL_PATH})
     163IF(INSTALL_COPYABLE)
     164  SET(CMAKE_INSTALL_RPATH ${DEFAULT_LIBRARY_PATH})
     165ELSE()
     166  SET(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_DIRECTORY})
     167ENDIF()
    173168
    174169# add the automatically determined parts of the RPATH
  • code/branches/resource3/cmake/GenerateToluaBindings.cmake

    r3368 r5679  
    3030 #    TOLUA_PARSER_SOURCE - Lua file with the parser source code
    3131 #    TOLUA_PARSER_DEPENDENCIES - All the dependent lua files
    32  #    ORXONOX_RUNTIME_LIBRARY_DIRECTORY - Working directory
     32 #    RUNTIME_LIBRARY_DIRECTORY - Working directory
    3333 #
    3434
     
    7474    DEPENDS           ${TOLUA_PARSER_DEPENDENCIES}
    7575    IMPLICIT_DEPENDS  ${_implicit_dependencies}
    76     WORKING_DIRECTORY ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}
     76    WORKING_DIRECTORY ${RUNTIME_LIBRARY_DIRECTORY}
    7777    COMMENT "Generating tolua bind files for package ${_tolua_package}"
    7878  )
  • code/branches/resource3/cmake/PackageConfig.cmake

    r3370 r5679  
    1 # General package configuration. Merely sets the include paths.
    2 # Library files are treated separately.
     1 #
     2 #             ORXONOX - the hottest 3D action shooter ever to exist
     3 #                             > www.orxonox.net <
     4 #
     5 #        This program is free software; you can redistribute it and/or
     6 #         modify it under the terms of the GNU General Public License
     7 #        as published by the Free Software Foundation; either version 2
     8 #            of the License, or (at your option) any later version.
     9 #
     10 #       This program is distributed in the hope that it will be useful,
     11 #        but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 #        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 #                 GNU General Public License for more details.
     14 #
     15 #   You should have received a copy of the GNU General Public License along
     16 #      with this program; if not, write to the Free Software Foundation,
     17 #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     18 #
     19 #
     20 #  Author:
     21 #    Reto Grieder
     22 #  Description:
     23 #    General package configuration. Merely sets the include paths.
     24 #    Library files are treated separately.
     25 #
    326
    427# Check package version info
  • code/branches/resource3/cmake/PackageConfigMSVC.cmake

    r3370 r5679  
    4747
    4848  # Also the directory with the runtime libraries
    49   SET(ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${DEP_BINARY_DIR})
     49  SET(RUNTIME_LIBRARY_DIRECTORY ${DEP_BINARY_DIR})
    5050
    5151  # Sets the library path for the FIND_LIBRARY
  • code/branches/resource3/cmake/PackageConfigMinGW.cmake

    r3196 r5679  
    4040
    4141  # Also the directory with the runtime libraries
    42   SET(ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${DEP_BINARY_DIR})
     42  SET(RUNTIME_LIBRARY_DIRECTORY ${DEP_BINARY_DIR})
    4343
    4444  # Sets the library path for the FIND_LIBRARY
  • code/branches/resource3/cmake/TargetUtilities.cmake

    r3371 r5679  
    175175  IF(NOT _arg_STATIC AND NOT _arg_NO_INSTALL)
    176176    INSTALL(TARGETS ${_target_name}
    177       RUNTIME DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH}
    178       LIBRARY DESTINATION ${ORXONOX_LIBRARY_INSTALL_PATH}
    179       #ARCHIVE DESTINATION ${ORXONOX_ARCHIVE_INSTALL_PATH}
     177      RUNTIME DESTINATION ${RUNTIME_INSTALL_DIRECTORY}
     178      LIBRARY DESTINATION ${LIBRARY_INSTALL_DIRECTORY}
     179      #ARCHIVE DESTINATION ${ARCHIVE_INSTALL_DIRECTORY}
    180180    )
    181181  ENDIF()
  • code/branches/resource3/doc/api/CMakeLists.txt

    r3196 r5679  
    7676  INSTALL(
    7777    FILES ${DOXY_CONFIG} ${CMAKE_CURRENT_BINARY_DIR}/doxy.log
    78     DESTINATION ${ORXONOX_DOC_INSTALL_PATH}/api
    79     OPTIONAL
     78    DESTINATION ${DOC_INSTALL_DIRECTORY}/api OPTIONAL
    8079  )
    8180  # Install command always needs the directory
     
    8584  INSTALL(
    8685    DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
    87     DESTINATION ${ORXONOX_DOC_INSTALL_PATH}/api
     86    DESTINATION ${DOC_INSTALL_DIRECTORY}/api
    8887  )
    8988ENDIF(DOXYGEN_FOUND)
  • code/branches/resource3/media/CMakeLists.txt

    r5675 r5679  
    2121 #    Reto Grieder
    2222 #  Description:
    23  #    Finds the media directory and configures it's installation.
     23 #    Finds the external media directory and configures the media installation.
     24 #    Default search paths are: ../../media and ../media_extern
    2425 #
     26
     27# For dev runs we've got two media directory. The one from the other repository root folder
     28# is called EXTERNAL_MEDIA
     29SET(MEDIA_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
     30SET(MEDIA_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
    2531
    2632# Specify media directory
    2733GET_FILENAME_COMPONENT(_search_path_1 ${CMAKE_SOURCE_DIR}/../${DEFAULT_MEDIA_PATH} ABSOLUTE)
    28 FIND_PATH(MEDIA_PATH resources.cfg
     34FIND_PATH(EXTERNAL_MEDIA_DIRECTORY resources.oxr
    2935  PATHS
    30     ${CMAKE_SOURCE_DIR}/${DEFAULT_MEDIA_PATH}
     36    ${CMAKE_SOURCE_DIR}/media_extern
    3137    ${_search_path_1}
    3238  NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH
    3339)
    3440
    35 # For consistency with other variables for config, log, bin, etc.
    36 SET(CMAKE_MEDIA_OUTPUT_DIRECTORY ${MEDIA_PATH})
    37 
    38 IF(NOT CMAKE_MEDIA_OUTPUT_DIRECTORY)
    39   MESSAGE(STATUS "Warning: Media directory not found. If you want to compile while downloading the media files, you will have to recompile about four files afterwards and relink everything. Default location is orxonox_root/media")
     41IF(NOT EXTERNAL_MEDIA_DIRECTORY)
     42  MESSAGE(STATUS "Warning: External media directory not found. If you want to compile while downloading the data files, you will have to recompile about four files afterwards and relink everything.")
     43  MESSAGE(STATUS "You can specify your own folder with the EXTERNAL_MEDIA_DIRECTORY variable. Default location for the path is orxonox_root/media_extern")
    4044  # Temporary override to the default location.
    41   SET(CMAKE_MEDIA_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/media)
     45  SET(EXTERNAL_MEDIA_DIRECTORY ${CMAKE_SOURCE_DIR}/media_extern)
    4246ENDIF()
    4347
     
    4549################ Installation #################
    4650
     51# External directory
    4752INSTALL(
    48   DIRECTORY ${CMAKE_MEDIA_OUTPUT_DIRECTORY}/
    49   DESTINATION ${ORXONOX_MEDIA_INSTALL_PATH}
    50   REGEX "\\.svn$|_svn$|backToPNG" EXCLUDE
     53  DIRECTORY ${EXTERNAL_MEDIA_DIRECTORY}/
     54  DESTINATION ${MEDIA_INSTALL_DIRECTORY}
     55  REGEX "\\.svn$|_svn$" EXCLUDE
    5156)
  • code/branches/resource3/src/SpecialConfig.h.in

    r3370 r5679  
    7070
    7171// Handle default ConfigValues
    72 namespace orxonox
     72namespace orxonox { namespace specialConfig
    7373{
     74    // DEFAULT RELATIVE PATHS (might not be used at all)
     75    const char defaultRuntimePath[] = "@DEFAULT_RUNTIME_PATH@";
     76    const char defaultLibraryPath[] = "@DEFAULT_LIBRARY_PATH@";
     77    const char defaultArchivePath[] = "@DEFAULT_ARCHIVE_PATH@";
     78    const char defaultDocPath[]     = "@DEFAULT_DOC_PATH@";
     79    const char defaultMediaPath[]   = "@DEFAULT_MEDIA_PATH@";
     80    const char defaultConfigPath[]  = "@DEFAULT_CONFIG_PATH@";
     81    const char defaultLogPath[]     = "@DEFAULT_LOG_PATH@";
     82
    7483    // INSTALLATION PATHS
    75     const char ORXONOX_RUNTIME_INSTALL_PATH[] = "@ORXONOX_RUNTIME_INSTALL_PATH@";
    76     const char ORXONOX_MEDIA_INSTALL_PATH[]   = "@ORXONOX_MEDIA_INSTALL_PATH@";
    77     /* Config and Log path might be relative because they could be user and therefore runtime dependent */
    78     const char ORXONOX_CONFIG_INSTALL_PATH[]  = "@ORXONOX_CONFIG_INSTALL_PATH@";
    79     const char ORXONOX_LOG_INSTALL_PATH[]     = "@ORXONOX_LOG_INSTALL_PATH@";
     84    const char runtimeInstallDirectory[]    = "@RUNTIME_INSTALL_DIRECTORY@";
     85    const char mediaInstallDirectory[]      = "@MEDIA_INSTALL_DIRECTORY@";
     86    const char configInstallDirectory[]     = "@CONFIG_INSTALL_DIRECTORY@";
     87    const char logInstallDirectory[]        = "@LOG_INSTALL_DIRECTORY@";
    8088
    8189    // DEVELOPMENT RUN PATHS
    82     const char ORXONOX_MEDIA_DEV_PATH[]       = "@CMAKE_MEDIA_OUTPUT_DIRECTORY@";
     90    const char mediaDevDirectory[]          = "@MEDIA_DIRECTORY@";
     91    const char externalMediaDevDirectory[]  = "@EXTERNAL_MEDIA_DIRECTORY@";
    8392#ifdef CMAKE_CONFIGURATION_TYPES
    84     const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
    85     const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@/"    BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
     93    const char configDevDirectory[]         = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
     94    const char logDevDirectory[]            = "@CMAKE_LOG_OUTPUT_DIRECTORY@/"    BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
    8695#else
    87     const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@";
    88     const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@";
     96    const char configDevDirectory[]         = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@";
     97    const char logDevDirectory[]            = "@CMAKE_LOG_OUTPUT_DIRECTORY@";
    8998#endif
     99
    90100#ifdef DEPENDENCY_PACKAGE_ENABLE
    91     const char ORXONOX_DEP_LIB_PATH[]        = "@DEP_LIBRARY_DIR@";
     101    const char dependencyLibraryDirectory[] = "@DEP_LIBRARY_DIR@";
    92102#endif
    93103
    94104    // OGRE PLUGINS
    95105#ifdef NDEBUG
    96     const char ORXONOX_OGRE_PLUGINS[] = "@OGRE_PLUGINS_RELEASE@";
     106    const char ogrePlugins[] = "@OGRE_PLUGINS_RELEASE@";
    97107#  ifdef DEPENDENCY_PACKAGE_ENABLE
    98     const char ORXONOX_OGRE_PLUGINS_FOLDER[] = ".";
     108    const char ogrePluginsDirectory[] = ".";
    99109#  else
    100     const char ORXONOX_OGRE_PLUGINS_FOLDER[] = "@OGRE_PLUGINS_FOLDER_RELEASE@";
     110    const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_RELEASE@";
    101111#  endif
    102112#else
    103     const char ORXONOX_OGRE_PLUGINS[] = "@OGRE_PLUGINS_DEBUG@";
     113    const char ogrePlugins[] = "@OGRE_PLUGINS_DEBUG@";
    104114#  ifdef DEPENDENCY_PACKAGE_ENABLE
    105     const char ORXONOX_OGRE_PLUGINS_FOLDER[] = ".";
     115    const char ogrePluginsDirectory[] = ".";
    106116#  else
    107     const char ORXONOX_OGRE_PLUGINS_FOLDER[] = "@OGRE_PLUGINS_FOLDER_DEBUG@";
     117    const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_DEBUG@";
    108118#  endif
    109119#endif
    110 }
     120} }
    111121
    112122/**
  • code/branches/resource3/src/ceguilua/CMakeLists.txt

    r3196 r5679  
    6363                                CEGUI.pkg
    6464  DEPENDS              ${TOLUA_PARSER_DEPENDENCIES}
    65   WORKING_DIRECTORY    ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}
     65  WORKING_DIRECTORY    ${RUNTIME_LIBRARY_DIRECTORY}
    6666  COMMENT "Generating tolua bind files for package CEGUILua"
    6767)
  • code/branches/resource3/src/core/ConfigFileManager.cc

    r3370 r5679  
    230230        {
    231231            // Try to get default one from the media folder
    232             boost::filesystem::path defaultFilepath(Core::getMediaPath() / "defaultConfig" / this->filename_);
     232            boost::filesystem::path defaultFilepath(Core::getExternalMediaPath() / "defaultConfig" / this->filename_);
    233233            if (boost::filesystem::exists(defaultFilepath))
    234234            {
  • code/branches/resource3/src/core/Core.cc

    r5678 r5679  
    8585    Core* Core::singletonPtr_s  = 0;
    8686
    87     SetCommandLineArgument(mediaPath, "").information("Path to the media/data files");
     87    SetCommandLineArgument(externalMediaPath, "").information("Path to the external media files");
    8888    SetCommandLineOnlyArgument(writingPathSuffix, "").information("Additional subfolder for config and log files");
    8989    SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
     
    110110            this->setConfigValues();
    111111
    112             // Possible media path override by the command line
    113             if (!CommandLine::getArgument("mediaPath")->hasDefaultValue())
    114                 tsetMediaPath(CommandLine::getValue("mediaPath"));
     112            // External media directory only exists for dev runs
     113            if (Core::isDevelopmentRun())
     114            {
     115                // Possible media path override by the command line
     116                if (!CommandLine::getArgument("externalMediaPath")->hasDefaultValue())
     117                    tsetExternalMediaPath(CommandLine::getValue("externalMediaPath"));
     118            }
    115119        }
    116120
     
    145149                .description("If true, all random actions are different each time you start the game")
    146150                .callback(this, &CoreConfiguration::initializeRandomNumberGenerator);
    147 
    148             // Only show this config value for development builds
    149             if (Core::isDevelopmentRun())
    150             {
    151                 SetConfigValue(mediaPathString_, mediaPath_.string())
    152                     .description("Relative path to the game data.")
    153                     .callback(this, &CoreConfiguration::mediaPathChanged);
    154             }
    155151        }
    156152
     
    183179
    184180        /**
    185         @brief
    186             Callback function if the media path has changed.
    187         */
    188         void mediaPathChanged()
    189         {
    190             mediaPath_ = boost::filesystem::path(this->mediaPathString_);
    191         }
    192 
    193         /**
    194181            @brief Sets the language in the config-file back to the default.
    195182        */
     
    205192            The new media path
    206193        */
    207         void tsetMediaPath(const std::string& path)
    208         {
    209             if (Core::isDevelopmentRun())
    210             {
    211                 ModifyConfigValue(mediaPathString_, tset, path);
    212             }
    213             else
    214             {
    215                 // Manual 'config' value without the file entry
    216                 mediaPathString_ = path;
    217                 this->mediaPathChanged();
    218             }
     194        void tsetExternalMediaPath(const std::string& path)
     195        {
     196            mediaPath_ = boost::filesystem::path(path);
    219197        }
    220198
     
    236214        std::string language_;                          //!< The language
    237215        bool bInitializeRandomNumberGenerator_;         //!< If true, srand(time(0)) is called
    238         std::string mediaPathString_;                   //!< Path to the data/media file folder as string
    239216
    240217        //! Path to the parent directory of the ones above if program was installed with relativ pahts
     
    242219        boost::filesystem::path executablePath_;        //!< Path to the executable
    243220        boost::filesystem::path mediaPath_;             //!< Path to the media file folder
     221        boost::filesystem::path externalMediaPath_;     //!< Path to the media file folder
    244222        boost::filesystem::path configPath_;            //!< Path to the config file folder
    245223        boost::filesystem::path logPath_;               //!< Path to the log file folder
     
    311289
    312290        // initialise Tcl
    313         this->tclBind_.reset(new TclBind(Core::getMediaPathString()));
     291        this->tclBind_.reset(new TclBind(Core::getExternalMediaPathString()));
    314292        this->tclThreadManager_.reset(new TclThreadManager(tclBind_->getTclInterpreter()));
    315293
     
    427405    }
    428406
    429     /*static*/ void Core::tsetMediaPath(const std::string& path)
    430     {
    431         getInstance().configuration_->tsetMediaPath(path);
     407    /*static*/ void Core::tsetExternalMediaPath(const std::string& path)
     408    {
     409        getInstance().configuration_->tsetExternalMediaPath(path);
    432410    }
    433411
     
    439417    {
    440418        return getInstance().configuration_->mediaPath_.string() + '/';
     419    }
     420
     421    /*static*/ const boost::filesystem::path& Core::getExternalMediaPath()
     422    {
     423        return getInstance().configuration_->externalMediaPath_;
     424    }
     425    /*static*/ std::string Core::getExternalMediaPathString()
     426    {
     427        return getInstance().configuration_->externalMediaPath_.string() + '/';
    441428    }
    442429
     
    578565            COUT(1) << "Running from the build tree." << std::endl;
    579566            Core::bDevRun_ = true;
    580             configuration_->mediaPath_  = ORXONOX_MEDIA_DEV_PATH;
    581             configuration_->configPath_ = ORXONOX_CONFIG_DEV_PATH;
    582             configuration_->logPath_    = ORXONOX_LOG_DEV_PATH;
     567            configuration_->mediaPath_  = specialConfig::mediaDevDirectory;
     568            configuration_->externalMediaPath_ = specialConfig::externalMediaDevDirectory;
     569            configuration_->configPath_ = specialConfig::configDevDirectory;
     570            configuration_->logPath_    = specialConfig::logDevDirectory;
    583571        }
    584572        else
     
    586574#ifdef INSTALL_COPYABLE // --> relative paths
    587575            // Also set the root path
    588             boost::filesystem::path relativeExecutablePath(ORXONOX_RUNTIME_INSTALL_PATH);
     576            boost::filesystem::path relativeExecutablePath(specialConfig::defaultRuntimePath);
    589577            configuration_->rootPath_ = configuration_->executablePath_;
    590578            while (!boost::filesystem::equivalent(configuration_->rootPath_ / relativeExecutablePath, configuration_->executablePath_)
     
    595583
    596584            // Using paths relative to the install prefix, complete them
    597             configuration_->mediaPath_  = configuration_->rootPath_ / ORXONOX_MEDIA_INSTALL_PATH;
    598             configuration_->configPath_ = configuration_->rootPath_ / ORXONOX_CONFIG_INSTALL_PATH;
    599             configuration_->logPath_    = configuration_->rootPath_ / ORXONOX_LOG_INSTALL_PATH;
     585            configuration_->mediaPath_  = configuration_->rootPath_ / specialConfig::defaultMediaPath;
     586            configuration_->configPath_ = configuration_->rootPath_ / specialConfig::defaultConfigPath;
     587            configuration_->logPath_    = configuration_->rootPath_ / specialConfig::defaultLogPath;
    600588#else
    601589            // There is no root path, so don't set it at all
    602590
    603             configuration_->mediaPath_  = ORXONOX_MEDIA_INSTALL_PATH;
     591            configuration_->mediaPath_  = specialConfig::mediaInstallDirectory;
    604592
    605593            // Get user directory
     
    614602            userDataPath /= ".orxonox";
    615603
    616             configuration_->configPath_ = userDataPath / ORXONOX_CONFIG_INSTALL_PATH;
    617             configuration_->logPath_    = userDataPath / ORXONOX_LOG_INSTALL_PATH;
     604            configuration_->configPath_ = userDataPath / specialConfig::defaultConfigPath;
     605            configuration_->logPath_    = userDataPath / specialConfig::defaultLogPath;
    618606#endif
    619607        }
  • code/branches/resource3/src/core/Core.h

    r5677 r5679  
    8989            static void  resetLanguage();
    9090
    91             static void tsetMediaPath(const std::string& path);
    92             //! Returns the path to the config files as boost::filesystem::path
     91            static void tsetExternalMediaPath(const std::string& path);
     92            //! Returns the path to the data files as boost::filesystem::path
    9393            static const boost::filesystem::path& getMediaPath();
     94            //! Returns the path to the external data files as boost::filesystem::path
     95            static const boost::filesystem::path& getExternalMediaPath();
    9496            //! Returns the path to the config files as boost::filesystem::path
    9597            static const boost::filesystem::path& getConfigPath();
    9698            //! Returns the path to the log files as boost::filesystem::path
    9799            static const boost::filesystem::path& getLogPath();
     100            //! Returns the path to the data files as std::string
    98101            //! Returns the path to the root folder as boost::filesystem::path
    99102            static const boost::filesystem::path& getRootPath();
    100             //! Returns the path to the data files as std::string
    101103            static std::string getMediaPathString();
     104            //! Returns the path to the external data files as std::string
     105            static std::string getExternalMediaPathString();
    102106            //! Returns the path to the config files as std::string
    103107            static std::string getConfigPathString();
  • code/branches/resource3/src/core/GUIManager.cc

    r3370 r5679  
    171171    {
    172172        // set datapath for GUI data
    173         lua_pushfstring(this->scriptModule_->getLuaState(), Core::getMediaPathString().c_str());
     173        lua_pushfstring(this->scriptModule_->getLuaState(), Core::getExternalMediaPathString().c_str());
    174174        lua_setglobal(this->scriptModule_->getLuaState(), "datapath");
    175175        // call main Lua script
  • code/branches/resource3/src/core/GraphicsManager.cc

    r5677 r5679  
    117117        SetConfigValue(ogreConfigFile_,  "ogre.cfg")
    118118            .description("Location of the Ogre config file");
    119         SetConfigValue(ogrePluginsFolder_, ORXONOX_OGRE_PLUGINS_FOLDER)
     119        SetConfigValue(ogrePluginsDirectory_, specialConfig::ogrePluginsDirectory)
    120120            .description("Folder where the Ogre plugins are located.");
    121         SetConfigValue(ogrePlugins_, ORXONOX_OGRE_PLUGINS)
     121        SetConfigValue(ogrePlugins_, specialConfig::ogrePlugins)
    122122            .description("Comma separated list of all plugins to load.");
    123123        SetConfigValue(ogreLogFile_,     "ogre.log")
     
    204204    {
    205205        // just to make sure the next statement doesn't segfault
    206         if (ogrePluginsFolder_ == "")
    207             ogrePluginsFolder_ = ".";
    208 
    209         boost::filesystem::path folder(ogrePluginsFolder_);
     206        if (ogrePluginsDirectory_ == "")
     207            ogrePluginsDirectory_ = ".";
     208
     209        boost::filesystem::path folder(ogrePluginsDirectory_);
    210210        // Do some SubString magic to get the comma separated list of plugins
    211211        SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '(', ')', false, '\0');
     
    231231        try
    232232        {
    233             cf.load((Core::getMediaPath() / resourceFile_).string());
     233            cf.load((Core::getExternalMediaPath() / resourceFile_).string());
    234234        }
    235235        catch (...)
     
    257257
    258258                    Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
    259                         (Core::getMediaPath() / archName).string(), typeName, secName);
     259                        (Core::getExternalMediaPath() / archName).string(), typeName, secName);
    260260                }
    261261            }
  • code/branches/resource3/src/core/GraphicsManager.h

    r5677 r5679  
    101101        std::string         resourceFile_;             //!< resources file name
    102102        std::string         ogreConfigFile_;           //!< ogre config file name
    103         std::string         ogrePluginsFolder_;        //!< Folder where the Ogre plugins are located
     103        std::string         ogrePluginsDirectory_;     //!< Directory where the Ogre plugins are located
    104104        std::string         ogrePlugins_;              //!< Comma separated list of all plugins to load
    105105        std::string         ogreLogFile_;              //!< log file name for Ogre log messages
  • code/branches/resource3/src/core/LuaBind.cc

    r3370 r5679  
    4747  LuaBind::LuaBind()
    4848  {
    49     this->includePath_ = Core::getMediaPathString();
     49    this->includePath_ = Core::getExternalMediaPathString();
    5050
    5151    luaState_ = lua_open();
  • code/branches/resource3/src/core/TclBind.cc

    r3370 r5679  
    127127#ifdef DEPENDENCY_PACKAGE_ENABLE
    128128        if (Core::isDevelopmentRun())
    129             return (std::string(ORXONOX_DEP_LIB_PATH) + "/tcl");
     129            return (std::string(specialConfig::dependencyLibraryDirectory) + "/tcl");
    130130        else
    131131            return (Core::getRootPathString() + "lib/tcl");
  • code/branches/resource3/src/orxonox/LevelManager.cc

    r3370 r5679  
    135135        availableLevels_.clear();
    136136
    137         boost::filesystem::directory_iterator file(Core::getMediaPathString() + "levels");
     137        boost::filesystem::directory_iterator file(Core::getExternalMediaPathString() + "levels");
    138138        boost::filesystem::directory_iterator end;
    139139
  • code/branches/resource3/src/orxonox/gamestates/GSGraphics.cc

    r3370 r5679  
    9696        // load debug overlay
    9797        COUT(3) << "Loading Debug Overlay..." << std::endl;
    98         this->debugOverlay_ = new XMLFile(Core::getMediaPathString() + "overlay/debug.oxo");
     98        this->debugOverlay_ = new XMLFile(Core::getExternalMediaPathString() + "overlay/debug.oxo");
    9999        Loader::open(debugOverlay_);
    100100
  • code/branches/resource3/src/orxonox/gamestates/GSLevel.cc

    r5677 r5679  
    246246        // call the loader
    247247        COUT(0) << "Loading level..." << std::endl;
    248         startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + LevelManager::getInstance().getDefaultLevel());
     248        startFile_s = new XMLFile(Core::getExternalMediaPathString() + "levels" + '/' + LevelManager::getInstance().getDefaultLevel());
    249249        Loader::open(startFile_s);
    250250    }
  • code/branches/resource3/src/orxonox/objects/Level.cc

    r3325 r5679  
    5454        this->xmlfilename_ = this->getFilename();
    5555
    56         if (this->xmlfilename_.length() >= Core::getMediaPathString().length())
    57             this->xmlfilename_ = this->xmlfilename_.substr(Core::getMediaPathString().length());
     56        if (this->xmlfilename_.length() >= Core::getExternalMediaPathString().length())
     57            this->xmlfilename_ = this->xmlfilename_.substr(Core::getExternalMediaPathString().length());
    5858    }
    5959
     
    101101        mask.include(Class(OverlayGroup)); // HACK to include the ChatOverlay
    102102
    103         this->xmlfile_ = new XMLFile(Core::getMediaPathString() + this->xmlfilename_, mask);
     103        this->xmlfile_ = new XMLFile(Core::getExternalMediaPathString() + this->xmlfilename_, mask);
    104104
    105105        Loader::open(this->xmlfile_);
  • code/branches/resource3/src/orxonox/orxonox.vcproj.user.in

    r3196 r5679  
    1111                        <DebugSettings
    1212                                WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
    13                                 Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
     13                                Environment="Path=${RUNTIME_LIBRARY_DIRECTORY}"
    1414                                EnvironmentMerge="true"
    1515                        />
     
    2020                        <DebugSettings
    2121                                WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
    22                                 Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
     22                                Environment="Path=${RUNTIME_LIBRARY_DIRECTORY}"
    2323                                EnvironmentMerge="true"
    2424                        />
     
    2929                        <DebugSettings
    3030                                WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
    31                                 Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
     31                                Environment="Path=${RUNTIME_LIBRARY_DIRECTORY}"
    3232                                EnvironmentMerge="true"
    3333                        />
     
    3838                        <DebugSettings
    3939                                WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
    40                                 Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
     40                                Environment="Path=${RUNTIME_LIBRARY_DIRECTORY}"
    4141                                EnvironmentMerge="true"
    4242                        />
  • code/branches/resource3/src/orxonox/sound/SoundBase.cc

    r3370 r5679  
    135135
    136136    bool SoundBase::loadFile(std::string filename) {
    137         filename = Core::getMediaPathString() + "/audio/" + filename;
     137        filename = Core::getExternalMediaPathString() + "/audio/" + filename;
    138138
    139139        if(!SoundManager::getInstance().isSoundAvailable())
Note: See TracChangeset for help on using the changeset viewer.