summaryrefslogtreecommitdiffstats
path: root/config/cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2011-10-11 20:54:41 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2011-10-11 20:54:41 (GMT)
commit79f21edd38786825e5e0f7b24617004ce43a2b2c (patch)
tree20112b0a92a2fa29cdf2a8ba3f8b40613e1b23c9 /config/cmake
parent6b68df15e797f82c364784e619922e1b5339f349 (diff)
downloadhdf5-79f21edd38786825e5e0f7b24617004ce43a2b2c.zip
hdf5-79f21edd38786825e5e0f7b24617004ce43a2b2c.tar.gz
hdf5-79f21edd38786825e5e0f7b24617004ce43a2b2c.tar.bz2
[svn-r21523] Added CLOCK_GET_TIME define to cmake configure
Tested: local linux
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@