Building VTK and link arguments

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Building VTK and link arguments

Mike Jackson-9
I am building the official VTK 5.x release on OS X and I would like  
to add a custom link argument for all the generated libraries. I am  
building dynamic libraries and I would like to set the "install-name"  
of each library to "@executable_path/../Plugins" so I can include the  
libs in my .app package. Normally I would set this in the Xcode build  
settings but since I am using cmake I have no idea where to set that.

Thanks for any help.
--------
Mike Jackson
imikejackson <at> gmail <dot> com



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Building VTK and link arguments

Martin Costabel
Mike Jackson wrote:
> I am building the official VTK 5.x release on OS X and I would like to
> add a custom link argument for all the generated libraries. I am
> building dynamic libraries and I would like to set the "install-name" of
> each library to "@executable_path/../Plugins" so I can include the libs
> in my .app package. Normally I would set this in the Xcode build
> settings but since I am using cmake I have no idea where to set that.

In the Fink package which uses cmake-2.0.5, there is the following cmake
command line option

   -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L%p/lib -install_name
%p/lib/vtk/\`basename <TARGET>\`"

Here %p/lib/vtk is the directory where the libraries will be installed.
This hack works, but it does not work with newer versions of cmake.

I would be interested, too, if someone found out how to transmit the
-install_name to the latest version of cmake. One can, of course, change
the install_name after the fact by running install_name_tool on all of
the vtk binaries and libs, but this is not a good solution.

--
Martin


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Building VTK and link arguments

Mathieu Malaterre-2
Martin Costabel wrote:

> Mike Jackson wrote:
>
>> I am building the official VTK 5.x release on OS X and I would like to
>> add a custom link argument for all the generated libraries. I am
>> building dynamic libraries and I would like to set the "install-name"
>> of each library to "@executable_path/../Plugins" so I can include the
>> libs in my .app package. Normally I would set this in the Xcode build
>> settings but since I am using cmake I have no idea where to set that.
>
>
> In the Fink package which uses cmake-2.0.5, there is the following cmake
> command line option
>
>   -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L%p/lib -install_name
> %p/lib/vtk/\`basename <TARGET>\`"
>
> Here %p/lib/vtk is the directory where the libraries will be installed.
> This hack works, but it does not work with newer versions of cmake.
>
> I would be interested, too, if someone found out how to transmit the
> -install_name to the latest version of cmake. One can, of course, change
> the install_name after the fact by running install_name_tool on all of
> the vtk binaries and libs, but this is not a good solution.
>

This sound like a CMake issue. Could you either forward that to CMake ML
or open a bug report for that ?

Thanks
Mathieu
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers