summaryrefslogtreecommitdiffstats
path: root/config/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'config/cmake')
-rw-r--r--config/cmake/ConfigureChecks.cmake15
-rw-r--r--config/cmake/H5pubconf.h.in3
2 files changed, 18 insertions, 0 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index 87d68c9..f6aac09 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -379,6 +379,21 @@ IF (NOT H5_SIZEOF_OFF64_T)
SET (H5_SIZEOF_OFF64_T 0)
ENDIF (NOT H5_SIZEOF_OFF64_T)
+# Find the library containing clock_gettime()
+IF (NOT WINDOWS)
+ CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_IN_LIBC)
+ CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT)
+ CHECK_LIBRARY_EXISTS(posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4)
+ IF(CLOCK_GETTIME_IN_LIBC)
+ SET(H5_HAVE_CLOCK_GETTIME 1)
+ ELSEIF(CLOCK_GETTIME_IN_LIBRT)
+ SET(H5_HAVE_CLOCK_GETTIME 1)
+ LIST(APPEND LINK_LIBS rt)
+ ELSEIF(CLOCK_GETTIME_IN_LIBPOSIX4)
+ SET(H5_HAVE_CLOCK_GETTIME 1)
+ LIST(APPEND LINK_LIBS posix4)
+ ENDIF(CLOCK_GETTIME_IN_LIBC)
+ENDIF (NOT WINDOWS)
# For other tests to use the same libraries
SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS})
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index 06026f0..87d6b23 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -109,6 +109,9 @@
/* Define if the compiler understands the __func__ keyword */
#cmakedefine H5_HAVE_C99_FUNC @H5_HAVE_C99_FUNC@
+/* Define to 1 if you have the `clock_gettime' function. */
+#cmakedefine H5_HAVE_CLOCK_GETTIME @H5_HAVE_CLOCK_GETTIME@
+
/* Define if the function stack tracing code is to be compiled in */
#cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@