summaryrefslogtreecommitdiffstats
path: root/config/cmake/ConfigureChecks.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/ConfigureChecks.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/ConfigureChecks.cmake')
-rw-r--r--config/cmake/ConfigureChecks.cmake15
1 files changed, 15 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})