Default installation directory for cmake config files #5364
badshah400
started this conversation in
Proposed Change
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
This is a request to change the default path where hdf5 installs its cmake config files (
hdf5-config.cmake
, etc.) to<prefix>/lib(64)/cmake/hdf5
from the current value of<prefix>/lib(64)/cmake
. My reasoning for requesting this change follows, but TL;DR cmake does not even look for the config files in the currently set default path and applications depending on hdf5, consequently, need to be told where to look by explicitly specifying hints like-DHDF5_ROOT
.I am a packager for openSUSE trying to update our HDF5 rpms to version 1.14.6 and move over the build to cmake from autotools. This is already ready in our staging repository, but we noticed that downstream packages depending on hdf5 and also built using cmake are unable to 'see' hdf5's cmake config files and end up depending on cmake's own bundled
FindHDF5.cmake
. For packages conforming to relatively recent cmake standards, specifying-DHDF5_ROOT=<prefix>/lib(64)
works, but of course it would be ideal for cmake to find the config files without having to provide such additional hints.From discussions over on cmake's issue tracker — there was also an issue with cmake's own
FindHDF5.cmake
module — it turns out that the current default path to whichhdf5-config.cmake
and other scripts are installed to is<prefix>/lib(64)/cmake
, which is unconventional, and not a directory in cmake's search path for when apps usefind_package()
in theCONFIG
mode to look for a library. Instead, going by the cmake manual, the default search path includes (but is not limited to) a sub-directory<prefix>/lib(64)/cmake/<name>/
(but not the parent dir) which would, therefore, be a better default value for hdf5's installation script to install these files into.Indeed for our rpms we explicitly set the value of
HDF5_INSTALL_CMAKE_DIR
to<prefix>/lib(64)/cmake/hdf5
and every dependent package invokingfind_library(HDF5)
in their cmake file could find the library straight away, without needing hints toHDF5_ROOT
orHDF5_DIR
or so.This is a follow-up from the discussion in PR #5361.
Thanks for the library, and for reading and considering this RFC.
Beta Was this translation helpful? Give feedback.
All reactions