add HDF4 library version in the configure output.
Build and Deploy Documentation / build-and-deploy (push) Successful in 33s

This commit is contained in:
2026-09-17 08:28:26 +02:00
parent 99cf0b19ec
commit cd762a2808
+7 -1
View File
@@ -349,6 +349,12 @@ if (nexus)
message(FATAL_ERROR "HDF4 library not found. Please install libhdf4-dev or hdf-devel")
endif()
#--- try to extract the HDF4 version from H4config.h (autotools builds) --------
if (EXISTS "${HDF4_INCLUDE_DIR}/H4config.h")
file(STRINGS "${HDF4_INCLUDE_DIR}/H4config.h" HDF4_VERSION_LINE REGEX "^#define[ \t]+H4_VERSION[ \t]+\"[^\"]*\"")
string(REGEX REPLACE "^#define[ \t]+H4_VERSION[ \t]+\"([^\"]*)\".*" "\\1" HDF4_VERSION "${HDF4_VERSION_LINE}")
endif ()
# HDF4 4.4.0 changed the Vgetname() prototype from
# int32 Vgetname(int32 vkey, char *vgname)
# to
@@ -497,7 +503,7 @@ endif (OpenMP_FOUND)
if (nexus)
message("")
if (HAVE_HDF4)
message(" HDF4 found in ${HDF4_INCLUDE_DIRS}")
message(" HDF4 found in ${HDF4_INCLUDE_DIRS}, Version: ${HDF4_VERSION}")
else (HAVE_HDF4)
message(" HDF4 not present.")
endif (HAVE_HDF4)