improve the HDF4 version handling at configuration level.
Build and Deploy Documentation / build-and-deploy (push) Successful in 22s
Build and Deploy Documentation / build-and-deploy (push) Successful in 22s
This commit is contained in:
1 parent
cd762a2808
commit
47f24cb844
1 file changed
+8
-1
+8
-1
@@ -350,8 +350,15 @@ if (nexus)
|
||||
endif()
|
||||
|
||||
#--- try to extract the HDF4 version from H4config.h (autotools builds) --------
|
||||
# Some distributions (e.g. Debian/Ubuntu's libhdf4-dev) install it lower-cased
|
||||
# as 'h4config.h' instead of the upstream 'H4config.h', so check both.
|
||||
if (EXISTS "${HDF4_INCLUDE_DIR}/H4config.h")
|
||||
file(STRINGS "${HDF4_INCLUDE_DIR}/H4config.h" HDF4_VERSION_LINE REGEX "^#define[ \t]+H4_VERSION[ \t]+\"[^\"]*\"")
|
||||
set(HDF4_CONFIG_HEADER "${HDF4_INCLUDE_DIR}/H4config.h")
|
||||
elseif (EXISTS "${HDF4_INCLUDE_DIR}/h4config.h")
|
||||
set(HDF4_CONFIG_HEADER "${HDF4_INCLUDE_DIR}/h4config.h")
|
||||
endif ()
|
||||
if (HDF4_CONFIG_HEADER)
|
||||
file(STRINGS "${HDF4_CONFIG_HEADER}" HDF4_VERSION_LINE REGEX "^#define[ \t]+H4_VERSION[ \t]+\"[^\"]*\"")
|
||||
string(REGEX REPLACE "^#define[ \t]+H4_VERSION[ \t]+\"([^\"]*)\".*" "\\1" HDF4_VERSION "${HDF4_VERSION_LINE}")
|
||||
endif ()
|
||||
|
||||
|
||||
Reference in new issue
Block a user