[osg-submissions] Plugin DLL search order fix for Win32

Luigi Calori l.calori at cineca.it
Sun Aug 26 03:45:39 PDT 2007


Hi Robert, I' m still searching a way to set up proper build time layout 
that allow testing out of the box and does not require  too much copying.
One of the worst things is name clashing betwen apps/examples and 
libraries. and the need to have .lib in lib and .dll in bin
This two points prevent the simplest solution to build everything in bin 
to work properly in debug mode.

I' m currently trying to build everything apart core libs in bin and 
then add a post build copy command for all the core dll from lib to bin
This is necessary for allowing to run examples and applications without 
adding lib to PATH, anyway, even with current install, one is required 
do add <INSTALL_PREFIX>/lib to PATH to
be able to run anything.

This copying step is not straightforward for debug libraries due to the 
d appended....
It could be made optional by an advanced option so one could decide 
weather to copy core .dll on bin or add lib to PATH

I' ll try to come up with the no-copy patch quite soon and then add the 
copy option later, as a separate patch.

Does this sound ok?

It is strange it reject the patch, the patch involve  different files, 
so sending all the files is not so handy,
 I' ll try to use another program to make the patch and zip it, if it 
does not work, I' ll add full files.

Thanks
                 Luigi

Robert Osfield wrote:

>Hi Luigi,
>
>I tried to apply your patch but got:
>
>Chunk #1 FAILED at 124.
>1 out of 1 hunk FAILED -- saving rejects to file
>CMakeModules/OsgMacroUtils.cmake.rej
>
>Could you send the whole modified file.
>
>Robert.
>
>
>On 8/24/07, Luigi Calori <l.calori at cineca.it> wrote:
>  
>
>>Tsted under winxp:
>>it works ok, just two notes:
>>
>>1)
>> it is designed to search anyway for system and current directory before
>>PATH defined folders: this prevet an application writer to
>>set PATH env var to override presence of system installed  plugins.
>>Would not be better to reverse the order?
>>like
>><application_folder>/osgPlugins<osgversion> ;
>><PATH_folder>/osgPlugins<osgversion>; .....
>><PATH_folder>/osgPlugins<osgversion>;<SYSTEM_folder>/osgPlugins<osgversion>;<CurrDir_folder>/osgPlugins<osgversion>;
>>
>>2)
>>in VisualStudio builds, the projects appends /Debug or /Release to the
>>folders where dll are created at build time,
>> I was used to test osg build BEFORE installing by setting up PATH
>>environment to build folders.
>>With current enforced versioned plugin this is impossible as projects
>>place plugin dll in lib/osgPlugins<osgversion>/<Debug or Release>
>> I attach a patch that change the build folder placement to lib/<Debug
>>or Release>/osgPlugins<osgversion>
>>that seems also more consistent.
>>The patch should not affect other platform builds
>>
>>
>>
>>Index: CMakeModules/OsgMacroUtils.cmake
>>===================================================================
>>--- CMakeModules/OsgMacroUtils.cmake    (revision 7282)
>>+++ CMakeModules/OsgMacroUtils.cmake    (working copy)
>>@@ -124,6 +124,9 @@
>>     #not sure if needed, but for plugins only msvc need the d suffix
>>     IF(NOT MSVC)
>>         SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
>>+    ELSE(NOT MSVC)
>>+               SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
>>+               SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES OUTPUT_NAME "${OSG_PLUGINS}/${TARGET_TARGETNAME}")
>>     ENDIF(NOT MSVC)
>>     SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
>>
>>
>>_______________________________________________
>>osg-submissions mailing list
>>osg-submissions at lists.openscenegraph.org
>>http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
>>
>>    
>>
>_______________________________________________
>osg-submissions mailing list
>osg-submissions at lists.openscenegraph.org
>http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
>  
>



More information about the osg-submissions mailing list