if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
  set(SYS_RND_HDR "")
else()
  find_path(SYS_RND_HDR sys/random.h PATH /usr/include/ /usr/local/include/)
  if(SYS_RND_HDR)
    message(STATUS "Found sys/random.h in ${SYS_RND_HDR}")
    set(HAVE_SYS_RANDOM TRUE)
  else()
    set(SYS_RND_HDR "")
    unset(HAVE_SYS_RANDOM)
  endif()
endif()

mark_as_advanced(SYS_RND_HDR)
