libharu 2.4.1 breaks cmake discovery
I recently ran into an issue installing pcl, which has vtk as a dependency. I noticed that the build failed during FindLibHaru.cmake
as per https://aur.archlinux.org/packages/pcl#comment-880849.
CMake Error at /usr/lib64/cmake/vtk/FindLibHaru.cmake:16 (file):
file STRINGS file "/usr/include/hpdf_version.h" cannot be read.
Call Stack (most recent call first):
/usr/lib64/cmake/vtk/VTK-vtk-module-find-packages.cmake:1167 (find_package)
/usr/lib64/cmake/vtk/vtk-config.cmake:150 (include)
cmake/pcl_find_vtk.cmake:25 (find_package)
CMakeLists.txt:375 (include)
-- Could NOT find LibHaru: Found unsuitable version "..", but required is at least "2.4.0" (found /usr/lib/libhpdf.so)
-- Could not find the VTK package due to a missing dependency: LibHaru
After some investigation, I found out that this was caused by a change in libharu that dynamically pulls versioning information from the cmake file instead of the hpdf_version.h
header: https://github.com/libharu/libharu/pull/237
In particular, these lines are the cause of the issue.
It should be possible to pull version information from cmake instead of parsing through the now defunct header.