[Orxonox-commit 943] r5666 - in code/branches/libraries: cmake src src/core src/orxonox/gamestates src/orxonox/objects/quest src/orxonox/overlays
landauf at orxonox.net
landauf at orxonox.net
Fri Aug 21 14:17:10 CEST 2009
Author: landauf
Date: 2009-08-21 14:17:09 +0200 (Fri, 21 Aug 2009)
New Revision: 5666
Modified:
code/branches/libraries/cmake/BuildConfig.cmake
code/branches/libraries/cmake/TargetUtilities.cmake
code/branches/libraries/src/SpecialConfig.h.in
code/branches/libraries/src/core/Core.cc
code/branches/libraries/src/core/DynLib.cc
code/branches/libraries/src/orxonox/gamestates/CMakeLists.txt
code/branches/libraries/src/orxonox/objects/quest/CMakeLists.txt
code/branches/libraries/src/orxonox/overlays/CMakeLists.txt
Log:
renamed plugins as modules
Modified: code/branches/libraries/cmake/BuildConfig.cmake
===================================================================
--- code/branches/libraries/cmake/BuildConfig.cmake 2009-08-21 07:32:44 UTC (rev 5665)
+++ code/branches/libraries/cmake/BuildConfig.cmake 2009-08-21 12:17:09 UTC (rev 5666)
@@ -30,7 +30,7 @@
SET(DEFAULT_RUNTIME_PATH bin)
SET(DEFAULT_LIBRARY_PATH lib)
SET(DEFAULT_ARCHIVE_PATH lib/static)
-SET(DEFAULT_PLUGIN_PATH lib/plugins)
+SET(DEFAULT_MODULE_PATH lib/modules)
SET(DEFAULT_DOC_PATH doc)
SET(DEFAULT_MEDIA_PATH media)
SET(DEFAULT_CONFIG_PATH config)
@@ -40,7 +40,7 @@
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_RUNTIME_PATH})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH})
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH})
-SET(CMAKE_PLUGIN_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_PLUGIN_PATH})
+SET(CMAKE_MODULE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_MODULE_PATH})
# Do not set doc and media, rather check in the two subdirectories
# whether they concur with the DEFAULT_..._PATH
SET(CMAKE_CONFIG_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_CONFIG_PATH})
@@ -71,6 +71,8 @@
MARK_AS_ADVANCED(CMAKE_BUILD_TYPE)
ENDIF()
+# Set the extension of the dynamic modules
+SET(ORXONOX_MODULE_EXTENSION ".module")
################# OGRE Plugins ##################
@@ -133,7 +135,7 @@
SET(ORXONOX_RUNTIME_INSTALL_PATH ${DEFAULT_RUNTIME_PATH})
SET(ORXONOX_LIBRARY_INSTALL_PATH ${DEFAULT_LIBRARY_PATH})
SET(ORXONOX_ARCHIVE_INSTALL_PATH ${DEFAULT_ARCHIVE_PATH})
- SET(ORXONOX_PLUGIN_INSTALL_PATH ${DEFAULT_PLUGIN_PATH})
+ SET(ORXONOX_MODULE_INSTALL_PATH ${DEFAULT_MODULE_PATH})
SET(ORXONOX_DOC_INSTALL_PATH ${DEFAULT_DOC_PATH})
SET(ORXONOX_MEDIA_INSTALL_PATH ${DEFAULT_MEDIA_PATH})
SET(ORXONOX_CONFIG_INSTALL_PATH ${DEFAULT_CONFIG_PATH})
@@ -144,7 +146,7 @@
SET(ORXONOX_RUNTIME_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/bin)
SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox)
SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static)
- SET(ORXONOX_PLUGIN_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox/plugins)
+ SET(ORXONOX_MODULE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox/modules)
SET(ORXONOX_DOC_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
SET(ORXONOX_MEDIA_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/orxonox)
# These two paths are user and therefore runtime dependent --> only set relatively
@@ -155,7 +157,7 @@
SET(ORXONOX_RUNTIME_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH})
SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
- SET(ORXONOX_PLUGIN_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_PLUGIN_PATH})
+ SET(ORXONOX_MODULE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MODULE_PATH})
SET(ORXONOX_DOC_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
SET(ORXONOX_MEDIA_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MEDIA_PATH})
# Leave empty because it is user and therefore runtime dependent
Modified: code/branches/libraries/cmake/TargetUtilities.cmake
===================================================================
--- code/branches/libraries/cmake/TargetUtilities.cmake 2009-08-21 07:32:44 UTC (rev 5665)
+++ code/branches/libraries/cmake/TargetUtilities.cmake 2009-08-21 12:17:09 UTC (rev 5666)
@@ -34,7 +34,7 @@
# NO_DLL_INTERFACE: Link statically with MSVC
# NO_SOURCE_GROUPS: Don't create msvc source groups
# STATIC/SHARED: Inherited from ADD_LIBRARY
- # PLUGIN: For dynamic plugin libraries
+ # MODULE: For dynamic module libraries
# WIN32: Inherited from ADD_EXECUTABLE
# PCH_NO_DEFAULT: Do not make precompiled header files default if
# specified with PCH_FILE
@@ -80,7 +80,7 @@
# Specify all possible options (either switch or with add. arguments)
SET(_switches FIND_HEADER_FILES EXCLUDE_FROM_ALL ORXONOX_EXTERNAL
NO_DLL_INTERFACE NO_SOURCE_GROUPS ${_additional_switches}
- PCH_NO_DEFAULT NO_INSTALL PLUGIN)
+ PCH_NO_DEFAULT NO_INSTALL MODULE)
SET(_list_names LINK_LIBRARIES VERSION SOURCE_FILES DEFINE_SYMBOL
TOLUA_FILES PCH_FILE PCH_EXCLUDE OUTPUT_NAME)
PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN})
@@ -147,8 +147,9 @@
ENDIF()
ENDIF()
- # PLUGIN A, always create shared libraries
- IF(_arg_PLUGIN)
+ # MODULE A
+ # Always create shared libraries
+ IF(_arg_MODULE)
SET(_arg_SHARED SHARED)
SET(_arg_STATIC)
ENDIF()
@@ -162,13 +163,13 @@
${_${_target_name}_files})
ENDIF()
- # PLUGIN B
- IF (_arg_PLUGIN)
+ # MODULE B
+ IF (_arg_MODULE)
SET_TARGET_PROPERTIES(${_target_name} PROPERTIES
- RUNTIME_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY} # Windows
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY} # Unix
+ RUNTIME_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Windows
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Unix
)
- ADD_PLUGIN(${_target_name})
+ ADD_MODULE(${_target_name})
ENDIF()
# LINK_LIBRARIES
@@ -199,10 +200,10 @@
ENDIF()
IF(NOT _arg_STATIC AND NOT _arg_NO_INSTALL)
- IF(_arg_PLUGIN)
+ IF(_arg_MODULE)
INSTALL(TARGETS ${_target_name}
- RUNTIME DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
- LIBRARY DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
+ RUNTIME DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
+ LIBRARY DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
)
ELSE()
INSTALL(TARGETS ${_target_name}
@@ -215,10 +216,10 @@
ENDFUNCTION(TU_ADD_TARGET)
-# Creates a helper file with name <name_of_the_library>.plugin
-# This helps finding dynamically loadable plugins at runtime
+# Creates a helper file with name <name_of_the_library>.module
+# This helps finding dynamically loadable modules at runtime
-FUNCTION(ADD_PLUGIN _target)
+FUNCTION(ADD_MODULE _target)
# We use the properties to get the name because the librarys name may differ from
# the target name (for example orxonox <-> liborxonox)
@@ -227,24 +228,24 @@
IF(CMAKE_CONFIGURATION_TYPES)
FOREACH(_config ${CMAKE_CONFIGURATION_TYPES})
- SET(_plugin_filename ${CMAKE_PLUGIN_OUTPUT_DIRECTORY}/${_config}/${_target_name}.plugin)
+ SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_config}/${_target_name}${ORXONOX_MODULE_EXTENSION})
- FILE(WRITE ${_plugin_filename})
+ FILE(WRITE ${_module_filename})
INSTALL(
- FILES ${_plugin_filename}
- DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
+ FILES ${_module_filename}
+ DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
CONFIGURATIONS ${_config}
)
ENDFOREACH()
ELSE()
- SET(_plugin_filename ${CMAKE_PLUGIN_OUTPUT_DIRECTORY}/${_target_name}.plugin)
+ SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_target_name}${ORXONOX_MODULE_EXTENSION})
- FILE(WRITE ${_plugin_filename})
+ FILE(WRITE ${_module_filename})
INSTALL(
- FILES ${_plugin_filename}
- DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
+ FILES ${_module_filename}
+ DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
)
ENDIF()
-ENDFUNCTION(ADD_PLUGIN)
+ENDFUNCTION(ADD_MODULE)
Modified: code/branches/libraries/src/SpecialConfig.h.in
===================================================================
--- code/branches/libraries/src/SpecialConfig.h.in 2009-08-21 07:32:44 UTC (rev 5665)
+++ code/branches/libraries/src/SpecialConfig.h.in 2009-08-21 12:17:09 UTC (rev 5666)
@@ -73,7 +73,7 @@
{
// INSTALLATION PATHS
const char ORXONOX_RUNTIME_INSTALL_PATH[] = "@ORXONOX_RUNTIME_INSTALL_PATH@";
- const char ORXONOX_PLUGIN_INSTALL_PATH[] = "@ORXONOX_PLUGIN_INSTALL_PATH@";
+ const char ORXONOX_MODULE_INSTALL_PATH[] = "@ORXONOX_MODULE_INSTALL_PATH@";
const char ORXONOX_MEDIA_INSTALL_PATH[] = "@ORXONOX_MEDIA_INSTALL_PATH@";
/* Config and Log path might be relative because they could be user and therefore runtime dependent */
const char ORXONOX_CONFIG_INSTALL_PATH[] = "@ORXONOX_CONFIG_INSTALL_PATH@";
@@ -82,11 +82,11 @@
// DEVELOPMENT RUN PATHS
const char ORXONOX_MEDIA_DEV_PATH[] = "@CMAKE_MEDIA_OUTPUT_DIRECTORY@";
#ifdef CMAKE_CONFIGURATION_TYPES
- const char ORXONOX_PLUGIN_DEV_PATH[] = "@CMAKE_PLUGIN_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
+ const char ORXONOX_MODULE_DEV_PATH[] = "@CMAKE_MODULE_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
const char ORXONOX_CONFIG_DEV_PATH[] = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
const char ORXONOX_LOG_DEV_PATH[] = "@CMAKE_LOG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
#else
- const char ORXONOX_PLUGIN_DEV_PATH[] = "@CMAKE_PLUGIN_OUTPUT_DIRECTORY@";
+ const char ORXONOX_MODULE_DEV_PATH[] = "@CMAKE_MODULE_OUTPUT_DIRECTORY@";
const char ORXONOX_CONFIG_DEV_PATH[] = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@";
const char ORXONOX_LOG_DEV_PATH[] = "@CMAKE_LOG_OUTPUT_DIRECTORY@";
#endif
@@ -94,6 +94,9 @@
const char ORXONOX_DEP_LIB_PATH[] = "@DEP_LIBRARY_DIR@";
#endif
+ // Module extension
+ const char ORXONOX_MODULE_EXTENSION[] = "@ORXONOX_MODULE_EXTENSION@";
+
// OGRE PLUGINS
#ifdef NDEBUG
const char ORXONOX_OGRE_PLUGINS[] = "@OGRE_PLUGINS_RELEASE@";
Modified: code/branches/libraries/src/core/Core.cc
===================================================================
--- code/branches/libraries/src/core/Core.cc 2009-08-21 07:32:44 UTC (rev 5665)
+++ code/branches/libraries/src/core/Core.cc 2009-08-21 12:17:09 UTC (rev 5666)
@@ -249,7 +249,7 @@
//! Path to the parent directory of the ones above if program was installed with relativ pahts
boost::filesystem::path rootPath_;
boost::filesystem::path executablePath_; //!< Path to the executable
- boost::filesystem::path pluginPath_; //!< Path to the plugins
+ boost::filesystem::path modulePath_; //!< Path to the modules
boost::filesystem::path mediaPath_; //!< Path to the media file folder
boost::filesystem::path configPath_; //!< Path to the config file folder
boost::filesystem::path logPath_; //!< Path to the log file folder
@@ -271,19 +271,19 @@
// Create a new dynamic library manager
this->dynLibManager_.reset(new DynLibManager());
- // Load plugins
+ // Load modules
try
{
// We search for helper files with the following extension
- std::string pluginextension = ".plugin";
- size_t pluginextensionlength = pluginextension.size();
+ std::string moduleextension = ORXONOX_MODULE_EXTENSION;
+ size_t moduleextensionlength = moduleextension.size();
// Search in the directory of our executable
- boost::filesystem::path searchpath = this->configuration_->pluginPath_;
+ boost::filesystem::path searchpath = this->configuration_->modulePath_;
- // Add that path to the PATH variable in case a plugin depends on another one
+ // Add that path to the PATH variable in case a module depends on another one
std::string pathVariable = getenv("PATH");
- putenv(const_cast<char*>(("PATH=" + pathVariable + ";" + configuration_->pluginPath_.string()).c_str()));
+ putenv(const_cast<char*>(("PATH=" + pathVariable + ";" + configuration_->modulePath_.string()).c_str()));
boost::filesystem::directory_iterator file(searchpath);
boost::filesystem::directory_iterator end;
@@ -294,12 +294,12 @@
std::string filename = file->BOOST_LEAF_FUNCTION();
// Check if the file ends with the exension in question
- if (filename.size() > pluginextensionlength)
+ if (filename.size() > moduleextensionlength)
{
- if (filename.substr(filename.size() - pluginextensionlength) == pluginextension)
+ if (filename.substr(filename.size() - moduleextensionlength) == moduleextension)
{
// We've found a helper file - now load the library with the same name
- std::string library = filename.substr(0, filename.size() - pluginextensionlength);
+ std::string library = filename.substr(0, filename.size() - moduleextensionlength);
boost::filesystem::path librarypath = searchpath / library;
try
@@ -308,11 +308,11 @@
}
catch (const std::exception& e)
{
- COUT(1) << "Couldn't load plugin \"" << librarypath.string() << "\": " << e.what() << std::endl;
+ COUT(1) << "Couldn't load module \"" << librarypath.string() << "\": " << e.what() << std::endl;
}
catch (...)
{
- COUT(1) << "Couldn't load plugin \"" << librarypath.string() << "\"" << std::endl;
+ COUT(1) << "Couldn't load module \"" << librarypath.string() << "\"" << std::endl;
}
}
}
@@ -322,14 +322,14 @@
}
catch (const std::exception& e)
{
- COUT(1) << "An error occurred while loading plugins: " << e.what() << std::endl;
+ COUT(1) << "An error occurred while loading modules: " << e.what() << std::endl;
}
catch (...)
{
- COUT(1) << "An error occurred while loading plugins." << std::endl;
+ COUT(1) << "An error occurred while loading modules." << std::endl;
}
- // Parse command line arguments AFTER the plugins have been loaded (static code!)
+ // Parse command line arguments AFTER the modules have been loaded (static code!)
CommandLine::parseCommandLine(cmdLine);
// Set configurable paths like log, config and media
@@ -573,7 +573,7 @@
/**
@brief
- Retrievs the executable path and sets all hard coded fixed path (currently only plugin path)
+ Retrievs the executable path and sets all hard coded fixed path (currently only the module path)
Also checks for "orxonox_dev_build.keep_me" in the executable diretory.
If found it means that this is not an installed run, hence we
don't write the logs and config files to ~/.orxonox
@@ -630,14 +630,14 @@
#endif
/////////////////////
- // SET PLUGIN PATH //
+ // SET MODULE PATH //
/////////////////////
if (boost::filesystem::exists(configuration_->executablePath_ / "orxonox_dev_build.keep_me"))
{
COUT(1) << "Running from the build tree." << std::endl;
Core::bDevRun_ = true;
- configuration_->pluginPath_ = ORXONOX_PLUGIN_DEV_PATH;
+ configuration_->modulePath_ = ORXONOX_MODULE_DEV_PATH;
}
else
{
@@ -653,14 +653,14 @@
if (configuration_->rootPath_.empty())
ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?");
- // Plugin path is fixed as well
- configuration_->pluginPath_ = configuration_->rootPath_ / ORXONOX_PLUGIN_INSTALL_PATH;
+ // Module path is fixed as well
+ configuration_->modulePath_ = configuration_->rootPath_ / ORXONOX_MODULE_INSTALL_PATH;
#else
// There is no root path, so don't set it at all
- // Plugin path is fixed as well
- configuration_->pluginPath_ = ORXONOX_PLUGIN_INSTALL_PATH;
+ // Module path is fixed as well
+ configuration_->modulePath_ = ORXONOX_MODULE_INSTALL_PATH;
#endif
}
Modified: code/branches/libraries/src/core/DynLib.cc
===================================================================
--- code/branches/libraries/src/core/DynLib.cc 2009-08-21 07:32:44 UTC (rev 5665)
+++ code/branches/libraries/src/core/DynLib.cc 2009-08-21 12:17:09 UTC (rev 5666)
@@ -63,7 +63,7 @@
void DynLib::load()
{
// Log library load
- COUT(2) << "Loading plugin " << mName << std::endl;
+ COUT(2) << "Loading module " << mName << std::endl;
std::string name = mName;
#ifdef ORXONOX_PLATFORM_LINUX
@@ -85,7 +85,7 @@
void DynLib::unload()
{
// Log library unload
- COUT(4) << "Unloading plugin " << mName << std::endl;
+ COUT(4) << "Unloading module " << mName << std::endl;
if( DYNLIB_UNLOAD( m_hInst ) )
{
Modified: code/branches/libraries/src/orxonox/gamestates/CMakeLists.txt
===================================================================
--- code/branches/libraries/src/orxonox/gamestates/CMakeLists.txt 2009-08-21 07:32:44 UTC (rev 5665)
+++ code/branches/libraries/src/orxonox/gamestates/CMakeLists.txt 2009-08-21 12:17:09 UTC (rev 5666)
@@ -11,7 +11,7 @@
)
ORXONOX_ADD_LIBRARY(gamestates
- PLUGIN
+ MODULE
DEFINE_SYMBOL
"GAMESTATES_SHARED_BUILD"
LINK_LIBRARIES
Modified: code/branches/libraries/src/orxonox/objects/quest/CMakeLists.txt
===================================================================
--- code/branches/libraries/src/orxonox/objects/quest/CMakeLists.txt 2009-08-21 07:32:44 UTC (rev 5665)
+++ code/branches/libraries/src/orxonox/objects/quest/CMakeLists.txt 2009-08-21 12:17:09 UTC (rev 5666)
@@ -20,11 +20,11 @@
ADD_SUBDIRECTORY(notifications)
-# add the parent directory for tolua (TODO: remove this if the quest plugin is moved somewhere else)
+# add the parent directory for tolua (TODO: remove this if the quest module is moved somewhere else)
INCLUDE_DIRECTORIES(..)
ORXONOX_ADD_LIBRARY(quest
- PLUGIN
+ MODULE
TOLUA_FILES
QuestDescription.h
QuestManager.h
Modified: code/branches/libraries/src/orxonox/overlays/CMakeLists.txt
===================================================================
--- code/branches/libraries/src/orxonox/overlays/CMakeLists.txt 2009-08-21 07:32:44 UTC (rev 5665)
+++ code/branches/libraries/src/orxonox/overlays/CMakeLists.txt 2009-08-21 12:17:09 UTC (rev 5666)
@@ -14,7 +14,7 @@
ADD_SUBDIRECTORY(stats)
ORXONOX_ADD_LIBRARY(overlays
- PLUGIN
+ MODULE
FIND_HEADER_FILES
DEFINE_SYMBOL
"OVERLAYS_SHARED_BUILD"
More information about the Orxonox-commit
mailing list