
INCLUDE(CheckIncludeFiles)

# Check for pthread
CHECK_INCLUDE_FILES(pthread.h HAVE_PTHREAD_H)

IF(NOT HAVE_PTHREAD_H)
  MESSAGE(FATAL_ERROR "pthread.h not found.")
ENDIF(NOT HAVE_PTHREAD_H)

SET(PTHREAD_LIBRARIES -lpthread)
SET(ANNOYME_LIBS_COMMON ${ANNOYME_LIBS_COMMON} ${PTHREAD_LIBRARIES})

# Check for X
find_package(X11)

IF(NOT X11_FOUND)
  MESSAGE(FATAL_ERROR "X11 was not found.")
ENDIF(NOT X11_FOUND)

INCLUDE_DIRECTORIES(${X11_INCLUDE_DIRS})

SET(ANNOYME_LIBS_COMMON ${ANNOYME_LIBS_COMMON} ${X11_LIBRARIES})

# Check for yaml-cpp
find_package(YAMLCPP)

IF(NOT YAMLCPP_FOUND)
  MESSAGE(FATAL_ERROR "YAML-cpp was not found.")
ENDIF(NOT YAMLCPP_FOUND)
SET(ANNOYME_LIBS_COMMON ${ANNOYME_LIBS_COMMON} ${YAMLCPP_LIBRARIES})
