I'm trying to create make files of C++ code on a server doing
cmake ../
and I get the error
-- Could NOT find HDF5 (missing: HDF5_INCLUDE_DIRS) (found version "1.10.7")
CMake Error at src/CMakeLists.txt:180 (message):
HDF5 support was requested, but no HDF5 library was found on this system
I have installed HDF5 in /home/directory/
so I have HDF5 include and library files in
/home/directory/include
/home/directory/lib
I've tried to add in CMakeLists.txt the following lines:
set(HDF5_LIBRARIES "/home/directory/")
set(HDF5_CXX_LIBRARIES "/home/directory/")
set(HDF5_INCLUDE_DIRS "/home/directory/")
set(HDF5_CXX_INCLUDE_DIRS "/home/directory/")
But still getting the error.
I've also tried to export HDF5_ROOT=/home/directory/ without success.
The error come from the following lines in the code:
if (HDF5_FOUND)
target_include_directories(soft PUBLIC ${HDF5_INCLUDE_DIRS})
target_link_libraries(soft PUBLIC ${HDF5_LIBRARIES})
else (HDF5_FOUND)
message(FATAL_ERROR "HDF5 support was requested, but no HDF5 library was found on this system")
endif (HDF5_FOUND)
Any help?
Using CMake 3.19.3 and hdf5-1.10.7
question from:
https://stackoverflow.com/questions/65938056/not-able-to-link-hdf5-path-in-cmake-configuration 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…