Changeset 5666 for code/branches/libraries/src
- Timestamp:
- Aug 21, 2009, 2:17:09 PM (15 years ago)
- Location:
- code/branches/libraries/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/libraries/src/SpecialConfig.h.in
r5626 r5666 74 74 // INSTALLATION PATHS 75 75 const char ORXONOX_RUNTIME_INSTALL_PATH[] = "@ORXONOX_RUNTIME_INSTALL_PATH@"; 76 const char ORXONOX_ PLUGIN_INSTALL_PATH[] = "@ORXONOX_PLUGIN_INSTALL_PATH@";76 const char ORXONOX_MODULE_INSTALL_PATH[] = "@ORXONOX_MODULE_INSTALL_PATH@"; 77 77 const char ORXONOX_MEDIA_INSTALL_PATH[] = "@ORXONOX_MEDIA_INSTALL_PATH@"; 78 78 /* Config and Log path might be relative because they could be user and therefore runtime dependent */ … … 83 83 const char ORXONOX_MEDIA_DEV_PATH[] = "@CMAKE_MEDIA_OUTPUT_DIRECTORY@"; 84 84 #ifdef CMAKE_CONFIGURATION_TYPES 85 const char ORXONOX_ PLUGIN_DEV_PATH[] = "@CMAKE_PLUGIN_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);85 const char ORXONOX_MODULE_DEV_PATH[] = "@CMAKE_MODULE_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE); 86 86 const char ORXONOX_CONFIG_DEV_PATH[] = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE); 87 87 const char ORXONOX_LOG_DEV_PATH[] = "@CMAKE_LOG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE); 88 88 #else 89 const char ORXONOX_ PLUGIN_DEV_PATH[] = "@CMAKE_PLUGIN_OUTPUT_DIRECTORY@";89 const char ORXONOX_MODULE_DEV_PATH[] = "@CMAKE_MODULE_OUTPUT_DIRECTORY@"; 90 90 const char ORXONOX_CONFIG_DEV_PATH[] = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@"; 91 91 const char ORXONOX_LOG_DEV_PATH[] = "@CMAKE_LOG_OUTPUT_DIRECTORY@"; … … 94 94 const char ORXONOX_DEP_LIB_PATH[] = "@DEP_LIBRARY_DIR@"; 95 95 #endif 96 97 // Module extension 98 const char ORXONOX_MODULE_EXTENSION[] = "@ORXONOX_MODULE_EXTENSION@"; 96 99 97 100 // OGRE PLUGINS -
code/branches/libraries/src/core/Core.cc
r5665 r5666 250 250 boost::filesystem::path rootPath_; 251 251 boost::filesystem::path executablePath_; //!< Path to the executable 252 boost::filesystem::path pluginPath_; //!< Path to the plugins252 boost::filesystem::path modulePath_; //!< Path to the modules 253 253 boost::filesystem::path mediaPath_; //!< Path to the media file folder 254 254 boost::filesystem::path configPath_; //!< Path to the config file folder … … 272 272 this->dynLibManager_.reset(new DynLibManager()); 273 273 274 // Load plugins274 // Load modules 275 275 try 276 276 { 277 277 // We search for helper files with the following extension 278 std::string pluginextension = ".plugin";279 size_t pluginextensionlength = pluginextension.size();278 std::string moduleextension = ORXONOX_MODULE_EXTENSION; 279 size_t moduleextensionlength = moduleextension.size(); 280 280 281 281 // Search in the directory of our executable 282 boost::filesystem::path searchpath = this->configuration_-> pluginPath_;283 284 // Add that path to the PATH variable in case a plugindepends on another one282 boost::filesystem::path searchpath = this->configuration_->modulePath_; 283 284 // Add that path to the PATH variable in case a module depends on another one 285 285 std::string pathVariable = getenv("PATH"); 286 putenv(const_cast<char*>(("PATH=" + pathVariable + ";" + configuration_-> pluginPath_.string()).c_str()));286 putenv(const_cast<char*>(("PATH=" + pathVariable + ";" + configuration_->modulePath_.string()).c_str())); 287 287 288 288 boost::filesystem::directory_iterator file(searchpath); … … 295 295 296 296 // Check if the file ends with the exension in question 297 if (filename.size() > pluginextensionlength)297 if (filename.size() > moduleextensionlength) 298 298 { 299 if (filename.substr(filename.size() - pluginextensionlength) == pluginextension)299 if (filename.substr(filename.size() - moduleextensionlength) == moduleextension) 300 300 { 301 301 // We've found a helper file - now load the library with the same name 302 std::string library = filename.substr(0, filename.size() - pluginextensionlength);302 std::string library = filename.substr(0, filename.size() - moduleextensionlength); 303 303 boost::filesystem::path librarypath = searchpath / library; 304 304 … … 309 309 catch (const std::exception& e) 310 310 { 311 COUT(1) << "Couldn't load plugin\"" << librarypath.string() << "\": " << e.what() << std::endl;311 COUT(1) << "Couldn't load module \"" << librarypath.string() << "\": " << e.what() << std::endl; 312 312 } 313 313 catch (...) 314 314 { 315 COUT(1) << "Couldn't load plugin\"" << librarypath.string() << "\"" << std::endl;315 COUT(1) << "Couldn't load module \"" << librarypath.string() << "\"" << std::endl; 316 316 } 317 317 } … … 323 323 catch (const std::exception& e) 324 324 { 325 COUT(1) << "An error occurred while loading plugins: " << e.what() << std::endl;325 COUT(1) << "An error occurred while loading modules: " << e.what() << std::endl; 326 326 } 327 327 catch (...) 328 328 { 329 COUT(1) << "An error occurred while loading plugins." << std::endl;330 } 331 332 // Parse command line arguments AFTER the plugins have been loaded (static code!)329 COUT(1) << "An error occurred while loading modules." << std::endl; 330 } 331 332 // Parse command line arguments AFTER the modules have been loaded (static code!) 333 333 CommandLine::parseCommandLine(cmdLine); 334 334 … … 574 574 /** 575 575 @brief 576 Retrievs the executable path and sets all hard coded fixed path (currently only pluginpath)576 Retrievs the executable path and sets all hard coded fixed path (currently only the module path) 577 577 Also checks for "orxonox_dev_build.keep_me" in the executable diretory. 578 578 If found it means that this is not an installed run, hence we … … 631 631 632 632 ///////////////////// 633 // SET PLUGINPATH //633 // SET MODULE PATH // 634 634 ///////////////////// 635 635 … … 638 638 COUT(1) << "Running from the build tree." << std::endl; 639 639 Core::bDevRun_ = true; 640 configuration_-> pluginPath_ = ORXONOX_PLUGIN_DEV_PATH;640 configuration_->modulePath_ = ORXONOX_MODULE_DEV_PATH; 641 641 } 642 642 else … … 654 654 ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?"); 655 655 656 // Pluginpath is fixed as well657 configuration_-> pluginPath_ = configuration_->rootPath_ / ORXONOX_PLUGIN_INSTALL_PATH;656 // Module path is fixed as well 657 configuration_->modulePath_ = configuration_->rootPath_ / ORXONOX_MODULE_INSTALL_PATH; 658 658 659 659 #else 660 660 661 661 // There is no root path, so don't set it at all 662 // Pluginpath is fixed as well663 configuration_-> pluginPath_ = ORXONOX_PLUGIN_INSTALL_PATH;662 // Module path is fixed as well 663 configuration_->modulePath_ = ORXONOX_MODULE_INSTALL_PATH; 664 664 665 665 #endif -
code/branches/libraries/src/core/DynLib.cc
r5631 r5666 64 64 { 65 65 // Log library load 66 COUT(2) << "Loading plugin" << mName << std::endl;66 COUT(2) << "Loading module " << mName << std::endl; 67 67 68 68 std::string name = mName; … … 86 86 { 87 87 // Log library unload 88 COUT(4) << "Unloading plugin" << mName << std::endl;88 COUT(4) << "Unloading module " << mName << std::endl; 89 89 90 90 if( DYNLIB_UNLOAD( m_hInst ) ) -
code/branches/libraries/src/orxonox/gamestates/CMakeLists.txt
r5638 r5666 12 12 13 13 ORXONOX_ADD_LIBRARY(gamestates 14 PLUGIN14 MODULE 15 15 DEFINE_SYMBOL 16 16 "GAMESTATES_SHARED_BUILD" -
code/branches/libraries/src/orxonox/objects/quest/CMakeLists.txt
r5648 r5666 21 21 ADD_SUBDIRECTORY(notifications) 22 22 23 # add the parent directory for tolua (TODO: remove this if the quest pluginis moved somewhere else)23 # add the parent directory for tolua (TODO: remove this if the quest module is moved somewhere else) 24 24 INCLUDE_DIRECTORIES(..) 25 25 26 26 ORXONOX_ADD_LIBRARY(quest 27 PLUGIN27 MODULE 28 28 TOLUA_FILES 29 29 QuestDescription.h -
code/branches/libraries/src/orxonox/overlays/CMakeLists.txt
r5648 r5666 15 15 16 16 ORXONOX_ADD_LIBRARY(overlays 17 PLUGIN17 MODULE 18 18 FIND_HEADER_FILES 19 19 DEFINE_SYMBOL
Note: See TracChangeset
for help on using the changeset viewer.