<div class="gmail_quote">On Thu, Jun 11, 2009 at 5:05 PM, James C. Sutherland <span dir="ltr"><<a href="mailto:James.Sutherland@utah.edu">James.Sutherland@utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
On Jun 11, 2009, at 4:49 PM, James C. Sutherland wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have an executable that links with HDF5 (by the way, is there any plan to create a "FindHDF5.cmake" file?).<br>
The problem is that I have two flavors of libraries:<br>
libhdf5_cpp.a libhdf5.a<br>
libhdf5_cpp.dylib libhdf5.dylib<br>
When I do<br>
set( HDF5_LIBRARIES hdf5_cpp hdf5 )<br>
it seems that CMake ends up choosing the *.dylib rather than the *.a versions. Is there a way to fix this so that I link statically?<br>
<br>
</blockquote>
<br></div>
Well, I tried<br>
set( HDF5_LIBRARIES hdf5_cpp.a hdf5.a )<br>
and that partly did the job. It appears that somehow some other hdf5 dlls were being pulled in (hdf5_cpp.0.dylib).<br>
<br>
I would like to generate executables that can be run on other systems, but the problem is these DLLs are killing me! Any tips would be great.</blockquote></div><br>Keep in mind that on Mac the linker will try extremely hard to choose the dylib over the .a lib. The only way I could get them to work properly was to specify the whole file name on the link line that includes the .a, or put the .a libraries in a separate folder and use a special argument to the linker to tell it to do breadth first search when looking for libraries (I don't remember offhand what the argument is, see the man page for the linker).<br>
<br>If you are distributing your application on a Mac, then there are myriads of methods to distribute the shared libraries with the application.<br><br>James<br>