[osg-submissions] Plugin DLL search order fix for Win32
Luigi Calori
l.calori at cineca.it
Sun Aug 26 17:46:19 PDT 2007
It seem to work, no crash on exit,
if someone want to test, here is the patch and the full files touched.
It rely on .. and assumes bin and lib folders are sibling...
Luigi Calori wrote:
>Hi Robert
>
>Aftre quite a while of experimentig, I came up to this point:
>
>all the examplesan applications .exe are in bin, along with their .pdb
>and .ilk
>plugins are in bin/osgplugins-2.1.7 along with their .pdb and .ilk
>
>all the core libs .lib and .exp are in lib/<Debug - Release> with their
>original names osg<libname>.lib
>all the core .dll , pdb, .ilk are in bin reamed to lib<libname>.lib
>
>All this happen without copying or moving but just tweaking target
>properties, without screwing too much the build scripts.
>
>I did un update and build but I now have an error on exit of osgviewer
>and other examples.
>
>I do not think it is related to my twak of the build scripts, anyway I
>am doing a fresh build now.
>
>The osgconv --compress seems still not working, I let you know after the
>build.
>I this layout seems you ok, I' ll clean a little and send the patches.
>
>
>Robert Osfield wrote:
>
>
>
>>Hi Luigi,
>>
>>What would the simplicist options be? Just build everything in bin
>>then copy the libs to a lib directory on install?
>>
>>What renaming would we need to do to achieve this?
>>
>>My own gut instinct with copying is that this could introduce
>>confusions and potential bugs.
>>
>>I'm prepared to see renaming done if it make things more practical for
>>building, running and debugging out of the box with minimal extra
>>steps/setting of env vars.
>>
>>On the renaming front I would have thought the only options are to
>>rename the apps with an extra suffix such as app, or the preppend the
>>core libraries with a lib. neither is very elegant, but then neither
>>is copying stuff around.
>>
>>W.r.t submissions, you could try patches again, but I know that whole
>>files always works solidly and makes it easy for me to do peer review
>>of the changes.
>>
>>Robert.
>>
>>On 8/26/07, Luigi Calori <l.calori at cineca.it> wrote:
>>
>>
>>
>>
>>>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
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>_______________________________________________
>>>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
>>
>>
>>
>>
>>
>>
>
>_______________________________________________
>osg-submissions mailing list
>osg-submissions at lists.openscenegraph.org
>http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build_in_one_folder.zip
Type: application/x-zip-compressed
Size: 12621 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20070827/663be7b7/attachment-0001.bin
More information about the osg-submissions
mailing list