### Add Boost and Threads
find_package(Boost 1.42 COMPONENTS thread REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

### Setup doxygen documentation 
# TODO: put into helpers.cmake (?)
find_package(Doxygen)
if(DOXYGEN_FOUND)
# Using a .in file means we can use CMake to insert project settings
# into the doxyfile.  For example, CMake will replace @PROJECT_NAME@ in
# a configured file with the CMake PROJECT_NAME variable's value.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
		${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY}
)

## call make doc to generate documentation
add_custom_target(doc
		${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
		DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
		WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
		COMMENT "[${PROJECT_NAME}] Generating Fail* documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)

## Add CMakeLists from subdirectories ##
# The autogenerated header files
add_subdirectory(config)

# Fail* targets
add_subdirectory(comm)
add_subdirectory(cpn)
add_subdirectory(efw)
add_subdirectory(sal)
add_subdirectory(util)
