[Paraview] @executable_path when deploying custom plugins for OSX
Felipe Bordeu Weldt
felipe.bordeu at ec-nantes.fr
Wed Feb 8 03:13:29 EST 2012
hi Pete
I use this script to clean my pluings in mac:
"./fix_lib $(Paraview_build_dir)/bin '$(ParaviewPXDMFReader_lib_install_dir)/libPXDMFReader.dylib'"
----- fix_lib -------
#!/bin/bash
stripString=$1
libpath=$2
insertString=@executable_path/../Libraries/
echo "Striping :" $stripString
echo "In : $libpath"
echo "insert String :" $insertString
for myfile in `otool -L $libpath | grep "$stripString" | awk '{print $1}'`
do
#echo "fichier=$myfile"
lib=`echo $myfile | awk -F / '{print $NF}'`
echo "changing $myfile to $insertString$lib"
install_name_tool -change $myfile $insertString$lib $libpath
done
for myfile in `otool -L $libpath | grep "framework" | grep -v "/System" | awk '{print $1}'`
do
#echo "fichier=$myfile"
echo "changing $myfile to @executable_path/../Frameworks/$myfile"
install_name_tool -change $myfile @executable_path/../Frameworks/$myfile $libpath
done
echo "changing name to libPXDMFReader.dylib"
install_name_tool -id libPXDMFReader.dylib $libpath
echo "Done"
echo "install_name_tool -change @executable_path/../Libraries/libvtkhdf5.1.8.5.dylib @executable_path/../Libraries/libhdf5.1.8.5.dylib$libpath"
exit
Le 7 févr. 2012 à 20:23, Peter Schmitt a écrit :
> Hi David,
>
> Thanks for the hints. My goal is to create a plugin that my collaborators can load using the Kitware release of the ParaView binaries. I don't care if my plugin is installed in the SuperBuild's ParaView.app.
>
> In any case, I tried adding this to my plugin's CMakeLists.txt file:
>
> SET(PARAVIEW_VERSION "${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}")
> SET(PV_INSTALL_BIN_DIR bin)
> SET(PV_INSTALL_LIB_DIR lib/paraview-${PARAVIEW_VERSION})
>
> INSTALL(TARGETS vtkLFMReader
> RUNTIME DESTINATION ${PV_INSTALL_BIN_DIR} COMPONENT RuntimeLibraries
> LIBRARY DESTINATION ${PV_INSTALL_LIB_DIR} COMPONENT RuntimeLibraries
> ARCHIVE DESTINATION ${PV_INSTALL_LIB_DIR} COMPONENT Development)
>
> Now `make install` copies my file to /usr/local/paraview-3.12. However, otool still shows hard-coded paths (ie. not @executable_path).
>
> I'll look into BundleUtilities to see if I can explicitly call fixup_bundle_item to set the @executable_path for my plugin. I suppose the easiest method might be just to copy my plugin to the ParaView source tree & let the ParaView `make install` target handle setting all of fixup_bundle's arguments for me. That seemed to work with an old version of ParaView http://www.paraview.org/pipermail/paraview/2008-November/009952.html
>
> Thanks,
> Pete
>
> On Mon, Feb 6, 2012 at 5:26 PM, David E DeMarle <dave.demarle at kitware.com> wrote:
> fixup_bundle is a cmake 2.8 feature that internally just runs
> install_name_tool on Mac like you are considering doing manually.
> I believe it is only tied the install target but I might be wrong on
> that, ask on the cmake list.
>
> See the ParaViewPlugins.cmake and Superbuild/CMakeLists.txt for how
> our plugins get the install target hooked in.
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
>
>
> On Mon, Feb 6, 2012 at 7:06 PM, Peter Schmitt <pschmittml at gmail.com> wrote:
> > Hello,
> >
> > I have built ParaView-3.12.0 from the SuperBuild. Using otool, I noticed
> > that libraries had a hard-coded path to each shared library in the build
> > directory (otool -L ParaView-build/bin/libvtkPVServerManager.dylib).
> > However, after `make install`, I noticed each library was prefixed with
> > @executable_path (otool -L /usr/local/ParaView\
> > 3.12.0.app/Contents/Libraries/libvtkPVServerManager.dylib). I would like to
> > apply the same transformation to any custom plugins I have compiled.
> > However, my plugin doesn't have a 'make install' target. It looks like I
> > can manually update my plugin dylib via calls to
> >
> > install_name_tool -change /full/path/to/libfoo.dylib
> > @executable_path/../Libraries/libfoo.dylib libBar.dylib
> >
> > but there has to be a better way. The `make install` target from SuperBuild
> > suggests that the "fixup_bundle" updates the libraries appropriately. How
> > do I apply the same transformation for my custom plugin?
> >
> > Thanks!
> > Pete
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the ParaView Wiki at:
> > http://paraview.org/Wiki/ParaView
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.paraview.org/mailman/listinfo/paraview
> >
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120208/6adde44f/attachment-0001.htm>
More information about the ParaView
mailing list