Added preprending of osgPlugins-version to plugin names

This commit is contained in:
Robert Osfield 2007-08-11 17:44:06 +00:00
parent d57a16e023
commit babe9f6de0
2 changed files with 10 additions and 8 deletions

View File

@ -65,7 +65,6 @@
#endif
#include <osg/Notify>
#include <osg/Version>
#include <osgDB/FileUtils>
#include <osgDB/FileNameUtils>
@ -75,7 +74,6 @@
#include <stack>
const std::string OSG_PLUGINS(std::string("osgPlugins-")+std::string(osgGetVersion())+std::string("/"));
bool osgDB::makeDirectory( const std::string &path )
{
@ -317,9 +315,8 @@ std::string osgDB::findLibraryFile(const std::string& filename,CaseSensitivity c
if (!fileFound.empty()) return fileFound;
}
// failed with direct paths,
// now try prepending the filename with "osgPlugins/"
return findFileInPath(OSG_PLUGINS+simpleFileName,filepath,caseSensitivity);
// failed return empty string.
return std::string();
}
std::string osgDB::findFileInDirectory(const std::string& fileName,const std::string& dirName,CaseSensitivity caseSensitivity)

View File

@ -18,6 +18,7 @@
#include <osg/Group>
#include <osg/Geode>
#include <osg/ApplicationUsage>
#include <osg/Version>
#include <osgDB/Registry>
#include <osgDB/FileUtils>
@ -548,7 +549,6 @@ std::string Registry::createLibraryNameForFile(const std::string& fileName)
return createLibraryNameForExtension(ext);
}
std::string Registry::createLibraryNameForExtension(const std::string& ext)
{
@ -556,9 +556,14 @@ std::string Registry::createLibraryNameForExtension(const std::string& ext)
if (itr!=_extAliasMap.end() && ext != itr->second) return createLibraryNameForExtension(itr->second);
#ifdef OSG_JAVA_BUILD
static std::string prepend = "java";
#else
static std::string prepend = std::string("osgPlugins-")+std::string(osgGetVersion())+std::string("/java");
#elseif defined(__APPLE__)
// OSX is rather a mess in FileUtils.cpp w.r.t its appendPlatformSpecificLibraryFilePaths implementation
// as it hardwires the plugin name to PlugIns. This *needs* fixing to use the naming convention as all
// other platforms.
static std::string prepend = "";
#else
static std::string prepend = std::string("osgPlugins-")+std::string(osgGetVersion())+std::string("/");
#endif
#if defined(WIN32)