Changeset 5641
- Timestamp:
- Aug 13, 2009, 9:12:24 PM (15 years ago)
- Location:
- code/branches/resource2
- Files:
-
- 2 added
- 1 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource2/CMakeLists.txt
r3316 r5641 47 47 48 48 # Configure media directory location and installation 49 INCLUDE(Media)49 ADD_SUBDIRECTORY(media) 50 50 51 51 # Create the actual project -
code/branches/resource2/bin/CMakeLists.txt
r3196 r5641 45 45 SEt(_default_subdir) # No default subdir 46 46 ENDIF() 47 STRING(REPLACE "/" "\\" ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY})47 STRING(REPLACE "/" "\\" RUNTIME_LIBRARY_DIRECTORY_WINDOWS ${RUNTIME_LIBRARY_DIRECTORY}) 48 48 FOREACH(_subdir ${_subdirs}) 49 49 GET_FILENAME_COMPONENT(CURRENT_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_subdir} ABSOLUTE) … … 69 69 # Make a symlink to be able to run from the root directory when installing copyable on Unix 70 70 IF(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)") 72 72 ENDIF() -
code/branches/resource2/bin/client1.bat.in
r3068 r5641 1 1 title @PROJECT_NAME@ 2 path @ ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%2 path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path% 3 3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --client --writingPathSuffix client1 4 4 pause -
code/branches/resource2/bin/client2.bat.in
r3068 r5641 1 1 title @PROJECT_NAME@ 2 path @ ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%2 path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path% 3 3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --client --writingPathSuffix client2 4 4 pause -
code/branches/resource2/bin/dedicated.bat.in
r3068 r5641 1 1 title @PROJECT_NAME@ 2 path @ ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%2 path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path% 3 3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --dedicated --writingPathSuffix dedicated 4 4 pause -
code/branches/resource2/bin/run.bat.in
r3068 r5641 1 1 title @PROJECT_NAME@ 2 path @ ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%2 path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path% 3 3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ 4 4 pause -
code/branches/resource2/bin/server.bat.in
r3068 r5641 1 1 title @PROJECT_NAME@ 2 path @ ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%2 path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path% 3 3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --server --writingPathSuffix server 4 4 pause -
code/branches/resource2/bin/standalone.bat.in
r3068 r5641 1 1 title @PROJECT_NAME@ 2 path @ ORXONOX_RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%2 path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path% 3 3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --standalone --writingPathSuffix standalone 4 4 pause -
code/branches/resource2/cmake/BuildConfig.cmake
r3330 r5641 40 40 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH}) 41 41 SET(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_..._PATH42 SET(CMAKE_DOC_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_DOC_PATH}) 43 # Media directories are only inputs 44 44 SET(CMAKE_CONFIG_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_CONFIG_PATH}) 45 45 SET(CMAKE_LOG_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LOG_PATH}) … … 50 50 # Sets where to find the external libraries like OgreMain.dll at runtime 51 51 # 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})52 IF(NOT RUNTIME_LIBRARY_DIRECTORY) 53 SET(RUNTIME_LIBRARY_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) 54 54 ENDIF() 55 55 … … 126 126 ENDIF() 127 127 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 129 SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH}) 130 SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH}) 131 SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH}) 132 SET(DOC_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH}) 133 SET(MEDIA_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MEDIA_PATH}) 134 SET(CONFIG_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_CONFIG_PATH}) 135 SET(LOG_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LOG_PATH}) 136 137 IF(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 156 147 # 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) 159 150 ENDIF() 160 151 … … 170 161 171 162 # the RPATH to be used when installing 172 SET(CMAKE_INSTALL_RPATH ${ORXONOX_LIBRARY_INSTALL_PATH}) 163 IF(INSTALL_COPYABLE) 164 SET(CMAKE_INSTALL_RPATH ${DEFAULT_LIBRARY_PATH}) 165 ELSE() 166 SET(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_DIRECTORY}) 167 ENDIF() 173 168 174 169 # add the automatically determined parts of the RPATH -
code/branches/resource2/cmake/GenerateToluaBindings.cmake
r3368 r5641 30 30 # TOLUA_PARSER_SOURCE - Lua file with the parser source code 31 31 # TOLUA_PARSER_DEPENDENCIES - All the dependent lua files 32 # ORXONOX_RUNTIME_LIBRARY_DIRECTORY - Working directory32 # RUNTIME_LIBRARY_DIRECTORY - Working directory 33 33 # 34 34 … … 74 74 DEPENDS ${TOLUA_PARSER_DEPENDENCIES} 75 75 IMPLICIT_DEPENDS ${_implicit_dependencies} 76 WORKING_DIRECTORY ${ ORXONOX_RUNTIME_LIBRARY_DIRECTORY}76 WORKING_DIRECTORY ${RUNTIME_LIBRARY_DIRECTORY} 77 77 COMMENT "Generating tolua bind files for package ${_tolua_package}" 78 78 ) -
code/branches/resource2/cmake/PackageConfig.cmake
r3370 r5641 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 # 3 26 4 27 # Check package version info -
code/branches/resource2/cmake/PackageConfigMSVC.cmake
r3370 r5641 47 47 48 48 # Also the directory with the runtime libraries 49 SET( ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${DEP_BINARY_DIR})49 SET(RUNTIME_LIBRARY_DIRECTORY ${DEP_BINARY_DIR}) 50 50 51 51 # Sets the library path for the FIND_LIBRARY -
code/branches/resource2/cmake/PackageConfigMinGW.cmake
r3196 r5641 40 40 41 41 # Also the directory with the runtime libraries 42 SET( ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${DEP_BINARY_DIR})42 SET(RUNTIME_LIBRARY_DIRECTORY ${DEP_BINARY_DIR}) 43 43 44 44 # Sets the library path for the FIND_LIBRARY -
code/branches/resource2/cmake/TargetUtilities.cmake
r3371 r5641 175 175 IF(NOT _arg_STATIC AND NOT _arg_NO_INSTALL) 176 176 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} 180 180 ) 181 181 ENDIF() -
code/branches/resource2/doc/api/CMakeLists.txt
r3196 r5641 76 76 INSTALL( 77 77 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 80 79 ) 81 80 # Install command always needs the directory … … 85 84 INSTALL( 86 85 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html 87 DESTINATION ${ ORXONOX_DOC_INSTALL_PATH}/api86 DESTINATION ${DOC_INSTALL_DIRECTORY}/api 88 87 ) 89 88 ENDIF(DOXYGEN_FOUND) -
code/branches/resource2/src/SpecialConfig.h.in
r3370 r5641 70 70 71 71 // Handle default ConfigValues 72 namespace orxonox 72 namespace orxonox { namespace specialConfig 73 73 { 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 74 83 // 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@"; 80 88 81 89 // 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@"; 83 92 #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); 86 95 #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@"; 89 98 #endif 99 90 100 #ifdef DEPENDENCY_PACKAGE_ENABLE 91 const char ORXONOX_DEP_LIB_PATH[]= "@DEP_LIBRARY_DIR@";101 const char dependencyLibraryDirectory[] = "@DEP_LIBRARY_DIR@"; 92 102 #endif 93 103 94 104 // OGRE PLUGINS 95 105 #ifdef NDEBUG 96 const char ORXONOX_OGRE_PLUGINS[] = "@OGRE_PLUGINS_RELEASE@";106 const char ogrePlugins[] = "@OGRE_PLUGINS_RELEASE@"; 97 107 # ifdef DEPENDENCY_PACKAGE_ENABLE 98 const char ORXONOX_OGRE_PLUGINS_FOLDER[] = ".";108 const char ogrePluginsDirectory[] = "."; 99 109 # else 100 const char ORXONOX_OGRE_PLUGINS_FOLDER[] = "@OGRE_PLUGINS_FOLDER_RELEASE@";110 const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_RELEASE@"; 101 111 # endif 102 112 #else 103 const char ORXONOX_OGRE_PLUGINS[] = "@OGRE_PLUGINS_DEBUG@";113 const char ogrePlugins[] = "@OGRE_PLUGINS_DEBUG@"; 104 114 # ifdef DEPENDENCY_PACKAGE_ENABLE 105 const char ORXONOX_OGRE_PLUGINS_FOLDER[] = ".";115 const char ogrePluginsDirectory[] = "."; 106 116 # else 107 const char ORXONOX_OGRE_PLUGINS_FOLDER[] = "@OGRE_PLUGINS_FOLDER_DEBUG@";117 const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_DEBUG@"; 108 118 # endif 109 119 #endif 110 } 120 } } 111 121 112 122 /** -
code/branches/resource2/src/core/Core.cc
r5614 r5641 85 85 Core* Core::singletonPtr_s = 0; 86 86 87 SetCommandLineArgument( mediaPath, "").information("Path to the media/data files");87 SetCommandLineArgument(externalMediaPath, "").information("Path to the external media files"); 88 88 SetCommandLineOnlyArgument(writingPathSuffix, "").information("Additional subfolder for config and log files"); 89 89 SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file"); … … 110 110 this->setConfigValues(); 111 111 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 } 115 119 } 116 120 … … 145 149 .description("If true, all random actions are different each time you start the game") 146 150 .callback(this, &CoreConfiguration::initializeRandomNumberGenerator); 147 148 // Only show this config value for development builds149 if (Core::isDevelopmentRun())150 {151 SetConfigValue(mediaPathString_, mediaPath_.string())152 .description("Relative path to the game data.")153 .callback(this, &CoreConfiguration::mediaPathChanged);154 }155 151 } 156 152 … … 183 179 184 180 /** 185 @brief186 Callback function if the media path has changed.187 */188 void mediaPathChanged()189 {190 mediaPath_ = boost::filesystem::path(this->mediaPathString_);191 }192 193 /**194 181 @brief Sets the language in the config-file back to the default. 195 182 */ … … 205 192 The new media path 206 193 */ 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); 219 197 } 220 198 … … 236 214 std::string language_; //!< The language 237 215 bool bInitializeRandomNumberGenerator_; //!< If true, srand(time(0)) is called 238 std::string mediaPathString_; //!< Path to the data/media file folder as string239 216 240 217 //! Path to the parent directory of the ones above if program was installed with relativ pahts … … 242 219 boost::filesystem::path executablePath_; //!< Path to the executable 243 220 boost::filesystem::path mediaPath_; //!< Path to the media file folder 221 boost::filesystem::path externalMediaPath_; //!< Path to the media file folder 244 222 boost::filesystem::path configPath_; //!< Path to the config file folder 245 223 boost::filesystem::path logPath_; //!< Path to the log file folder … … 423 401 } 424 402 425 /*static*/ void Core::tset MediaPath(const std::string& path)426 { 427 getInstance().configuration_->tset MediaPath(path);403 /*static*/ void Core::tsetExternalMediaPath(const std::string& path) 404 { 405 getInstance().configuration_->tsetExternalMediaPath(path); 428 406 } 429 407 … … 435 413 { 436 414 return getInstance().configuration_->mediaPath_.string() + '/'; 415 } 416 417 /*static*/ const boost::filesystem::path& Core::getExternalMediaPath() 418 { 419 return getInstance().configuration_->externalMediaPath_; 420 } 421 /*static*/ std::string Core::getExternalMediaPathString() 422 { 423 return getInstance().configuration_->externalMediaPath_.string() + '/'; 437 424 } 438 425 … … 574 561 COUT(1) << "Running from the build tree." << std::endl; 575 562 Core::bDevRun_ = true; 576 configuration_->mediaPath_ = ORXONOX_MEDIA_DEV_PATH; 577 configuration_->configPath_ = ORXONOX_CONFIG_DEV_PATH; 578 configuration_->logPath_ = ORXONOX_LOG_DEV_PATH; 563 configuration_->mediaPath_ = specialConfig::mediaDevDirectory; 564 configuration_->externalMediaPath_ = specialConfig::externalMediaDevDirectory; 565 configuration_->configPath_ = specialConfig::configDevDirectory; 566 configuration_->logPath_ = specialConfig::logDevDirectory; 579 567 } 580 568 else … … 582 570 #ifdef INSTALL_COPYABLE // --> relative paths 583 571 // Also set the root path 584 boost::filesystem::path relativeExecutablePath( ORXONOX_RUNTIME_INSTALL_PATH);572 boost::filesystem::path relativeExecutablePath(specialConfig::defaultRuntimePath); 585 573 configuration_->rootPath_ = configuration_->executablePath_; 586 574 while (!boost::filesystem::equivalent(configuration_->rootPath_ / relativeExecutablePath, configuration_->executablePath_) … … 591 579 592 580 // Using paths relative to the install prefix, complete them 593 configuration_->mediaPath_ = configuration_->rootPath_ / ORXONOX_MEDIA_INSTALL_PATH;594 configuration_->configPath_ = configuration_->rootPath_ / ORXONOX_CONFIG_INSTALL_PATH;595 configuration_->logPath_ = configuration_->rootPath_ / ORXONOX_LOG_INSTALL_PATH;581 configuration_->mediaPath_ = configuration_->rootPath_ / specialConfig::defaultMediaPath; 582 configuration_->configPath_ = configuration_->rootPath_ / specialConfig::defaultConfigPath; 583 configuration_->logPath_ = configuration_->rootPath_ / specialConfig::defaultLogPath; 596 584 #else 597 585 // There is no root path, so don't set it at all 598 586 599 configuration_->mediaPath_ = ORXONOX_MEDIA_INSTALL_PATH;587 configuration_->mediaPath_ = specialConfig::mediaInstallDirectory; 600 588 601 589 // Get user directory … … 610 598 userDataPath /= ".orxonox"; 611 599 612 configuration_->configPath_ = userDataPath / ORXONOX_CONFIG_INSTALL_PATH;613 configuration_->logPath_ = userDataPath / ORXONOX_LOG_INSTALL_PATH;600 configuration_->configPath_ = userDataPath / specialConfig::defaultConfigPath; 601 configuration_->logPath_ = userDataPath / specialConfig::defaultLogPath; 614 602 #endif 615 603 } -
code/branches/resource2/src/core/Core.h
r3370 r5641 91 91 static void resetLanguage(); 92 92 93 static void tset MediaPath(const std::string& path);94 //! Returns the path to the configfiles as boost::filesystem::path93 static void tsetExternalMediaPath(const std::string& path); 94 //! Returns the path to the data files as boost::filesystem::path 95 95 static const boost::filesystem::path& getMediaPath(); 96 //! Returns the path to the external data files as boost::filesystem::path 97 static const boost::filesystem::path& getExternalMediaPath(); 96 98 //! Returns the path to the config files as boost::filesystem::path 97 99 static const boost::filesystem::path& getConfigPath(); 98 100 //! Returns the path to the log files as boost::filesystem::path 99 101 static const boost::filesystem::path& getLogPath(); 102 //! Returns the path to the data files as std::string 100 103 //! Returns the path to the root folder as boost::filesystem::path 101 104 static const boost::filesystem::path& getRootPath(); 102 //! Returns the path to the data files as std::string103 105 static std::string getMediaPathString(); 106 //! Returns the path to the external data files as std::string 107 static std::string getExternalMediaPathString(); 104 108 //! Returns the path to the config files as std::string 105 109 static std::string getConfigPathString(); -
code/branches/resource2/src/core/GraphicsManager.cc
r5614 r5641 115 115 SetConfigValue(ogreConfigFile_, "ogre.cfg") 116 116 .description("Location of the Ogre config file"); 117 SetConfigValue(ogrePlugins Folder_, ORXONOX_OGRE_PLUGINS_FOLDER)117 SetConfigValue(ogrePluginsDirectory_, specialConfig::ogrePluginsDirectory) 118 118 .description("Folder where the Ogre plugins are located."); 119 SetConfigValue(ogrePlugins_, ORXONOX_OGRE_PLUGINS)119 SetConfigValue(ogrePlugins_, specialConfig::ogrePlugins) 120 120 .description("Comma separated list of all plugins to load."); 121 121 SetConfigValue(ogreLogFile_, "ogre.log") … … 198 198 { 199 199 // just to make sure the next statement doesn't segfault 200 if (ogrePlugins Folder_ == "")201 ogrePlugins Folder_ = ".";202 203 boost::filesystem::path folder(ogrePlugins Folder_);200 if (ogrePluginsDirectory_ == "") 201 ogrePluginsDirectory_ = "."; 202 203 boost::filesystem::path folder(ogrePluginsDirectory_); 204 204 // Do some SubString magic to get the comma separated list of plugins 205 205 SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '(', ')', false, '\0'); -
code/branches/resource2/src/core/GraphicsManager.h
r5614 r5641 98 98 // config values 99 99 std::string ogreConfigFile_; //!< ogre config file name 100 std::string ogrePlugins Folder_; //!< Folderwhere the Ogre plugins are located100 std::string ogrePluginsDirectory_; //!< Directory where the Ogre plugins are located 101 101 std::string ogrePlugins_; //!< Comma separated list of all plugins to load 102 102 std::string ogreLogFile_; //!< log file name for Ogre log messages -
code/branches/resource2/src/core/TclBind.cc
r3370 r5641 127 127 #ifdef DEPENDENCY_PACKAGE_ENABLE 128 128 if (Core::isDevelopmentRun()) 129 return (std::string( ORXONOX_DEP_LIB_PATH) + "/tcl");129 return (std::string(specialConfig::dependencyLibraryDirectory) + "/tcl"); 130 130 else 131 131 return (Core::getRootPathString() + "lib/tcl"); -
code/branches/resource2/src/orxonox/orxonox.vcproj.user.in
r3196 r5641 11 11 <DebugSettings 12 12 WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)" 13 Environment="Path=${ ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"13 Environment="Path=${RUNTIME_LIBRARY_DIRECTORY}" 14 14 EnvironmentMerge="true" 15 15 /> … … 20 20 <DebugSettings 21 21 WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)" 22 Environment="Path=${ ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"22 Environment="Path=${RUNTIME_LIBRARY_DIRECTORY}" 23 23 EnvironmentMerge="true" 24 24 /> … … 29 29 <DebugSettings 30 30 WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)" 31 Environment="Path=${ ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"31 Environment="Path=${RUNTIME_LIBRARY_DIRECTORY}" 32 32 EnvironmentMerge="true" 33 33 /> … … 38 38 <DebugSettings 39 39 WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)" 40 Environment="Path=${ ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"40 Environment="Path=${RUNTIME_LIBRARY_DIRECTORY}" 41 41 EnvironmentMerge="true" 42 42 />
Note: See TracChangeset
for help on using the changeset viewer.