+cmake_minimum_required(VERSION 2.8)
+
+find_package(Boost 1.49 COMPONENTS iostreams REQUIRED)
+include_directories(${Boost_INCLUDE_DIRS})
+
+if(NOT DEFINED ENV{MPI_DISABLED})
+ find_package(MPI REQUIRED)
+ set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS})
+ set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} ${MPI_LINK_FLAGS})
+ include_directories(${MPI_INCLUDE_PATH})
+else()
+ message("LATLIB: MPI support is disabled!")
+endif()
+
+add_library(lat_datread datread.cpp)
+target_link_libraries(lat_datread ${Boost_LIBRARIES})
+