X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=cmake%2FModules%2FSelectRTBackend.cmake;fp=cmake%2FModules%2FSelectRTBackend.cmake;h=0f2b07e1bc05dbe35702d913da14af07d0d6a31e;hb=046935044fe8d2dce3540ad0c385d30edec1f4bf;hp=0000000000000000000000000000000000000000;hpb=363ca814aa120fbab8c5ea4b55e3c79ea5065a7f;p=umurmur.git diff --git a/cmake/Modules/SelectRTBackend.cmake b/cmake/Modules/SelectRTBackend.cmake new file mode 100644 index 0000000..0f2b07e --- /dev/null +++ b/cmake/Modules/SelectRTBackend.cmake @@ -0,0 +1,15 @@ +function(SelectRTBackend) + check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT) + + if(NOT HAVE_CLOCK_GETTIME_RT) + check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) + if(NOT HAVE_CLOCK_GETTIME) + check_library_exists(c clock_get_time "mach/time.h" HAVE_CLOCK_GET_TIME) + if(NOT HAVE_CLOCK_GET_TIME) + message(FATAL_ERROR "Didn't find clock_gettime() or clock_get_time()!") + endif() + endif() + else() + set(LIBRT rt PARENT_SCOPE) + endif() +endfunction()