esatel wrote: > 2. The other sets a similar variable but then does find_package on HDF5 and > loads the dependencies into NetCDF_INCLUDE_DIRS and NetCDF_LIBRARIES. > > This design (2) cascades. FindHDF5.cmake represents a similar decision about > whether to find_package its dependencies like the zlib compression library. > I believe the one in the cmake distro doesn't do that. > > What is the best practice here? To handle dual locations for the library at > hand or to accumulate or both? The first seems unavoidable ... the second > seems to be an unevenly applied standard.
My personal vote on this is: if the public headers of package X include headers from one of it's dependencies then you should cascade. So if <netcdf.h> does #ifdef WITH_HDF5 #include <hdf5.h> #endif then you would get a compile error if the HDF5 include directories are not set. If this is just an internal dependency or you would explicitely need to include e.g. netcdf/hdf5.h to get that sort of stuff then I would vote for not becoming recursive. Which is a "sane" default as most packages will not need that recursive approach then. Eike --
signature.asc
Description: This is a digitally signed message part.
-- 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