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

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

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

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

#install(FILES scalars.xml gwrite_scalars.ch gread_scalars.ch job.pbs DESTINATION ${PROJECT_BINARY_DIR}/examples/C/scalars)
