netcdf-c icon indicating copy to clipboard operation
netcdf-c copied to clipboard

Bzip2/Bz2 confusion in Cmake build

Open zklaus opened this issue 2 years ago • 2 comments

I think there is some confusion between Bzip2 and Bz2 in the Cmake build. Namely, there are two Cmake detection modules (here and here), but only the Bz2 one seems to be called, leading to only the Bz2_FOUND variable being set.

In the plugin section, the bzip2 plugin is build unconditionally, either with the vendored copy of libbzip2 or the system one, see https://github.com/Unidata/netcdf-c/blob/9137873b3d81288339337441073f9a88644a8374/plugins/CMakeLists.txt#L97-L103

However, the install of the plugin is conditioned on the Bzip2_FOUND variable, which is never set, meaning the plugin will never be installed, see https://github.com/Unidata/netcdf-c/blob/9137873b3d81288339337441073f9a88644a8374/plugins/CMakeLists.txt#L116-L118.

Unless there is a separate Bz2 library or something else that I am not aware of, the Cmake documentation seems to suggest that one should instead use FIND_PACKAGE(Bzip2) and remove the usage of Bz2?

zklaus avatar Jul 03 '23 14:07 zklaus

Thanks! I'll take a look.

WardF avatar Jul 11 '23 22:07 WardF