From babe9f6de0c2ad537ae6570f43b3ab32fcd6ab47 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 11 Aug 2007 17:44:06 +0000 Subject: [PATCH] Added preprending of osgPlugins-version to plugin names --- src/osgDB/FileUtils.cpp | 7 ++----- src/osgDB/Registry.cpp | 11 ++++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index 173ebe273..c949e4098 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -65,7 +65,6 @@ #endif #include -#include #include #include @@ -75,7 +74,6 @@ #include -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) diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index c2078ea80..ee394faec 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -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)