[CMake] FindHDF5.cmake and the "hl" versions of hdf5 libs
James C. Sutherland
James.Sutherland at utah.edu
Wed Sep 1 10:54:30 EDT 2010
On Wed, Sep 1, 2010 at 8:06 AM, Michael Jackson <mike.jackson at bluequartz.net
> wrote:
> This probably isn't the best solution but until CMake fixes the bug and
> includes the updated FindHDF5.cmake file in the next or future release this
> is what you have to do:
>
> Copy the FindHDF5.cmake file from the current CMake distribution that you
> are using and place it somewhere in your project folder, say
> ${PROJECT_ROOT}/Resources/CMake/Modules.
>
> Then in your CMakeLists.txt file use the following line somewhere BEFORE
> you start looking for your libraries:
>
> set (CMAKE_MODULES_DIR ${PROJECT_SOURCE_DIR}/Resources/CMake/Modules
> ${CMAKE_MODULE_PATH})
>
> Now, edit the FindHDF5.cmake file (the one that you copied into your
> project) to remove the offending lines/fix the bug. The above line will
> effectively substitute your corrected version for the one that ships with
> cmake. When CMake has a release where the bug is fixed then you can remove
> this workaround.
>
> If your fix is general enough attach the corrected file to the bug report.
>
> Cheers.
>
> ___________________________________________________________
> Mike Jackson www.bluequartz.net
>
Just in case someone else tries this, there was a typo above. Use the
following:
set ( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Resources/CMake/Modules
${CMAKE_MODULE_PATH} )
Also, as per Mike Jackson's suggestion (off-list), the following changes are
necessary in FindHDF5.cmake:
> Line 178:
> set( HDF5_C_LIBRARY_NAMES_INIT hdf5_hl hdf5 )
>
> change to
> set( HDF5_C_LIBRARY_NAMES_INIT hdf5 )
>
This fixed the problem for me.
Many thanks to Mike for the quick fix!
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100901/25d8f686/attachment-0001.htm>
More information about the CMake
mailing list