0f2b07e1bc05dbe35702d913da14af07d0d6a31e
[umurmur.git] / cmake / Modules / SelectRTBackend.cmake
1 function(SelectRTBackend)
2   check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT)
3
4   if(NOT HAVE_CLOCK_GETTIME_RT)
5     check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
6     if(NOT HAVE_CLOCK_GETTIME)
7       check_library_exists(c clock_get_time "mach/time.h" HAVE_CLOCK_GET_TIME)
8       if(NOT HAVE_CLOCK_GET_TIME)
9         message(FATAL_ERROR "Didn't find clock_gettime() or clock_get_time()!")
10       endif()
11     endif()
12   else()
13     set(LIBRT rt PARENT_SCOPE)
14   endif()
15 endfunction()