On Mon, Mar 23, 2009 at 5:47 PM, Mark Sciabica <msciab...@itracs.com> wrote:

> Hi Robert,
>
> Sorry, I thought it would have been clear from my first e-mail. I'll try
> again.
>
> FileUtils.cpp in osgDB has this code.
>
> static void appendInstallationLibraryFilePaths(osgDB::FilePathList&
> filepath)
> {
> #ifdef OSG_DEFAULT_LIBRARY_PATH
>
>   // Append the install prefix path to the library search path if
> configured
>   filepath.push_back(ADDQUOTES(OSG_DEFAULT_LIBRARY_PATH));
> #endif
> }
>
> osgDB's CMakeLists.txt has this line:
>
>
> ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS})
>
> This means that the install path configured at build time will be searched
> for plugins. This does not make sense for prebuilt  binaries because the
> install location will likely be different on different machines. I propose
> removing the function appendInstallationLibraryFilePaths, and also the line
> in CMakeLists since it is only this function that makes use of it.


This is kinda dangerous too.  What happens if:

1. User installs OSG 2.6 to /usr/local/OSG
2. User is happy
3. One day user decides to download OSG 2.8
4. User decides to move /usr/local/OSG => /usr/local/OSG-2.6
5. User compiles OSG 2.8 and installs to /usr/local/OSG again
6. User is happy but if they go to run their old OSG 2.6 build what
happens?  My guess is that OSG 2.8 libraries are found.

What is ${LIB_POSTFIX} above.  Is this supposed to be to facilitate debug
builds?

Is it possible to somehow find the location of "osgDB.dll" or "libosgDB.so"
within code as a way to solve the plugin loading problem.  Then you could
simply append "path_to_libosgDB.so + ../lib${LIB_POSTFIX}/${OSG_PLUGINS}" to
the search path.  I know you can do this with the binary that's being run
(if osgviewer is used for example).  This wouldn't work for people running
an OSG app in a different path that uses libosgDB however.

-- 
Philip Lowman
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to