summaryrefslogtreecommitdiffstats
path: root/HDF5Examples/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-11-29 18:54:22 (GMT)
committerGitHub <noreply@github.com>2023-11-29 18:54:22 (GMT)
commitac650fa9d1e587ca8cf1154eebbb900f484840b0 (patch)
tree077021666c172185acf1712ff5a76dbf181116f3 /HDF5Examples/CMakeLists.txt
parent0fa3029c885cdcb5f25ad606e88cf09482d28226 (diff)
downloadhdf5-ac650fa9d1e587ca8cf1154eebbb900f484840b0.zip
hdf5-ac650fa9d1e587ca8cf1154eebbb900f484840b0.tar.gz
hdf5-ac650fa9d1e587ca8cf1154eebbb900f484840b0.tar.bz2
Update examples with 1.6 api and static libs (#3874)
* Update examples with 1.6 api and static libs * Only check for STATIC only builds * Do not calculate version as library has already.
Diffstat (limited to 'HDF5Examples/CMakeLists.txt')
-rw-r--r--HDF5Examples/CMakeLists.txt24
1 files changed, 13 insertions, 11 deletions
diff --git a/HDF5Examples/CMakeLists.txt b/HDF5Examples/CMakeLists.txt
index 8f6acae..b5fb3e2 100644
--- a/HDF5Examples/CMakeLists.txt
+++ b/HDF5Examples/CMakeLists.txt
@@ -30,17 +30,19 @@ message (STATUS "HDF5 H5_LIBVER_DIR: ${H5_LIBVER_DIR}")
#-----------------------------------------------------------------------------
# parse the full version number from H5public.h and include in H5_VERS_INFO
#-----------------------------------------------------------------------------
-find_file (_h5public_h H5public.h ${H5EX_HDF5_INCLUDE_DIRS})
-file (READ ${_h5public_h} _h5public_h_contents)
-
-string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$"
- "\\1" H5_VERS_MAJOR ${_h5public_h_contents})
-string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$"
- "\\1" H5_VERS_MINOR ${_h5public_h_contents})
-string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$"
- "\\1" H5_VERS_RELEASE ${_h5public_h_contents})
-string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._-]*)\".*$"
- "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents})
+if(NOT DEFINED _h5public_h_contents)
+ find_file (_h5public_h H5public.h ${H5EX_HDF5_INCLUDE_DIRS})
+ file (READ ${_h5public_h} _h5public_h_contents)
+
+ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$"
+ "\\1" H5_VERS_MAJOR ${_h5public_h_contents})
+ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$"
+ "\\1" H5_VERS_MINOR ${_h5public_h_contents})
+ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$"
+ "\\1" H5_VERS_RELEASE ${_h5public_h_contents})
+ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._-]*)\".*$"
+ "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents})
+endif ()
if (WIN32)
set(CMAKE_TEST_LIB_DIRECTORY "${HDF5_TOOLS_DIR}")