From e0da473449592637c236cd7ffce36b988230621e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 3 Jul 2015 10:53:23 -0400 Subject: [PATCH] add check for gettime in librt, needed for building on pi --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 049ca5d08..447c0e334 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,16 @@ check_type_size("ucontext_t" HAVE_UCONTEXT_T) # *** LIBRARY CHECKS *** +if (UNIX) + include (CheckLibraryExists) + CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) + if(NOT HAVE_CLOCK_GETTIME) + message(FATAL_ERROR "clock_gettime not found") + else(NOT HAVE_CLOCK_GETTIME) + list(APPEND ZM_BIN_LIBS "-lrt") + endif(NOT HAVE_CLOCK_GETTIME) +endif(UNIX) + # zlib find_package(ZLIB) if(ZLIB_FOUND)