Closed madebr closed 3 years ago
For the sake of build system consistency: I'd actually prefer to build Hdf5 with CMake if Matio is built by CMake and use Autotools consistently otherwise.
Ok, but why is zlib built with autotools instead of cmake? Isn't requiring this an arbitrary requirement?
For the sake of build system consistency: I'd actually prefer to build Hdf5 with CMake if Matio is built by CMake and use Autotools consistently otherwise.
Ok, but why is zlib built with autotools instead of cmake? Isn't requiring this an arbitrary requirement?
Right. In that case, zlib should be built by CMake, too. Or use system-wide zlib.
zlib is not build with autotools in the Travis script, it is/was enclosed with if [[ "${USE_CMAKE:-no}" == "no" ]]
.
It is built together with the HDF5 libraries when executing ctest
.
And in this case find_package(ZLIB)
is not used at all, since the HDF5 config file defines the hdf5::zlib-static
or hdf5::zlib-shared
target.
zlib is not build with autotools in the Travis script, it is/was enclosed with
if [[ "${USE_CMAKE:-no}" == "no" ]]
.It is built together with the HDF5 libraries when executing
ctest
.And in this case
find_package(ZLIB)
is not used at all, since the HDF5 config file defines thehdf5::zlib-static
orhdf5::zlib-shared
target.
Correct. I wasn't expecting this complicated configuration because I am used to always use system libraries (or conan packages). Personally, I try to avoid private zlib libraries because this introduces duplicate symbols. But it's totally fine for ci :smile: .
Anyhow, I reverted the hdf5-cmake-ci change.
I'm getting this same error now as well, because FindHDF5
in CMake 3.19 defines a HDF5::HDF5
target. I propose a different solution, see #159.
The other change in this PR (adding REQUIRED
) is also still open for discussion. Since the CMake project tries to mirror the behaviour of configure, I suggest to do the same here as well: if hdf5 or zlib is not found, continue without supporting it (i.e don't add REQUIRED
).
@MaartenBent Not being a CMake expert myself, I think I'll go with your alternate PR #159.
The other change in this PR (adding REQUIRED) is also still open for discussion. Since the CMake project tries to mirror the behaviour of configure, I suggest to do the same here as well: if hdf5 or zlib is not found, continue without supporting it (i.e don't add REQUIRED).
Yes, sounds reasonable.
Hey,
These changes should make matio build on cci without any patches. (apart from the fix to the linker flags)
By requiring the dependencies, you are 100% sure that matio has them enabled. Because it might always not be found.
Kind regards