[CMake] Status of FindHDF5.cmake in CMake?

Lori Pritchett-Sheats lpritch at lanl.gov
Thu Apr 14 11:46:39 EDT 2011


Hi

I had not seen a reply to your question and I thought I give my $0.02. 
I'm fairly new to CMake and I've run into this problem as well.

The only solution I came up with was calling find_package(HDF5 ... *) 
again if it fails the first time. On my project, I search for HDF5 using 
find_package with NO_MODULE (i.e. look for a CMake generated config 
file). If that fails, I assume HDF5 was not built with CMake and call 
find_package(HDF5 ..) again without NO_MODULE. In this second case, 
CMake searches for a FindHDF5.cmake file and executes it. I believe that 
FindXXX.cmake modules are designed for projects/packages that are not 
built with CMake. By the time FindXXX.cmake is invoked the find_package 
call is already in a Module search mode and has eliminated the 
possibility that a CMake config file exists.




kent williams wrote:
> Hi! I'm working on some classes for ITK4 that use the HDF library, and
> I've run into a quandary.
>
> If you build & install HDF5 with CMake, you MUST use
>
>   find_package(HDF5 [REQUIRED] NO_MODULE)
>
> in order to use HDF5. If you use the more natural command
>
>    find_package(HDF5 [REQUIRED])
>
> then the cmake/share/cmake-2.8/Modules/FindHDF5.cmake fails to find
> the installation.
>
> The FindHDF5.cmake depends on HDF5 using the autoconf-based build
> system, and searches for one of the HDF utilities to run.
>
> This doesn't feel like a good situation.  Shouldn't the FindHDF5.cmake
> perhaps look for both sorts of HDF5 installs?
> _______________________________________________
> 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 CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>   

-- 
Lori A. Pritchett-Sheats, PhD.
CCS-2, Computational Physics and Methods
Office: 505-665-6675
Fax: 505-665-4972

Los Alamos National Laboratory
P.O. Box 1663
MS D413
Los Alamos, NM 87544



More information about the CMake mailing list