include_directories(${PROJECT_SOURCE_DIR}/src/public)
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/examples/C/attributes)
include_directories(${PROJECT_BINARY_DIR}/src/public)
link_directories(${PROJECT_BINARY_DIR}/examples/C/attributes)

add_executable(attributes_write attributes_write.c)
if(MPI_COMPILE_FLAGS)
  set_target_properties(attributes_write PROPERTIES COMPILE_FLAGS "${MPI_C_COMPILE_FLAGS}")
endif()
if(MPI_LINK_FLAGS)
  set_target_properties(attributes_write PROPERTIES LINK_FLAGS "${MPI_C_LINK_FLAGS}")
endif()
target_link_libraries(attributes_write adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES})

add_executable(attributes_read attributes_read.c)
if(MPI_COMPILE_FLAGS)
  set_target_properties(attributes_read PROPERTIES COMPILE_FLAGS "${MPI_C_COMPILE_FLAGS}")
endif()
if(MPI_LINK_FLAGS)
  set_target_properties(attributes_read PROPERTIES LINK_FLAGS "${MPI_C_LINK_FLAGS}")
endif()
target_link_libraries(attributes_read adiosread ${ADIOSREADLIB_LDADD} ${MPI_C_LIBRARIES})
#set_target_properties(attributes_read PROPERTIES COMPILE_FLAGS "-DADIOS_USE_READ_API_1")

#install(FILES attributes.xml gwrite_temperature.ch gread_temperature.ch DESTINATION ${PROJECT_BINARY_DIR}/examples/C/attributes)

