diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a6ff58..74a87fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,9 +29,11 @@ SET_TARGET_PROPERTIES(ubox-static PROPERTIES OUTPUT_NAME ubox) SET(LIBS) CHECK_FUNCTION_EXISTS(clock_gettime HAVE_GETTIME) -IF(NOT HAVE_GETTIME) +CHECK_FUNCTION_EXISTS(shm_open HAVE_SHM) +IF(NOT HAVE_GETTIME OR NOT HAVE_SHM) CHECK_LIBRARY_EXISTS(rt clock_gettime "" NEED_GETTIME) - IF(NEED_GETTIME) + CHECK_LIBRARY_EXISTS(rt shm_open "" NEED_SHM) + IF(NEED_GETTIME OR NEED_SHM) TARGET_LINK_LIBRARIES(ubox rt) ENDIF() ENDIF()