Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 21, 2009, 2:17:09 PM (15 years ago)
Author:
landauf
Message:

renamed plugins as modules

Location:
code/branches/libraries
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/libraries/cmake/BuildConfig.cmake

    r5626 r5666  
    3131SET(DEFAULT_LIBRARY_PATH lib)
    3232SET(DEFAULT_ARCHIVE_PATH lib/static)
    33 SET(DEFAULT_PLUGIN_PATH  lib/plugins)
     33SET(DEFAULT_MODULE_PATH  lib/modules)
    3434SET(DEFAULT_DOC_PATH     doc)
    3535SET(DEFAULT_MEDIA_PATH   media)
     
    4141SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH})
    4242SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH})
    43 SET(CMAKE_PLUGIN_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_PLUGIN_PATH})
     43SET(CMAKE_MODULE_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_MODULE_PATH})
    4444# Do not set doc and media, rather check in the two subdirectories
    4545# whether they concur with the DEFAULT_..._PATH
     
    7272ENDIF()
    7373
     74# Set the extension of the dynamic modules
     75SET(ORXONOX_MODULE_EXTENSION ".module")
    7476
    7577################# OGRE Plugins ##################
     
    134136  SET(ORXONOX_LIBRARY_INSTALL_PATH ${DEFAULT_LIBRARY_PATH})
    135137  SET(ORXONOX_ARCHIVE_INSTALL_PATH ${DEFAULT_ARCHIVE_PATH})
    136   SET(ORXONOX_PLUGIN_INSTALL_PATH  ${DEFAULT_PLUGIN_PATH})
     138  SET(ORXONOX_MODULE_INSTALL_PATH  ${DEFAULT_MODULE_PATH})
    137139  SET(ORXONOX_DOC_INSTALL_PATH     ${DEFAULT_DOC_PATH})
    138140  SET(ORXONOX_MEDIA_INSTALL_PATH   ${DEFAULT_MEDIA_PATH})
     
    145147  SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox)
    146148  SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static)
    147   SET(ORXONOX_PLUGIN_INSTALL_PATH  ${CMAKE_INSTALL_PREFIX}/lib/orxonox/plugins)
     149  SET(ORXONOX_MODULE_INSTALL_PATH  ${CMAKE_INSTALL_PREFIX}/lib/orxonox/modules)
    148150  SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
    149151  SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/share/orxonox)
     
    156158  SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
    157159  SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
    158   SET(ORXONOX_PLUGIN_INSTALL_PATH  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_PLUGIN_PATH})
     160  SET(ORXONOX_MODULE_INSTALL_PATH  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MODULE_PATH})
    159161  SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
    160162  SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MEDIA_PATH})
  • code/branches/libraries/cmake/TargetUtilities.cmake

    r5649 r5666  
    3535 #      NO_SOURCE_GROUPS:  Don't create msvc source groups
    3636 #      STATIC/SHARED:     Inherited from ADD_LIBRARY
    37  #      PLUGIN:            For dynamic plugin libraries
     37 #      MODULE:            For dynamic module libraries
    3838 #      WIN32:             Inherited from ADD_EXECUTABLE
    3939 #      PCH_NO_DEFAULT:    Do not make precompiled header files default if
     
    8181  SET(_switches   FIND_HEADER_FILES  EXCLUDE_FROM_ALL  ORXONOX_EXTERNAL
    8282                  NO_DLL_INTERFACE   NO_SOURCE_GROUPS  ${_additional_switches}
    83                   PCH_NO_DEFAULT     NO_INSTALL        PLUGIN)
     83                  PCH_NO_DEFAULT     NO_INSTALL        MODULE)
    8484  SET(_list_names LINK_LIBRARIES  VERSION   SOURCE_FILES  DEFINE_SYMBOL
    8585                  TOLUA_FILES     PCH_FILE  PCH_EXCLUDE OUTPUT_NAME)
     
    148148  ENDIF()
    149149
    150   # PLUGIN A, always create shared libraries
    151   IF(_arg_PLUGIN)
     150  # MODULE A
     151  # Always create shared libraries
     152  IF(_arg_MODULE)
    152153    SET(_arg_SHARED SHARED)
    153154    SET(_arg_STATIC)
     
    163164  ENDIF()
    164165
    165   # PLUGIN B
    166   IF (_arg_PLUGIN)
     166  # MODULE B
     167  IF (_arg_MODULE)
    167168    SET_TARGET_PROPERTIES(${_target_name} PROPERTIES
    168       RUNTIME_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY} # Windows
    169       LIBRARY_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY} # Unix
     169      RUNTIME_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Windows
     170      LIBRARY_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Unix
    170171    )
    171     ADD_PLUGIN(${_target_name})
     172    ADD_MODULE(${_target_name})
    172173  ENDIF()
    173174
     
    200201
    201202  IF(NOT _arg_STATIC AND NOT _arg_NO_INSTALL)
    202     IF(_arg_PLUGIN)
     203    IF(_arg_MODULE)
    203204      INSTALL(TARGETS ${_target_name}
    204         RUNTIME DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
    205         LIBRARY DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
     205        RUNTIME DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
     206        LIBRARY DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
    206207      )
    207208    ELSE()
     
    216217
    217218
    218 # Creates a helper file with name <name_of_the_library>.plugin
    219 # This helps finding dynamically loadable plugins at runtime
    220 
    221 FUNCTION(ADD_PLUGIN _target)
     219# Creates a helper file with name <name_of_the_library>.module
     220# This helps finding dynamically loadable modules at runtime
     221
     222FUNCTION(ADD_MODULE _target)
    222223  # We use the properties to get the name because the librarys name may differ from
    223224  # the target name (for example orxonox <-> liborxonox)
     
    228229  IF(CMAKE_CONFIGURATION_TYPES)
    229230    FOREACH(_config ${CMAKE_CONFIGURATION_TYPES})
    230       SET(_plugin_filename ${CMAKE_PLUGIN_OUTPUT_DIRECTORY}/${_config}/${_target_name}.plugin)
    231 
    232       FILE(WRITE ${_plugin_filename})
     231      SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_config}/${_target_name}${ORXONOX_MODULE_EXTENSION})
     232
     233      FILE(WRITE ${_module_filename})
    233234
    234235      INSTALL(
    235         FILES ${_plugin_filename}
    236         DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
     236        FILES ${_module_filename}
     237        DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
    237238        CONFIGURATIONS ${_config}
    238239      )
    239240    ENDFOREACH()
    240241  ELSE()
    241     SET(_plugin_filename ${CMAKE_PLUGIN_OUTPUT_DIRECTORY}/${_target_name}.plugin)
    242 
    243     FILE(WRITE ${_plugin_filename})
     242    SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_target_name}${ORXONOX_MODULE_EXTENSION})
     243
     244    FILE(WRITE ${_module_filename})
    244245
    245246    INSTALL(
    246       FILES ${_plugin_filename}
    247       DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
     247      FILES ${_module_filename}
     248      DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
    248249    )
    249250  ENDIF()
    250 ENDFUNCTION(ADD_PLUGIN)
     251ENDFUNCTION(ADD_MODULE)
  • code/branches/libraries/src/SpecialConfig.h.in

    r5626 r5666  
    7474    // INSTALLATION PATHS
    7575    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@";
    7777    const char ORXONOX_MEDIA_INSTALL_PATH[]   = "@ORXONOX_MEDIA_INSTALL_PATH@";
    7878    /* Config and Log path might be relative because they could be user and therefore runtime dependent */
     
    8383    const char ORXONOX_MEDIA_DEV_PATH[]       = "@CMAKE_MEDIA_OUTPUT_DIRECTORY@";
    8484#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);
    8686    const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
    8787    const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@/"    BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
    8888#else
    89     const char ORXONOX_PLUGIN_DEV_PATH[]      = "@CMAKE_PLUGIN_OUTPUT_DIRECTORY@";
     89    const char ORXONOX_MODULE_DEV_PATH[]      = "@CMAKE_MODULE_OUTPUT_DIRECTORY@";
    9090    const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@";
    9191    const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@";
     
    9494    const char ORXONOX_DEP_LIB_PATH[]         = "@DEP_LIBRARY_DIR@";
    9595#endif
     96
     97    // Module extension
     98    const char ORXONOX_MODULE_EXTENSION[]     = "@ORXONOX_MODULE_EXTENSION@";
    9699
    97100    // OGRE PLUGINS
  • code/branches/libraries/src/core/Core.cc

    r5665 r5666  
    250250        boost::filesystem::path rootPath_;
    251251        boost::filesystem::path executablePath_;        //!< Path to the executable
    252         boost::filesystem::path pluginPath_;            //!< Path to the plugins
     252        boost::filesystem::path modulePath_;            //!< Path to the modules
    253253        boost::filesystem::path mediaPath_;             //!< Path to the media file folder
    254254        boost::filesystem::path configPath_;            //!< Path to the config file folder
     
    272272        this->dynLibManager_.reset(new DynLibManager());
    273273
    274         // Load plugins
     274        // Load modules
    275275        try
    276276        {
    277277            // 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();
    280280
    281281            // 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 plugin depends on another one
     282            boost::filesystem::path searchpath = this->configuration_->modulePath_;
     283
     284            // Add that path to the PATH variable in case a module depends on another one
    285285            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()));
    287287
    288288            boost::filesystem::directory_iterator file(searchpath);
     
    295295
    296296                // Check if the file ends with the exension in question
    297                 if (filename.size() > pluginextensionlength)
     297                if (filename.size() > moduleextensionlength)
    298298                {
    299                     if (filename.substr(filename.size() - pluginextensionlength) == pluginextension)
     299                    if (filename.substr(filename.size() - moduleextensionlength) == moduleextension)
    300300                    {
    301301                        // 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);
    303303                        boost::filesystem::path librarypath = searchpath / library;
    304304
     
    309309                        catch (const std::exception& e)
    310310                        {
    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;
    312312                        }
    313313                        catch (...)
    314314                        {
    315                             COUT(1) << "Couldn't load plugin \"" << librarypath.string() << "\"" << std::endl;
     315                            COUT(1) << "Couldn't load module \"" << librarypath.string() << "\"" << std::endl;
    316316                        }
    317317                    }
     
    323323        catch (const std::exception& e)
    324324        {
    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;
    326326        }
    327327        catch (...)
    328328        {
    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!)
    333333        CommandLine::parseCommandLine(cmdLine);
    334334
     
    574574    /**
    575575    @brief
    576         Retrievs the executable path and sets all hard coded fixed path (currently only plugin path)
     576        Retrievs the executable path and sets all hard coded fixed path (currently only the module path)
    577577        Also checks for "orxonox_dev_build.keep_me" in the executable diretory.
    578578        If found it means that this is not an installed run, hence we
     
    631631
    632632        /////////////////////
    633         // SET PLUGIN PATH //
     633        // SET MODULE PATH //
    634634        /////////////////////
    635635
     
    638638            COUT(1) << "Running from the build tree." << std::endl;
    639639            Core::bDevRun_ = true;
    640             configuration_->pluginPath_ = ORXONOX_PLUGIN_DEV_PATH;
     640            configuration_->modulePath_ = ORXONOX_MODULE_DEV_PATH;
    641641        }
    642642        else
     
    654654                ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?");
    655655
    656             // Plugin path is fixed as well
    657             configuration_->pluginPath_ = configuration_->rootPath_ / ORXONOX_PLUGIN_INSTALL_PATH;
     656            // Module path is fixed as well
     657            configuration_->modulePath_ = configuration_->rootPath_ / ORXONOX_MODULE_INSTALL_PATH;
    658658
    659659#else
    660660
    661661            // There is no root path, so don't set it at all
    662             // Plugin path is fixed as well
    663             configuration_->pluginPath_ = ORXONOX_PLUGIN_INSTALL_PATH;
     662            // Module path is fixed as well
     663            configuration_->modulePath_ = ORXONOX_MODULE_INSTALL_PATH;
    664664
    665665#endif
  • code/branches/libraries/src/core/DynLib.cc

    r5631 r5666  
    6464    {
    6565        // Log library load
    66         COUT(2) << "Loading plugin " << mName << std::endl;
     66        COUT(2) << "Loading module " << mName << std::endl;
    6767
    6868                std::string name = mName;
     
    8686    {
    8787        // Log library unload
    88         COUT(4) << "Unloading plugin " << mName << std::endl;
     88        COUT(4) << "Unloading module " << mName << std::endl;
    8989
    9090        if( DYNLIB_UNLOAD( m_hInst ) )
  • code/branches/libraries/src/orxonox/gamestates/CMakeLists.txt

    r5638 r5666  
    1212
    1313ORXONOX_ADD_LIBRARY(gamestates
    14   PLUGIN
     14  MODULE
    1515  DEFINE_SYMBOL
    1616    "GAMESTATES_SHARED_BUILD"
  • code/branches/libraries/src/orxonox/objects/quest/CMakeLists.txt

    r5648 r5666  
    2121ADD_SUBDIRECTORY(notifications)
    2222
    23 # add the parent directory for tolua (TODO: remove this if the quest plugin is moved somewhere else)
     23# add the parent directory for tolua (TODO: remove this if the quest module is moved somewhere else)
    2424INCLUDE_DIRECTORIES(..)
    2525
    2626ORXONOX_ADD_LIBRARY(quest
    27   PLUGIN
     27  MODULE
    2828  TOLUA_FILES
    2929    QuestDescription.h
  • code/branches/libraries/src/orxonox/overlays/CMakeLists.txt

    r5648 r5666  
    1515
    1616ORXONOX_ADD_LIBRARY(overlays
    17   PLUGIN
     17  MODULE
    1818  FIND_HEADER_FILES
    1919  DEFINE_SYMBOL
Note: See TracChangeset for help on using the changeset viewer.