Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 3, 2018, 1:43:20 AM (7 years ago)
Author:
landauf
Message:

with the latest CMake there are a lot of warnings about the usage of CMP0026. therefore the naming and content of the module/plugin-files had to be changed:
old: <library-filename>.module with content <target-name>
new: <target-name>.module with content <library-filename>
this seems to comply better with cmake and works equally well in c++ (with some small adjustments).
reference: https://cmake.org/cmake/help/v3.0/policy/CMP0026.html

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/module/PluginManager.cc

    r11071 r11692  
    2828
    2929#include "PluginManager.h"
    30 
    31 #include <fstream>
    3230
    3331#include "SpecialConfig.h"
     
    9593    void PluginManager::findPlugins()
    9694    {
    97         const std::vector<std::string>& pluginPaths = ApplicationPaths::getInstance().getPluginPaths();
    98         for (const std::string& libraryName : pluginPaths)
     95        const std::map<std::string, std::string>& pluginPaths = ApplicationPaths::getInstance().getPluginPaths();
     96        for (const std::pair<std::string, std::string>& pluginPath : pluginPaths)
    9997        {
    100             std::string name;
    101             std::string filename = libraryName +  + specialConfig::pluginExtension;
    102             std::ifstream infile(filename.c_str());
    103             if (infile >> name)
    104             {
    105                 orxout(internal_info) << "Found plugin with name '" << name << "' in module " << libraryName << endl;
    106                 this->plugins_[name] = new Plugin(name, libraryName);
    107             }
    108             else
    109             {
    110                 orxout(internal_warning) << "Could not read plugin file " << filename << endl;
    111             }
     98            const std::string& name = pluginPath.first;
     99            const std::string& libraryName = pluginPath.second;
     100
     101            orxout(internal_info) << "Found plugin with name '" << name << "' in module " << libraryName << endl;
     102            this->plugins_[name] = new Plugin(name, libraryName);
    112103        }
    113104    }
Note: See TracChangeset for help on using the changeset viewer.