diff options
Diffstat (limited to 'config/cmake/ConfigureChecks.cmake')
-rw-r--r-- | config/cmake/ConfigureChecks.cmake | 15 |
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}) |